{"version":"2.1.72","anchor":"exitworktree-tool","canonical_anchor":"exitworktree-tool","heading":"ExitWorktree Tool","tier":null,"area":null,"scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.72\/e\/exitworktree-tool","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.72","markdown":"### ExitWorktree Tool\n\n**What**\n\nA new tool that allows exiting a worktree session mid-conversation without ending the session, returning to the original working directory.\n\n**Details**\n\n- Accepts `action: \"keep\"` to preserve the worktree and branch on disk, or `action: \"remove\"` to delete both\n- When removing a worktree with uncommitted changes, requires explicit `discard_changes: true` confirmation\n- Checks for uncommitted files and unmerged commits before removal\n- Only operates on worktrees created by EnterWorktree in the current session\n- The EnterWorktree tool message now references ExitWorktree: \"Use ExitWorktree to leave mid-session, or exit the session to be prompted\"\n\n**Evidence**\n\nNew tool definition (search for `\"ExitWorktree\"`)"}