[BUG] ExitWorktree fails for worktrees created via Desktop app worktree mode
Resolved 💬 3 comments Opened Apr 15, 2026 by taige Closed Jul 2, 2026
Description
When starting a Claude Code Desktop session with the "worktree" option selected, a worktree is created under .claude/worktrees/<name> and the session operates inside it. However, calling ExitWorktree returns a no-op error:
No-op: there is no active EnterWorktree session to exit. This tool only operates on worktrees created by EnterWorktree in the current session.
The worktree was created in the current session, but through the Desktop app's UI flow rather than the EnterWorktree tool. The ExitWorktree tool does not recognize it.
Steps to Reproduce
- Open Claude Code Desktop
- Start a new conversation, select "worktree" mode
- Session starts in
.claude/worktrees/<random-name>/(confirmed working) - Ask Claude to exit the worktree (or call
ExitWorktreedirectly) - Tool returns no-op error — cannot exit
Expected Behavior
ExitWorktree should recognize worktrees created by the Desktop app's worktree mode, not only those created by the EnterWorktree tool call.
Workaround
Manual cleanup:
cd /path/to/repo
git worktree remove .claude/worktrees/<name>
Environment
- Claude Code Desktop (macOS)
- Model: claude-opus-4-6
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗