{"version":"2.1.302","anchor":"worktree-cleanup-now-keepscleans-entered-existing-worktrees","canonical_anchor":"worktree-cleanup-now-keepscleans-entered-existing-worktrees","heading":"Leaving an existing worktree now uses a shared check for keep or clean up","tier":"notice","area":"Worktrees","scope":"individual","heads_up":true,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.302\/e\/worktree-cleanup-now-keepscleans-entered-existing-worktrees","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.302","markdown":"### Leaving an existing worktree now uses a shared check for keep or clean up\n\nClaude Code uses one shared check to decide whether to keep or clean up a worktree, including one you entered that already existed\n\n**Unclear.** It is not clear what the new check tests or what its cleanup step removes from an existing worktree.\n\n**What**\n\nA worktree is a separate working copy of a git repository. Claude Code now uses one shared check to decide whether to keep or clean up a worktree. Before, it cleaned up only worktrees it had created itself and that were not managed by a hook. When you leave a worktree that already existed before you entered it, Claude Code now runs a cleanup step for it before finishing.\n\n**Why**\n\nThis can change what is left behind on disk when you leave a worktree that already existed.\n\n- Area: Worktrees\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: yes"}