[BUG] New Code tab sessions never create a worktree — both stay on main in the shared repo root

Status Fixed / completed
Maintainer reply None cached
Activity 1 comment · opened Sep 4, 2026 · closed Sep 4, 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?

Claude Desktop 1.46388.1, Windows 11, git repo on external drive.

New Code tab sessions never create a git worktree. Two sessions opened against the same repo both operate directly in the repo root on main, sharing one working directory with no isolation between them. git worktree list never shows more than [main], even after sessions have run tasks, created branches, and committed.

Reproduced on both an existing repo with prior commits and a fresh empty repo created solely for this test, ruling out repo-specific state as the cause. Manual git worktree add succeeds without issue on the same drive/filesystem, ruling out git or filesystem support as the cause. This appears distinct from #91405 and #91472, which describe a worktree pool reassigning or releasing worktrees that were successfully created — here, no worktree is ever created in the first place.

What Should Happen?

Each new Code tab session should get its own isolated git worktree on session start, as described in the desktop docs. git worktree list should show a distinct entry per active session, and concurrent sessions should not share a working directory or risk overwriting each other's uncommitted changes.

Error Messages/Logs

Steps to Reproduce

Create a new folder
git init
create a file and commit
create a claude session, have it create a claude.md template
create another session have it create a file and mention in claude.md template
open terminal in both
pwd in both -> both show repo root
git worktree list -> both show main only
commit the second session's work
git worktree list -> both show same branch

Claude Model

_No response_

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

Claude Desktop 1.46388.1

Platform

Other

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

Maybe Related: link #91405 and #91472

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗