01
Problem
Multi-agent coding systems typically spend LLM tokens on coordination — deciding which agent works on what, routing tasks, merging results. This coordination overhead adds cost, latency, and non-determinism where none is needed.
02
Solution
Keep the orchestrator as deterministic Python code that spends zero LLM tokens on coordination. The LLM budget goes entirely to the agents doing actual work.
Goal → Decompose (deterministic) → Assign to parallel agents → Verify (tests) → Commit
The orchestrator handles:
- Task decomposition via rule-based planning
- Agent assignment and parallel spawning (Claude Code, Codex CLI, Gemini CLI)
- Result verification through test execution
- Git operations (branching, merging, committing)
Agents handle:
- Code generation
- Problem solving
- Implementation decisions
03
How to use it
# Single goal → parallel agents → verified commits
bernstein -g "Add JWT auth with refresh tokens, tests, and API docs"
# Headless for CI pipelines
bernstein --headless
# Self-evolution mode: propose and sandbox improvements
bernstein --evolve --budget 5.00
Key implementation choices:
- No LLM router — task-to-agent mapping is code, not prompts
- Test-driven verification — a janitor process runs tests after each agent completes
- Git worktree isolation — each agent works in its own worktree, no conflicts
- Circuit breaker — halt on test regression, no silent failures
04
Trade-offs
Pros:
- Predictable coordination cost (zero LLM tokens)
- Deterministic behavior — same goal produces same task breakdown
- Faster iteration — no waiting for LLM to decide what to do next
- Supports heterogeneous agents (Claude Code, Codex CLI, Gemini CLI, Qwen)
Cons:
- Rigid decomposition — can't handle ambiguous goals that need LLM judgment to split
- Requires well-defined project structure for rule-based planning
- Less adaptive than LLM-routed orchestration for novel task types
06
References
- Bernstein — Production implementation of this pattern
- See also: Sub-Agent Spawning for the general multi-agent delegation pattern
- See also: Plan-Then-Execute Pattern for the planning phase approach