[BUG] Desktop (Windows): session worktree creation fails with "already exists" because the worktree path is sent without the drive letter (/work/... instead of C:/work/...)
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?
On Windows, creating a session worktree through the Claude desktop app fails with:
git worktree add failed: Preparing worktree (new branch 'claude/<slug>') fatal: '/work/myrepo/.claude/worktrees/<slug>' already exists (reported by the remote host)
The repository is at C:\work\myrepo (path anonymized). The path in the error has lost its drive letter. Afterwards the target folder does not exist, and every failed attempt leaves a branch claude/<slug> that points at HEAD with 0 commits. On 2026-10-15 this happened 4 times within 10 minutes on the same repo (4 orphan branches).
What I could pin down:
- The path passed to
git worktree addis drive-less:/work/myrepo/.claude/worktrees/<slug>instead ofC:/work/myrepo/.claude/worktrees/<slug>. (On 2026-09-02~/.claude/remote/run/*/remote-server.logalso showedchdir \work\myrepo/.claude/worktrees/....) - The target folder is created empty before
git worktree addruns (seen on 2026-09-02). - Git for Windows 2.45.1, given a drive-less absolute path, reports the empty pre-created folder as "already exists". It succeeds when the path has the drive letter, or when the folder is not pre-created (tested 2026-09-02). Step 3 was re-tested today with the commands under Steps to Reproduce.
- After the failure the folder is removed, so only the orphan branch remains.
What Should Happen?
The worktree path should keep its drive letter (C:/work/myrepo/.claude/worktrees/<slug>) so the worktree is created. A failed attempt should not leave a 0-commit orphan branch behind.
Error Messages/Logs
git worktree add failed: Preparing worktree (new branch 'claude/<slug>') fatal: '/work/myrepo/.claude/worktrees/<slug>' already exists (reported by the remote host)
Steps to Reproduce
- Windows 11, git repository on drive C: (e.g.
C:\work\myrepo), Git for Windows 2.45.1. - Start a session on that repository with worktree isolation in a way that goes through the desktop app's host bridge. Seen with:
a) a session started on this PC from another device (Remote Control) with worktree isolation (2026-09-02), and
b) a session started from a "start a new session" suggestion card in the desktop app with its own worktree (2026-10-15).
- The session fails to start with the error above;
git branch --list "claude/*"shows a new 0-commit branch, and there is no folder under.claude\worktrees.
Step 3 of the cause alone, PowerShell at the repo root:
New-Item -ItemType Directory .claude\worktrees\x
git worktree add "/work/myrepo/.claude/worktrees/x" -b t/x
# fatal: '/work/myrepo/.claude/worktrees/x' already exists (branch t/x is still created)
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
Claude desktop app 2.37337.1 (MSIX), bundled Claude Code 2.1.295; standalone CLI 2.1.263 also installed
Platform
Other
Operating System
Windows
Terminal/Shell
Other
Additional Information
- Windows 11 (10.0.26200), Git for Windows 2.45.1.windows.1, claude.ai subscription through the Claude desktop app (Code tab).
- Version note: the desktop app's bundled Claude Code is 2.1.295; npm latest is 2.1.300.
- Workaround: open the session without worktree isolation (repository root), then create the worktree from inside the session with a full path (
git worktree add C:/work/myrepo/.claude/worktrees/<name> -b <branch>); that works every time. - Cleanup needed after each failure:
git branch -d claude/<slug>for the 0-commit branch.