[FEATURE] Allow --worktree to branch from current HEAD instead of default remote branch

Resolved 💬 3 comments Opened Feb 23, 2026 by dariusrosendahl Closed Feb 24, 2026

Feature Request

When using claude --worktree (or claude -w), the new worktree always branches from the default remote branch (e.g., main). There's no way to create a worktree based on the current branch/HEAD.

Use Case

When working on a feature branch and wanting to spin up an isolated Claude session to work on a subtask or related change, it would be useful to branch from the current branch rather than main. Currently, the workaround is to manually create a worktree with git and then start Claude in it:

git worktree add .claude/worktrees/my-feature -b worktree-my-feature HEAD
cd .claude/worktrees/my-feature && claude

This loses the automatic cleanup prompt and other niceties of --worktree.

Proposal

Add a --worktree-base flag (or similar) to specify the base branch/ref:

# Branch from current HEAD
claude -w my-feature --worktree-base HEAD

# Branch from a specific branch
claude -w my-feature --worktree-base feature/auth

Alternatively, a simpler approach: make --worktree branch from HEAD by default (matching git worktree add behavior) instead of always using the default remote branch. This would be the least surprising behavior for users already on a feature branch.

A middle ground could be a setting in ~/.claude/settings.json:

{
  "worktree": {
    "baseBranch": "HEAD"
  }
}

Current Behavior

claude --worktree always branches from the default remote branch (e.g., origin/main).

Expected Behavior

Users should be able to control which branch/ref the worktree is based on, either via a CLI flag or a setting.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗