Manage git worktrees via sb (sandbox auditor). Use when isolating work in worktrees, spawning agents in isolated copies, or auditing worktree placement. Ensures worktrees live under worktrees/ not as siblings.
Wraps the sb CLI tool for structured worktree management. All
worktrees must live under worktrees/ (not as repo siblings).
isolation: "worktree" — ensure
worktrees/ exists via sb initsb audit to verify placementsb init
Creates worktrees/ directory and adds it to .gitignore.
sb add <name> [branch]
Always use sb add, never raw git worktree add. This ensures
placement under worktrees/.
sb audit --json
Run after any worktree operation. If any worktree is misplaced
(not under worktrees/), report the violation and suggest
sb add to fix it.
sb list --json
sb prune # remove stale references
sb remove <name> # remove a specific worktree
sb doctor --json
Run when worktree operations fail or state seems inconsistent.
When an agent needs to understand the worktree setup quickly:
sb prime
This outputs agent-optimized context about the current worktree state.
After any worktree mutation (add, remove, prune):
sb audit --json to verify all worktrees are correctly placed