https://github.com/tqer39/ccw-cli
Claude Code worktree launcher with picker & superpowers preamble
https://github.com/tqer39/ccw-cli
bash claude-code cli git-worktree
Last synced: 23 days ago
JSON representation
Claude Code worktree launcher with picker & superpowers preamble
- Host: GitHub
- URL: https://github.com/tqer39/ccw-cli
- Owner: tqer39
- License: mit
- Created: 2026-04-22T20:06:00.000Z (27 days ago)
- Default Branch: main
- Last Pushed: 2026-04-24T00:24:15.000Z (26 days ago)
- Last Synced: 2026-04-24T00:29:35.690Z (26 days ago)
- Topics: bash, claude-code, cli, git-worktree
- Language: Go
- Homepage:
- Size: 2.73 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

**A thin launcher for [Claude Code](https://docs.claude.com/claude-code)'s built-in `--worktree` β run `ccw` anywhere in the repo to pick an existing worktree (PR info attached) or start fresh. Plain CLI, stays out of your tmux/zellij setup.**
[](go.mod)
[](https://github.com/tqer39/ccw-cli/releases)
[](LICENSE)
[](https://github.com/tqer39/homebrew-tap)
[](https://github.com/tqer39/ccw-cli/actions/workflows/brew-audit.yml)
[](https://codecov.io/gh/tqer39/ccw-cli)
[πΊπΈ English](README.md) Β· [π―π΅ ζ₯ζ¬θͺ](docs/README.ja.md)
---
## β‘ Quick Start
```bash
# 1. install
brew install tqer39/tap/ccw
# 2. run inside any git repo
ccw
```
That's it. `ccw` scans `.claude/worktrees/` and shows the picker, or spins up a fresh worktree if none exist.
## β¨ Features
- π€ **Hand-off and step aside** β pick (or create) a worktree, launch `claude` in it, then ccw exits. No daemon, no wrapper process, no coupling to tmux/zellij β just the bridge.
- π― **Worktree state at a glance** β pushed / ahead / behind / dirty, plus PR info, all in one picker
- π§Ή **Bulk cleanup** β `[clean pushed]` or `ccw --clean-all` sweeps the worktrees you're done with
- π **Machine-readable list** β `ccw -L --json` aggregates worktree Γ git Γ PR Γ session info in one shot, ideal for scripts and Claude Code agent use
## π¬ Demo

> **Note:** the `π¬ RESUME` badge only signals that a session log exists for the worktree. The session title or first prompt is **not** previewed in the picker β `ccw` simply runs `claude --continue` and lets the Claude Code CLI pick the most recent session.
## π Usage
```bash
ccw # pick an existing worktree, or start fresh
ccw -n # new worktree, skip picker
ccw -s # new worktree + inject the localized superpowers preamble as first prompt
ccw -- --model # pass-through: any flags after `--` go to claude verbatim
ccw -L # list ccw worktrees (text table)
ccw -L --json # same, JSON for scripts / agents
ccw -L -d ~/repo --no-pr --no-session # target a specific repo, skip gh and session lookup
ccw --clean-all --status=pushed --dry-run # preview bulk delete targets
ccw --clean-all --force -y # nuke everything without prompt
```
Run `ccw --help` for the full flag reference.
## π― Picker reference
Worktree status badge:
| Badge | Meaning |
|---|---|
| π’ `[PUSHED]` | Clean, upstream tracked, 0 commits ahead |
| π‘ `[LOCAL]` | No upstream, or ahead of upstream |
| π΄ `[DIRTY]` | Working tree has uncommitted changes |
PR state badge (shown only when [`gh`](https://cli.github.com/) is installed and authenticated):
| Badge | Meaning |
|---|---|
| π© `[OPEN]` | PR is open and awaiting review / merge |
| β¬ `[DRAFT]` | PR is a draft |
| πͺ `[MERGED]` | PR has been merged |
| π₯ `[CLOSED]` | PR was closed without merging |
Session badge:
| Badge | Meaning |
|---|---|
| π¬ `RESUME` | Past session log exists β `run` restores the conversation |
| β‘ `NEW` | No session log β `run` starts fresh |
Selecting a worktree opens `[r] run` / `[d] delete` / `[b] back`. `run` calls `claude --continue` to restore the past conversation when a session log exists, or `claude -n ` to start fresh otherwise. Bulk shortcuts (`[delete all]`, `[clean pushed]`, `[custom select]`) remove many at once; dirty items require either `--force` or a three-choice confirm (`y` force Β· `s` skip dirty Β· `N` cancel).
Without `gh`, the picker stays functional and shows a hint; rate-limit / network failures hide the PR column silently.
## π·οΈ Naming
When ccw creates a new worktree, the worktree directory and the Claude Code session name are kept 1:1:
- Directory: `/.claude/worktrees//`
- Session name: `` (set via `claude -n `)
`` is generated as `ccw----` (e.g. `ccw-tqer39-ccw-cli-260426-143055`). `` / `` come from the `origin` remote URL; the timestamp is the worktree creation time in your local timezone. When `origin` is unset, `` becomes `local` and `` is the directory basename. Duplicate names (e.g. two worktrees created within the same second) are disambiguated with `-2`, `-3`, β¦ Renaming the session manually with `/rename` is fine β ccw does not track it, and `--continue` keys off the working directory so conversation restore is unaffected.
## π¦ Installation
### Homebrew (recommended)
```bash
brew install tqer39/tap/ccw
```
### From source
```bash
git clone https://github.com/tqer39/ccw-cli ~/ccw-cli
go build -o ~/.local/bin/ccw ~/ccw-cli/cmd/ccw
```
Make sure `~/.local/bin` is on your `PATH`.
### Requirements
- [`git`](https://git-scm.com/)
- [Claude Code](https://docs.claude.com/claude-code) `>= 2.1.76` β ccw uses `--worktree ` (added in 2.1.49) together with `-n ` (added in 2.1.76). ccw offers to install `claude` via npm / brew if missing.
- *(optional)* [`gh`](https://cli.github.com/) β enables PR info in the picker
- *(optional)* [superpowers](https://github.com/obra/superpowers) plugin β declared in [`.claude/settings.json`](./.claude/settings.json) so Claude Code prompts to install it on first launch in this repo
## βοΈ Environment
| Variable | Effect |
|---|---|
| `NO_COLOR=1` | Disable colored output |
| `CCW_DEBUG=1` | Verbose debug logging |
| `CCW_LANG=en\|ja` | Force output language. Overridden by `--lang`. Falls back to system locale (`LC_ALL` / `LC_MESSAGES` / `LANG`), then English. |
Exit codes: `0` success Β· `1` user error / cancel Β· anything else is forwarded from `claude`.
## π οΈ Development
```bash
go test ./...
go vet ./...
go build ./cmd/ccw
```
Set up the full dev environment (Homebrew required) with:
```bash
make bootstrap
```
This installs the Homebrew packages listed in [`Brewfile`](Brewfile), provisions Go / Node via [`mise`](https://mise.jdx.dev/), and enables [lefthook](https://github.com/evilmartians/lefthook) pre-commit hooks.
See [`docs/assets/picker-demo-setup.sh`](docs/assets/picker-demo-setup.sh) + [`picker-demo.tape`](docs/assets/picker-demo.tape) to regenerate the demo GIF with [vhs](https://github.com/charmbracelet/vhs).
## π€ Built With
This project was built with [Claude Code](https://docs.claude.com/claude-code) using Claude **Opus 4.7**.
## π License
[MIT](LICENSE)