If you use Claude Code across multiple projects, you know the pain:
- Switching
CLAUDE_CONFIG_DIRbetween accounts - Branch conflicts when reviewing a PR while coding a feature
- Conversations expire and you lose all context
- Copy-pasting ticket URLs into Claude over and over
I got tired of this and built CW — a single Bash script that orchestrates everything.
## One command, everything handled
bash
cw work my-app https://linear.app/team/issue/PROJ-123
This single command:
1. Routes to the correct Claude account
2. Creates an isolated git worktree
3. Fetches the ticket context from Linear via MCP
4. Creates a persistent session with notes
5. Launches Claude Code ready to work
The full workflow
# Setup (once)
cw init
cw account add work
cw account add personal
cw project register ~/code/my-app --account work
# Work on a task
cw work my-app fix-auth # plain branch
cw work my-app PROJ-123 # ticket ID
cw work my-app https://linear.app/... # Linear URL
cw work my-app fix-auth # resume where you left off
cw work my-app fix-auth --done # cleanup
# Review a PR
cw review my-app 42 # isolated worktree
cw review my-app 42 --done # close
# See everything
cw spaces # active tasks & reviews
How it works
Worktree isolation
Every task and review gets its own git worktree. No checkout conflicts, no stashing.
my-app/
├── src/ # main branch (untouched)
├── .tasks/
│ ├── fix-auth/ # worktree → fix-auth branch
│ └── PROJ-123/ # worktree → branch from Linear
└── .reviews/
└── pr-123/ # worktree → PR branch
Session persistence
Context survives conversation loss. A TASK_NOTES.md file is symlinked into each worktree and persists in ~/.cw/sessions/. When you
resume, Claude reads the notes to restore context. No more starting from scratch.
URL integrations
Pass a Linear, GitHub, or Notion URL and CW parses it, detects the service, and tells Claude to fetch the full context via MCP. You
need the corresponding MCP connectors installed in your Claude account:
claude mcp add --transport http linear https://mcp.linear.app/mcp
claude mcp add --transport http github https://api.githubcopilot.com/mcp
claude mcp add --transport http notion https://mcp.notion.com/mcp
Multi-account routing
Each project maps to a Claude account. CW sets CLAUDE_CONFIG_DIR automatically:
cw work company-app feat-x # → work account
cw work side-project feat-y # → personal account
Bonus features
- Agent teams — cw work my-app big-feature --team splits work across multiple Claude teammates in parallel
- Project bootstrapping — cw create "SaaS app with Next.js" scaffolds a project from scratch and launches Claude to build it
- Live arcade dashboard — cw arcade opens a real-time dashboard showing all sessions across accounts
- PR auto-close — review sessions close automatically when Claude submits the review
The stack
It's a single Bash script (~2000 lines). No build tools, no frameworks. Dependencies: Claude Code CLI, Git 2.15+, Python 3.6+, Bash
4+.
Try it
git clone https://github.com/avarajar/cw.git && cd cw && ./install.sh
GitHub: github.com/avarajar/cw
Feedback welcome — what would you add?
Top comments (0)