{"version":"2.1.330","anchor":"worktree-cleanup-keeps-a-worktree-another-live-session-is-in","canonical_anchor":"worktree-cleanup-keeps-a-worktree-another-live-session-is-in","heading":"Worktrees in use by another Claude Code session are no longer removed","tier":"notice","area":"Worktrees","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.330\/e\/worktree-cleanup-keeps-a-worktree-another-live-session-is-in","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.330","markdown":"### Worktrees in use by another Claude Code session are no longer removed\n\nBefore removing a worktree, Claude Code now checks for another running session inside it and keeps the worktree if it finds one\n\n**What**\n\nA worktree is a separate working copy of a git repository. Before removing one, Claude Code now checks for another running Claude Code session working inside it. If it finds one, it keeps the worktree.\n\n- Cleanup: logs that the worktree was kept, and says to delete that session's pid json file if the session is not really running.\n\n- Hints: suggests `claude stop <jobId>` for background sessions, with notes for sessions in VS Code or Claude Desktop.\n\n- ExitWorktree with the remove action: now stops if another session is in the worktree, and checks again for work at the moment of removal.\n\n- On exit: the message says \"Couldn't remove worktree. Kept at\" and explains how to remove it later. The tmux session is closed only if the worktree can be removed.\n\nThis check is controlled by a server-side switch that is off unless it is switched on remotely.\n\n**Why**\n\nIt stops a worktree being deleted while another session, for example one in VS Code or a background job, is still using it.\n\n- Area: Worktrees\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}