
Three Models, One Pipeline: Claude Code's Per-Subagent Model Routing Cuts Costs 60-80%
Chris Harper
2 min read
Aug 12, 2026 · 04:07 UTC
Assigning Haiku 4.5, Sonnet 5, and Fable 5 to the right tasks in a multi-agent workflow cuts API costs 60-80% with no quality loss — here's the decision framework with copy-paste SDK code.
In Claude Code's Workflow SDK, every agent() call defaults to the session model (Sonnet 5). But Haiku 4.5 runs at $1/$5 per million tokens — half the cost of Sonnet 5 — and handles any task where reasoning depth isn't the bottleneck: file reads, searches, grep-equivalent scans, and simple classification. Reserving Fable 5 for decisions where a wrong answer is expensive keeps architectural reviews high-quality without applying that cost across every agent in the fan-out.
Decision framework:
| Task | Model | Why |
|---|---|---|
| Search, grep, file reads | Haiku 4.5 | Content retrieval — speed over depth |
| Implement, debug, write | Sonnet 5 (default) | Strong code reasoning at locked-in $2/$10 |
| Architectural decisions | Fable 5 | Complex judgment worth the extra cost |
| Binary checks (test pass/fail) | Haiku 4.5 | One-token output; waste to use Sonnet |
SDK code:
export const meta = {
name: 'routed-workflow',
description: 'Model-routed multi-agent example',
phases: [{ title: 'Search' }, { title: 'Implement' }, { title: 'Review' }],
}
// Fan out cheap searches with Haiku
const findings = await parallel(files.map(f => () =>
agent(`List all auth-related functions in ${f}`, {
model: 'claude-haiku-4-5-20251001',
label: `scan:${f}`,
phase: 'Search',
})
))
// Implement on default Sonnet 5
const impl = await agent(
`Implement auth changes based on: ${findings.filter(Boolean).join('\n')}`,
{ phase: 'Implement' }
)
// Escalate one architectural review to Fable
const review = await agent(
`Review this auth implementation for security regressions and propose alternatives:\n${impl}`,
{ model: 'claude-fable-5', phase: 'Review' }
)
Cost math example. 20 files × 3K tokens (Haiku) + 1 implementation at 50K tokens (Sonnet 5) + 1 architectural review at 25K tokens (Fable):
- Haiku searches: 60K tokens × $1/M = $0.06
- Sonnet implementation: 50K × $2/M = $0.10
- Fable review: 25K × ~$15/M = $0.38
- Total: $0.54 vs $1.50+ if everything ran on Fable
With Sonnet 5's pricing now locked in permanently at $2/$10, these economics are stable — build the routing now.
Sources: Claude Code model config — code.claude.com · Claude model pricing — anthropic.com · Multi-model routing guide — buildthisnow.com