Desktop (Code tab): rewinding/editing a message resumes the session in its launch folder, not the worktree it had entered — session silently leaves the worktree
Status Open
Reported on v2.1.284
Maintainer reply None cached
Activity 0 comments · opened Oct 7, 2026
App: Claude desktop, Code tab, macOS. Claude Code binary 2.1.284. Permission mode: auto.
What happened
- A Code-tab session launched in a repo's main checkout (
/Users/<me>/gitroot/cogyard). - Mid-session, the agent moved into a git worktree with
EnterWorktree(.claude/worktrees/task-186-…). All further work happened there; the branch was not merged. - I sent a message, interrupted it, and edited/rewound to an earlier message.
- The app forked and resumed the session — in the ORIGINAL launch folder (main checkout), not the worktree.
From ~/Library/Logs/Claude/main.log (2026-10-06):
20:33:31 LocalSessions.rewindV2: sessionId=local_464b12a7… target=4b21be53…
20:33:31 Stopping session local_464b12a7…
20:33:41 Resuming session local_464b12a7… in /Users/<me>/gitroot/cogyard
20:33:41 [Rewind] resumeSessionAt=7220ca0f… + forkSession for session local_464b12a7…
20:33:42 CLI session ID changed from 2346cc97… to 5e4bf8d1…
Result
The resumed session's working directory was the main checkout. The agent's next steps ran against main instead of the unmerged worktree branch. Nothing in the UI flagged that the session had left the worktree.
Expected
A rewind/edit resumes the session in the same working directory (worktree) it was in at the rewind target — or at minimum, the UI clearly warns that the session has moved back to the launch folder.
Why it matters
Worktree isolation exists so unmerged work never touches main. A rewind silently undoing that isolation can put an agent's edits on the main branch.