Environment: Claude Code v2.1.220, macOS, terminal (session started with claude --worktree dashboard-navigation)
Steps: Start a session with claude --worktree <name>, finish the work, type /exit.
What happens:
- Instead of quitting, the conversation moves to the background and the background sessions view appears ("Your conversation moved to the background"). From there, esc returns to the backgrounded session and esc returns to the view again, so the two screens ping-pong with no visible way out. The only real exit, ctrl+c twice, appears once in a dense header line, and typing in the input box spawns a new background session instead of leaving.
- The documented worktree cleanup never runs. The worktrees docs say cleanup happens "when you exit an interactive worktree session" (auto-removal when clean, keep-or-remove prompt otherwise), and
/exit is the explicit exit command, yet this clean worktree (no changes, no commits of its own) survived along with its worktree-<name> branch and had to be removed manually with git worktree remove --force and git branch -d. Nothing in the background sessions view says whether quitting from it will offer cleanup either.
Suggestions: /exit in a worktree session should quit and run the worktree cleanup flow, or at minimum say that it backgrounded the session instead; give the background sessions view a visible quit affordance; surface the worktree cleanup state or action on completed worktree sessions; document what quitting from the view does to worktree cleanup.
Environment: Claude Code v2.1.220, macOS, terminal (session started with
claude --worktree dashboard-navigation)Steps: Start a session with
claude --worktree <name>, finish the work, type/exit.What happens:
/exitis the explicit exit command, yet this clean worktree (no changes, no commits of its own) survived along with itsworktree-<name>branch and had to be removed manually withgit worktree remove --forceandgit branch -d. Nothing in the background sessions view says whether quitting from it will offer cleanup either.Suggestions:
/exitin a worktree session should quit and run the worktree cleanup flow, or at minimum say that it backgrounded the session instead; give the background sessions view a visible quit affordance; surface the worktree cleanup state or action on completed worktree sessions; document what quitting from the view does to worktree cleanup.