{"version":"2.1.331","anchor":"exitworktree-and-enterworktree-refuse-when-the-original-dire","canonical_anchor":"exitworktree-and-enterworktree-refuse-when-the-original-dire","heading":"Worktree switching now catches folders that point somewhere else","tier":"notice","area":"Worktrees","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.331\/e\/exitworktree-and-enterworktree-refuse-when-the-original-dire","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.331","markdown":"### Worktree switching now catches folders that point somewhere else\n\nExitWorktree now notices when the original folder points elsewhere, and EnterWorktree adds path checks and refuses some wildcard paths\n\n**What**\n\nA worktree is a separate working copy of a git repository that Claude Code can switch into and out of.\n\n- `ExitWorktree` now notices when the original folder has been redirected, for example through a symlink (a file that points to another location) or a path that now points somewhere new. It used to notice only a folder that no longer existed. It moves the session back to a safe working folder and logs a message saying the folder \"is gone or leads elsewhere\". Its result has a new `isLedElsewhere` field.\n\n- `EnterWorktree` adds more path checks, and refuses a session path that contains any of `*`, `?`, `[` or `]` while `blockReadsOutsideWorkingDirectories` is on.\n\n**Why**\n\nIt makes switching between worktrees harder to trick with folders that were swapped or redirected underneath Claude Code.\n\n- Area: Worktrees\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}