Sonnet Does the Work, Haiku Runs Errands, Opus Makes the Call: Anthropic's Official Claude Code Division-of-Labor Trick
Run three models at once, each doing only what it does best. Better results, fewer tokens. The launch command, division-of-labor details, and complete configuration prompt are all here.
Anthropic officially shared a Claude Code trick: run three models at once, each doing its own job. Sonnet writes code, Haiku runs searches, Opus only makes the final call. Better results and a big reduction in token usage.
Claude Code is Anthropic's command-line coding tool. subagent is its sub-agent mechanism: each subagent works in an independent context window and returns only a summary to the main session, so search results and logs do not flood the main context.
Launch command, one line:
claude --model sonnet --advisor opus
Division of labor:
- Sonnet 5.5 runs the session, writes code, fixes issues
- Haiku 5.5 scans the repo in parallel: handles search, grep, and diff review
- Opus 5.5 acts as advisor and appears only at critical moments
Opus intervenes only three times:
- Before the plan is locked in
- When the same error occurs twice
- Before declaring completion
Sonnet does the work. Haiku runs errands. Opus makes the call.
One level further down, the same logic applies. Fork decisions that require no thought (which file to choose, which tool to use, whether to retry or stop) are handed to JEV for millisecond-level handling; the large model only looks at what truly needs judgment.
Complete configuration tree:
- Sonnet 5.5: runs the main session and coordinates work
- search: Haiku 5.5 scans the repo in read-only mode
- grep: Haiku 5.5 finds call sites in its own context
- audit: Haiku 5.5 checks the diff in a temporary worktree (an independent Git working copy)
- Opus 5.5: advisor; reviews the aggregated diff and then signs off
- JEV: millisecond-level routing for micro-forks
Paste the following prompt into Claude Code:
Reconfigure my Claude Code setup around this tree:
1. Run the main session on Sonnet 5.5 with Opus 5.5 as advisor.
2. Create three Haiku 5.5 subagents in .claude/agents: search (maps the repo), grep (finds call sites), audit (checks the diff).
3. Set isolation: worktree on audit so its checks never touch my working branch.
4. Add one rule to CLAUDE.md: delegate every repo search and test run to the Haiku 5.5 subagents to keep the main context small.
5. Route fast deterministic forks (tool choice, path selection, retries) through JEV.
Show me every change as a diff first. No edits until I go.
The real token savings in this setup come from context isolation. Haiku works in its own window and returns only summaries to the main session. Opus's context is the most expensive resource; freeing it from miscellaneous work is the core of saving money.
The counterintuitive point is that the strongest model does the least work. Opus is like a senior engineer: it doesn't write all the code, only reviews key decisions. Sonnet is the workhorse, Haiku runs errands, and JEV is the millisecond-level router.
That rule—'escalate to Opus only when the same error occurs twice'—is especially smart. It sets an escalation threshold for the model: handle small things yourself, and call in the big guns only when you can't handle it.
This logic has also been validated on other model combinations. A user compared Fable and Opus fixing the same bug: Fable's unit price is higher, but each attempt consumes fewer tokens, making the per-attempt cost lower. Expensive models are expensive because they think clearly, not because of the price tag.
Related docs: Claude Code custom subagents
发布时间: 2026-11-21 00:00