Feature: Offer to implement approved plans in a new git worktree
Summary
After a plan is approved in /plan mode, offer the user an option to implement the plan in a new git worktree rather than the current working directory. This would make parallel development with multiple Claude Code sessions significantly smoother.
Motivation
Claude Code already supports running parallel sessions in separate git worktrees, and the docs recommend this approach. However, the current workflow requires manual setup:
- Exit Claude or open a new terminal
- Run
git worktree add ../project-feature -b feature-branch cdinto the new worktree- Start a new Claude session
- Re-explain or paste the plan
This friction discourages parallel work. If the plan approval step offered a "implement in new worktree" option, the entire flow would be seamless — especially for users running multiple Claude instances simultaneously.
Proposed Behavior
After a plan is approved (user accepts via ExitPlanMode), Claude would present an additional choice:
Plan approved. How would you like to proceed?
1. Implement here (current behavior)
2. Implement in a new worktree
If the user selects "Implement in a new worktree", Claude would:
- Prompt for a branch name (or auto-suggest one based on the plan, e.g.,
feat/add-oauth-support) - Create the worktree:
git worktree add ../<repo>-<branch> -b <branch> - Switch its own working directory to the new worktree
- Implement the plan in the isolated worktree
The original working directory remains untouched and available for other Claude sessions or manual work.
Why This Matters for Multi-Claude Workflows
When using multiple Claude Code instances simultaneously (e.g., one investigating a bug, another implementing a feature), they can conflict if they share a working directory — uncommitted changes collide, branch switching causes chaos, and file edits interfere with each other.
Worktrees solve this perfectly, but the manual setup breaks the flow. Integrating worktree creation into the plan approval step means:
- Zero-friction parallelism: Approve a plan and it starts in an isolated environment automatically
- No branch conflicts: Each plan gets its own branch and directory
- Safe to run multiple Claudes: The main worktree stays clean for other sessions
- Easy review: Each plan's changes are on a dedicated branch, ready for PR
Additional Considerations
- Worktree cleanup: Could offer to clean up the worktree after a PR is created, or list active worktrees via a command
- Resumability: Since each worktree gets its own session history,
/resumewould naturally work per-worktree - Naming convention: Auto-suggested worktree paths could follow a convention like
../<repo>-<branch-name>to keep things organized - Headless mode:
claude -p --plancould accept a--worktreeflag to enable this non-interactively - Plan transfer: The approved plan context should be carried into the new worktree session so Claude doesn't lose any context from the planning phase
Example Flow
$ claude
> /plan Add OAuth2 support to the authentication system
[Claude explores codebase, asks clarifying questions, produces plan]
Plan approved. How would you like to proceed?
> Implement in a new worktree
Branch name: feat/oauth2-support
Creating worktree at ../platform-feat-oauth2-support...
Switched to new worktree. Implementing plan...
[Claude implements the plan in the isolated worktree]
Meanwhile, in the original directory, another Claude session continues uninterrupted.
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗