{"version":"2.1.285","anchor":"worktree-cleanup-hardened-and-worktree-deregistration-replac","canonical_anchor":"worktree-cleanup-hardened-and-worktree-deregistration-replac","heading":"Safer cleanup of leftover git worktrees","tier":"notice","area":"Worktrees","url":"https:\/\/changelogs.core-directive.com\/v\/2.1.285\/e\/worktree-cleanup-hardened-and-worktree-deregistration-replac","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.285","markdown":"### Safer cleanup of leftover git worktrees\n\nClaude Code now removes stale git worktrees more carefully, checking each one before deleting and replacing the old prune step\n\n**Unclear.** It is not clear which features run this cleanup.\n\n**What**\n\nA git worktree is an extra working folder linked to the same repository. When Claude Code runs git on a machine you provide, its cleanup of leftover worktrees has changed:\n\n- stale worktrees are removed with `worktree remove --force`, skipping ones that cannot be removed because they are Windows reparse points (links to other locations)\n\n- worktrees are unregistered with a limited, contained step instead of running `worktree prune`\n\n- before deleting, the scan checks the worktree's gitdir file, confirms the repository root is the expected one, and compares file identity numbers\n\n**Why**\n\nThese checks lower the risk of deleting the wrong folders, especially on shared or network drives.\n\n- Area: Worktrees\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5"}