01Git worktrees as the isolation boundary
- Decision
- Every task runs in its own worktree + branch; the agent can only ever affect its own workspace, and the deliverable is always a PR.
- Alternatives
- Letting the agent work directly on a clone (full wipes between runs) or on the main tree with human undo as the safety net.
- Why
- Worktrees are cheap, parallel-safe and natively git — several agent tasks can run concurrently without interfering, and review stays in the normal PR flow instead of a bespoke UI.
- Cost of being wrong
- Disk usage grows with concurrent tasks, and the agent needs solid git hygiene instructions to avoid branch sprawl.