{"version":"2.1.333","anchor":"worktree-cleanup-and-resume-hardening","canonical_anchor":"worktree-cleanup-and-resume-hardening","heading":"Safer cleanup and resume of agent worktrees","tier":"notice","area":"Worktrees","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.333\/e\/worktree-cleanup-and-resume-hardening","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.333","markdown":"### Safer cleanup and resume of agent worktrees\n\nOld agent worktrees are no longer cleaned up in untrusted repositories, and resuming a worktree is more careful with links\n\n**Unclear.** It is not clear whether these changes are switched on for everyone by default.\n\n**What**\n\nA worktree is a separate working copy of a git repository, which Claude Code can create so an agent works without touching your main folder. Three changes:\n\n- Cleanup of old agent worktrees is skipped when you have not trusted the repository's root folder.\n\n- When a worktree is resumed, it keeps its old starting point if moving it would change its symbolic links (shortcuts to other files).\n\n- If resetting a worktree fails, the links it added are now removed. Before, it was resumed unchanged.\n\n**Why**\n\nClaude Code does less to worktrees in folders you have not trusted, and a failed resume no longer leaves stray links behind.\n\n- Area: Worktrees\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}