Teams as graph engineering
August 10, 2026
Multi-agent coding work is a directed acyclic graph: nodes are named teammates, edges are --after dependencies, and a supervisor drains the graph wave by wave — locally or across a device pool. That is graph engineering applied to real coding CLIs, not a slide deck. Command: agents.
Visual longform: shareable HTML edition. Stack overview: loop + graph engineering.
Why a graph
Linear chains (A then B then C) break under real product work: independent surfaces want parallelism; QA should wait on backend and frontend; a planner can add nodes mid-flight. A DAG encodes that once — true parallelism for independent nodes, joins for multi-parent deps, no circular waits.
Graph engineering designs topology (who exists, edges, ownership). Loop engineering designs how each agentic node thinks. You need both — each teammate is still a full Claude/Codex/… loop.
The edge: --after
Edges are declared on the dependent node. There is no --before flag — same edge, one direction. Names are required when using --after. Cycles are rejected at add time.
agents teams add feat claude "Implement /api/pricing" --name backend
agents teams add feat codex "Build pricing UI" --name frontend
# Multi-parent join
agents teams add feat claude "Playwright suite" --name qa --after backend,frontend| Concept | In AGI CLI |
|---|---|
| Node | Named teammate (--name) |
| Edge | --after A on B |
| Join | --after A,B,C |
| Ready set | startReady each wave |
Wave scheduler
agents teams start --watch is a continuous DAG dispatcher: rescan disk (pick up mid-flight teams add), launch every teammate whose deps are terminal, wait, repeat until drained.
agents teams start pricing-page --watch
# --interval 8 seconds between waves (default)
# --max-waves 1000
# --json one JSON object per waveState machine per teammate: PENDING → RUNNING → COMPLETED | FAILED. Disk-backed meta.json so the supervisor can restart mid-flight. Drained ≠ all green — check failed count.
Distributed placement
One orchestrator owns the DAG. Placement is a separate axis from dependency:
--device Xon add — pin (never second-guessed)- Team
--devices a,b,c— unpinned teammates auto-schedule (reachability, load, agent installed, caps) - No viable device — fail loud, never silent fallback to local
agents teams create feat \
--devices yosemite-s0,yosemite-s1 \
--repo [email protected]:org/app.git \
--enable-worktrees
agents teams add feat claude "API" --name backend --device yosemite-s0 --worktree api
agents teams add feat claude "UI" --name frontend --device yosemite-s1 --worktree ui
agents teams add feat claude "QA" --name qa --after backend,frontend --worktree qa
agents teams start feat --watchBoundary contracts
Topology without ownership is a race. --after only orders time — if A must finish before B because they edit the same files, re-cut the split. Use --enable-worktrees and unique worktree names for edit-mode teammates.
Hands-on recipe: Parallel work with teams.
Cookbook
agents teams create pricing -d "Ship /pricing" --enable-worktrees
agents teams add pricing claude "Backend" --name backend --worktree backend
agents teams add pricing codex "Frontend" --name frontend --worktree frontend
agents teams add pricing claude "E2E" --name qa --after backend,frontend --worktree qa
agents teams start pricing --watch
# Mid-flight graph growth
agents teams add pricing claude "Fix flake" --name bugfix --after qa --worktree bugfix
agents teams message pricing qa "Skip visual snapshot for now"
agents teams status pricing
agents sessions --teams
agents teams disband pricing