{"version":"2.1.285","anchor":"forced-worktree-removal-now-vets-path-identity-and-registrat","canonical_anchor":"forced-worktree-removal-now-vets-path-identity-and-registrat","heading":"Forced removal of agent worktrees now checks for links pointing outside the repository","tier":"notice","area":"Worktrees","url":"https:\/\/changelogs.core-directive.com\/v\/2.1.285\/e\/forced-worktree-removal-now-vets-path-identity-and-registrat","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.285","markdown":"### Forced removal of agent worktrees now checks for links pointing outside the repository\n\nForce-deleting an agent's worktree now refuses when the path goes through a link or no longer matches, and cleans up only stale git records\n\n**What**\n\nA worktree is an extra working copy of a git repository that lives in its own folder. Claude Code can create one for an agent to work in. When Claude Code force-deletes one of these worktrees, it now first checks what the stored folder path really points to. It refuses to delete anything in two cases:\n\n- The path reaches into the repository through a link, meaning a shortcut-like file system entry, that comes from outside the repository.\n\n- The folder it checked is not the same one that is actually at that path.\n\nIn both cases nothing is force-deleted. The message asks you to remove the link or the folder yourself, or to try again.\n\nGit keeps a list of worktrees it knows about. When entries in that list are out of date, Claude Code now removes just those entries. Before, it only checked that the worktree's git data linked back to the repository and then told git to clean up every out-of-date entry at once.\n\n**Why**\n\nThese checks stop a forced deletion from following a link and deleting files outside the repository by mistake.\n\n- Area: Worktrees\n- Tier: You'll notice\n- Useful: 1\/5\n- Signal: 1\/5"}