zo build is the flagship command. It reads the plan, decomposes it into phases, generates contracts for every active agent, and launches the Lead Orchestrator in a tmux session that drives the team to completion.
Synopsis
Smart mode detection
zo build auto-detects what to do based on the project’s current state:
| State | Behaviour |
|---|---|
Fresh (no STATE.md or phase = init) | Build from scratch. Phase 1 is the entry point. |
| In-progress | Continue from the recorded phase. Loads the previous phase’s snapshot for context. |
| Plan edited since last run | Detects the diff via timestamp + content hash. Re-decomposes. Surfaces the change to the human if the diff crosses a phase boundary. |
zo build figures it out.
What it does
Validate plan
Parses the plan and runs full validation. Aborts on any error before launching the agent session.
Resolve project context
Finds memory, target, and delivery repo via
_load_project_context(). Supports both .zo/-portable layout and legacy top-level memory/.Build orchestrator
Decomposes the plan into phases (mode-specific). Generates contracts: per-agent inputs, outputs, success criteria, time budget, precedent. Builds the Lead Orchestrator’s spawn prompt with full context (plan + phases + agent roster + memory + coordination instructions + per-project agent adaptations).
Launch session
Creates a tmux pane (default) or runs headless (
--no-tmux). Pastes the Lead Orchestrator’s prompt. The Lead reads the full plan, creates the team via TeamCreate, and drives execution.Monitor
The Python
LifecycleWrapper observes via ~/.claude/tasks/ and the tmux pane. Captures lifecycle events, pipes them to JSONL comms log, prints the live task list and recent agent events in your terminal. Auto-launches the training dashboard split-pane during Phase 4.Gate handling
At every phase boundary, checks artifact contracts and oracle thresholds. Automated gates auto-PROCEED. Blocking gates pause; you approve via
/gates:approve or reject via /gates:reject.Gate modes
--gate-mode controls human involvement:
- supervised (default)
- auto
- full-auto
Every gate pauses for human review. Maximum oversight. Best for the first run of a new project.
zo gates set <mode> -p <project>.
Permission prompts: —bypass-permissions
--gate-mode controls human involvement at ZO’s phase gates. Independently, Claude Code’s tool-call permission prompts can also be auto-approved with --bypass-permissions. The two are independent, but --gate-mode full-auto implicitly turns bypass on (no-human-on-gates plus must-click-every-tool is a contradiction).
| Flags | Gates | Permission prompts |
|---|---|---|
--gate-mode supervised (default) | human approves | human approves each |
--gate-mode supervised --bypass-permissions | human approves gates | auto-approved (walk away) |
--gate-mode auto | auto on success, pause on must-pass fail | human approves each |
--gate-mode auto --bypass-permissions | auto on success, pause on fail | auto-approved |
--gate-mode full-auto | all auto | auto-approved (implied) |
--gate-mode full-auto --bypass-permissions | all auto | auto-approved (redundant) |
- Headless (
--no-tmux): passes--dangerously-skip-permissionsto the Claude Code CLI. - Tmux (default): temporarily overlays
permissions.defaultMode: "bypassPermissions"onto your project’s.claude/settings.local.jsonfor the duration of the run. The original file is backed up to.claude/settings.local.json.zo-backupand restored automatically when the run exits (viaatexit). If ZO crashes mid-run, the nextzocommand auto-detects the stale backup and restores.
--no-tmux runs unconditionally bypassed permissions. Now they only bypass when --bypass-permissions or --gate-mode full-auto is set. If you previously relied on --no-tmux --gate-mode supervised for prompt-free runs, add --bypass-permissions to keep that behavior.
Cross-machine: —repo
When you’ve moved a project from one machine to another (Mac dev → GPU server), use--repo to point at the delivery repo containing the .zo/ layout:
zo build auto-detects --repo from the plan path when it’s inside .zo/plans/. So if you cd into the delivery repo and run zo continue, the inference happens for free.
Live monitoring
Whilezo build is running, you have several windows into what the team is doing:
tmux pane
Ctrl-b n switches to the agent session. Watch the Lead Orchestrator coordinate the team in real time. Ctrl-b p returns.Training dashboard
Auto-launched as a split-pane during Phase 4. Rich Live panel: progress bar, metrics table, sparkline, checkpoints. See
zo watch-training.Comms log
JSONL events at
logs/comms/<date>.jsonl. Five event types: message, decision, gate, error, checkpoint. Replayable.Options
| Option | Default | Purpose |
|---|---|---|
--gate-mode | supervised (or full-auto if --low-token) | supervised / auto / full-auto |
--no-tmux | (off) | Disable interactive tmux flow. Headless mode for one-shot agents. Note: multi-phase orchestration requires the interactive session; --no-tmux is for init and draft, not full builds. |
--repo PATH | (auto) | Path to delivery repo with .zo/. Auto-inferred when the plan path is inside .zo/plans/. |
--low-token | (off) | Activate the cost-saving preset. See low-token mode. |
--lead-model | opus (or sonnet if --low-token) | Override the lead orchestrator model: opus / sonnet / haiku. |
--max-iterations N | 10 (or 2 if --low-token) | Hard cap on Phase-4 experiment iterations. Wins over plan and preset. |
--no-headlines | (off) | Skip the end-of-session Haiku bullet summary (~1 Haiku call per run, ~$0.0002). |
--bypass-permissions | (off) | Auto-approve Claude Code tool-call prompts. Implied by --gate-mode full-auto. See Permission prompts. |
Examples
First run of a fresh project
First run of a fresh project
supervised gate mode. The Lead Orchestrator runs Phase 1; you approve at every gate.Auto-mode after first validation
Auto-mode after first validation
Resume on a new machine
Resume on a new machine
zo continue is shorthand for zo build against the project’s known plan, with .zo/ auto-detected.Overnight unattended run
Overnight unattended run
Pro plan / student account, minimise token spend
Pro plan / student account, minimise token spend
Low-token mode with override
Low-token mode with override
What you’ll see
When zo build stops
The session ends cleanly when:
- Phase 6 completes: all artifacts present, all tests pass, oracle confirmed. The final delivery is in the delivery repo.
- A blocking gate is hit: human input required. The session stays alive in tmux; you approve/reject via slash commands.
- The autonomous experiment loop returns DEAD_END or BUDGET_EXHAUSTED: escalates to human.
- You
/exit: graceful shutdown. Session summary written, tmux window killed.
Next
Phases & gates
What happens at each phase and gate.
Memory & continuity
How
zo build resumes across sessions.