What problem does it solve? In-process sub-agents share one checkout, so a confused agent can write files outside its assigned scope, sweep other agents' staged files into commits, and break the main branch. This Skill launches Claude Code as a real OS subprocess with its working directory hard-scoped to a target directory or a dedicated git worktree, giving filesystem-enforced isolation instead of prompt-based convention. ## Core Features & Use Cases - Subprocess dispatch: Run claude -p non-interactively in any directory and receive a JSON result with success status, exit code, final text output, session ID, cost, and duration. - Git worktree lifecycle: Create or reuse worktrees on sibling paths, and clean them up only when they have no uncommitted changes and their branch is fully merged, leaving failed runs inspectable. - Combined flow: One command creates the worktree, dispatches the sub-agent, and applies merge-aware cleanup, with exit codes that compose with shell scripting. - Use Case: A coordinator agent dispatching an implementation task gets a sub-agent whose writes are physically confined to its own worktree, then merges the branch and cleans up automatically once the work is verified. ## Quick Start Dispatch a sub-agent to implement a task in an isolated git worktree by running the run-in-worktree script with the repo path, a branch name, and the task prompt.