What
A worktree is a separate working copy of a git repository that Claude Code can switch into and out of.
ExitWorktreenow 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 newisLedElsewherefield.EnterWorktreeadds more path checks, and refuses a session path that contains any of*,?,[or]whileblockReadsOutsideWorkingDirectoriesis on.
Why
It makes switching between worktrees harder to trick with folders that were swapped or redirected underneath Claude Code.