Model Tier Routing
Classify task complexity before every task and every agent spawn, then pick the cheapest model tier that can do the job correctly. No silent defaults — an unclassified task defaults to over- or under-spending. This page holds the general rule.Tier selection
Escalation and downgrade
- Escalate to Opus if any hold: irreversible side effects, deep multi-domain reasoning, failure is hard to detect, or the output becomes downstream ground truth for other work.
- Downgrade to Haiku only if all hold: bounded, single-step, mechanical, no judgment needed.
- Effort flag: if a task warrants more model or effort than the session runs, say so explicitly and let the user decide — do not silently proceed at the lower tier.
Missing model fallback
When a configured model is unavailable (rate-limited, retired, provider outage, wrong id), do not silently cross to a different provider’s model. Demote or promote to the closest model of the same provider first:
Rules:
- Prefer same-provider closest-tier over cross-provider same-tier. Provider tuning matters more than tier label.
- Never silently fall back to a model the user explicitly removed from their config.
- Log the fallback so the run is auditable (
task_progress: model fallback X → Y, reason: missing). - If the fallback model is below the task’s minimum tier, halt for human direction instead of proceeding.
Agent spawning
Always set themodel parameter explicitly on the Agent tool. Never let it default — defaults are blocked in code repositories.
model explicitly on the spawn, or by spawning a custom agent whose frontmatter pins the model.
Define a custom agent only when a repeated job justifies its own prompt and tool limits, and then follow Subagent Cost Model.
Precedence when several settings name a model (Claude Code, checked 2026-10-09): per-invocation model parameter, then agent frontmatter model, then CLAUDE_CODE_SUBAGENT_MODEL, then the main model. The environment variable fills gaps only.
Why a tier discipline pays off
Price ratios are narrower than the old mental model. As of 2026-10-09 Opus 5.5 is $4 / $20 per million tokens against Sonnet 5.5 at $2 / $10, about 2x, and cache reads are $0.20 against $0.10. Haiku 5.5 is about 20x cheaper than Sonnet on input. Most session tokens are cache reads, so the larger saving usually comes from keeping the main context small, not from the cheaper model; see Subagent Cost Model and Claude Code Subagents Pro Limits. Escalating a genuinely hard task can still be cheaper than correction loops on a weaker model. A figure of “~65% fewer tokens for Opus on complex tasks” circulates from the wshobson plugin, but this page has no captured source for it, so treat it as unverified. The inverse holds for trivial work: routing boilerplate to Opus burns budget for no quality gain. The discipline is bidirectional.Related Pages
- Agent Primitive Selection — the broader decision tree for skill vs subagent vs team, of which tier routing is one axis
- Agent Subagents — subagent frontmatter and the
modelfield - Subagent Cost Model — why delegation saves cost; price table; break-even rule
- Agent Self-Correction — the “unsure which model tier” deviation trigger points here
Linked pages
- ACP Protocol
- Agent Primitive Selection
- Agent Self-Correction
- Agent Skills
- Agent Subagents
- AI Code Review
- Laya
- Model-Task Routing (OpenCode Go)
- Pi Agent (pi-mono)
- Subagent Cost Model