πŸ“ Subsystem Deep Dive

tools/ExitWorktreeTool/

πŸ“ tools/ExitWorktreeTool/ πŸ“„ 6 files

Tutorial: ExitWorktreeTool

The ExitWorktreeTool provides a safe mechanism for an AI agent to conclude a temporary coding session ("worktree"). It allows the agent to either keep the changes for later or remove them cleanly, while automatically detecting uncommitted work to prevent accidental data loss. Once the session ends, it strictly restores the environment (working directory and caches) to its original state.

flowchart TD A0["Tool Definition & Interface"] A1["Session Context Restoration"] A2["Safety Gates (Change Detection)"] A3["Worktree Lifecycle Actions"] A4["UI Rendering"] A0 -->|"Validates safe removal"| A2 A0 -->|"Executes cleanup or preserv..."| A3 A0 -->|"Triggers state reset"| A1 A0 -->|"Formats output message"| A4

Chapters

  1. Tool Definition & Interface
  2. Safety Gates (Change Detection)
  3. Worktree Lifecycle Actions
  4. Session Context Restoration
  5. UI Rendering

Generated by Code IQ

Files in this section