[Bug]: Externally created Git worktrees are treated as “Local” #1714
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/desktop
Steps to reproduce#
create a new thread;
ask the model to create a new worktree (or have it on AGENTS.md as steps to start a new task like I do)
check T3 Code indicator pointing as "local"
check the "Open button" loading the original repo folder, instead of the worktree.
Expected behavior#
The worktree should be recognized as a Worktree, regardless of how it was created
Actual behavior#
T3 Code does not recognize the new Worktree and it thinks it's on the original repo folder.
Impact#
Minor bug or occasional failure
Version or commit#
No response
Environment#
No response
Logs or stack traces#
Screenshots, recordings, or supporting files#
Workaround#
No response
paulomanrique(GitHub profile, opens in a new tab) added labelsbug
paulomanrique(GitHub profile, opens in a new tab) added labelsneeds-triage
+1, this also breaks trust in the footer indicator more generally. Concrete case: the agent created a worktree + branch
feat/age-permis-conditionsfromorigin/devmid-thread, and the composer footer still shows "Local checkout · dev" for the rest of the conversation. As a user I can never tell with certainty which branch/worktree the thread is actually operating on — the indicator looks authoritative but reflects the initial binding, not reality. Looking forward to #3754.juliusmarminge added labelsneeds more info
Tested on 1dfb572871 with
git worktree add. Selecting the external worktree started the agent there, andt3_worktree_listreturned its correct path. Creating a worktree alone kept the existing thread at its original directory, matchingpwd. Which provider and commands moved your session into the worktree, and does this still occur on the latest version?Thanks for testing, your result matches mine. Re-tested today on
0.0.46-nightly.20261021.3457with Claude (Opus 5.5):git worktree add -b repro-a ../repro-a-wt HEAD+cd ../repro-a-wt:t3_worktree_statusreturnsattached: false, and the next shell command is back at the project root. So in my original case the agent was working in the worktree viacd/absolute paths while the thread stayed bound to the root checkout. The footer was technically right; that part isn't a bug.- The supported path,
t3_worktree_handoffwith acontinuationPrompt, does rebind the thread, but the Claude turn then fails with "The provider event stream closed unexpectedly", the continuation stays Queued, and "Waiting on background task mcp__t3-code__t3_worktree_handoff" can't be stopped. That's #15136 / #15993 (fix in #15203, still open).
So with Claude there's currently no working way for an agent to move its own thread into a worktree, which is why agents fall back to
git worktree add+cdand end up in the #1714 situation. From my side this can be closed in favor of #15136.t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
I encontered this too. In the session I pointed it to the correct directory, and I hope it will go well from there.