[BUG] Worktree should optionally branch from current checked-out branch, not only the default remote branch

Resolved 💬 3 comments Opened Mar 19, 2026 by elainema0215 Closed Mar 22, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When starting a "New Session" in Claude Code Desktop (which creates a git worktree), the worktree is always created from the default remote branch (e.g. master/main), regardless of which branch is currently checked out in the main repository.

This causes confusion when the user is actively working on a feature branch that has diverged significantly from the default branch — the worktree ends up missing all changes from the current working branch, and any modifications made in the worktree show up as a large number of untracked files instead of a clean diff.

What Should Happen?

The worktree should be created from the currently checked-out branch's HEAD, so that the worktree reflects the user's current working context. This way, any changes made in the worktree session will show as a clean, minimal diff against the current branch.

Error Messages/Logs

Steps to Reproduce

In the main repo, checkout a feature branch (e.g. trexbeta-AI-architecture) that has commits not on master
Open Claude Code Desktop and click "New Session" (which creates a worktree)
Observe the worktree is based on master, not trexbeta-AI-architecture

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

Claude Code Desktop (macOS)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

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