{"version":"2.1.285","anchor":"worktree-registration-cleanup-in-git-with-symlink-and-vetti","canonical_anchor":"worktree-registration-cleanup-in-git-with-symlink-and-vetti","heading":"Safer cleanup of leftover git worktree records","tier":"notice","area":"Worktrees","url":"https:\/\/changelogs.core-directive.com\/v\/2.1.285\/e\/worktree-registration-cleanup-in-git-with-symlink-and-vetti","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.285","markdown":"### Safer cleanup of leftover git worktree records\n\nRemoving a stale git worktree record now checks its paths first, refuses links and odd paths, and respects locked worktrees\n\n**Unclear.** Which command triggers this cleanup is not stated.\n\n**What**\n\nA git worktree is an extra working copy of a repository in another folder, and git keeps a small record of each one inside the `.git` folder. When Claude Code removes a record for a worktree that no longer exists, it now does more checking first:\n\n- it verifies where the record points before touching it\n\n- it refuses symbolic links (shortcuts to other locations) and unusual paths\n\n- it leaves locked worktrees alone\n\nIf it cannot complete the checks, it shows a warning starting \"Could not vet the worktree registrations\".\n\n**Why**\n\nThis makes worktree cleanup harder to abuse with a deliberately crafted repository that tries to trick Claude Code into deleting files it should not.\n\n- Area: Worktrees\n- Tier: You'll notice\n- Useful: 1\/5\n- Signal: 1\/5"}