What
A worktree is a separate working copy of your project that Claude Code can work in alongside your main one. ExitWorktree is the tool Claude uses to leave a worktree, and it can remove the worktree on the way out. When asked to remove it, ExitWorktree now also checks the worktree's folder of files saved from connectors (outside services Claude Code is linked to).
- If that folder holds saved files, removal is refused unless
discard_changesis true - If the folder cannot be checked, removal is also refused unless
discard_changesis true - The refusal message lists the saved files alongside any uncommitted files and commits
- A second check right at removal time stops with an error if the folder gained files or could not be read
When removal is refused, the session stays in the worktree. Before, only uncommitted files and commits could block removal.
Why
Files saved from connectors are no longer lost without warning when a worktree is removed.
Names in the bundleExitWorktree