What
A new tool that allows exiting a worktree session mid-conversation without ending the session, returning to the original working directory.
Details
- Accepts
action: "keep"to preserve the worktree and branch on disk, oraction: "remove"to delete both - When removing a worktree with uncommitted changes, requires explicit
discard_changes: trueconfirmation - Checks for uncommitted files and unmerged commits before removal
- Only operates on worktrees created by EnterWorktree in the current session
- The EnterWorktree tool message now references ExitWorktree: "Use ExitWorktree to leave mid-session, or exit the session to be prompted"
Evidence
New tool definition (search for "ExitWorktree")
Strings lifted out of the shipped bundle, so the claim above can be checked against them.
One source agreesOne thing we can check says the same as this entry.
Anthropic's release notes agree
Added ExitWorktree tool to leave an EnterWorktree session