Skip to content
Methodology

Model Routing for Coding Agents: Cut Cost, Keep Quality

You do not run one model for everything. Plan with the expensive model, delegate execution to the cheap one, and reserve frontier rates for the hard parts. Here is the routing pattern, a task-to-model decision matrix, and the cost math behind it.

Quick answer

Model routing is matching each coding task to the cheapest model that can do it well instead of running one model for everything. The core pattern: a frontier planner (Claude Fable 5.1, or Claude Opus 5.5 when Fable's rate is more than the feature warrants) drafts specs, architects, and reviews, then delegates routine execution to a workhorse (Claude Sonnet 5.5), a fast tier (Claude Haiku 5.5), or Codex (GPT-6.1 Sol/GPT-6 Luna). Because output tokens dominate coding spend, moving execution off the frontier tier cuts cost 5x to 100x on those tokens while quality stays where it matters. Prices verified October 9, 2026 (Claude) and September 30, 2026 (GPT-6).
One-line definition
Match each task to the cheapest model that can do it well
The pattern
Plan with the frontier model, execute with the cheap one (Claude Fable 5.1 plans, Claude Sonnet 5.5/GPT-6.1 Sol execute)
Why it saves
Output tokens dominate spend; routine work is the bulk of it
Frontier vs fast (output)
$50 vs $0.50 per MTok, a 100x delta
01

What Model Routing Is, and Why One Model for Everything Wastes Money

Model routing is the practice of sending each coding task to the cheapest model that can do it well, rather than picking one model at the start of a project and running it for everything. The frontier tier is priced for the hardest reasoning; most of the work a coding agent does is not the hardest reasoning. Paying frontier rates for routine execution is the single most common and most invisible way agentic coding budgets get burned.

The waste is structural, not incidental. Coding output is token-heavy, and output tokens are the expensive half of the meter. Run every feature through Claude Fable 5.1 at $50 per million output tokens and a codebase-full of routine edits, tests, and renames costs the same per token as a genuinely hard cross-cutting refactor, even though Claude Sonnet 5.5, priced 5x lower on output, would have produced identical routine code. The frontier model is not doing anything special on the easy work; you are just paying as if it were.

02

The Tiers, Their Real Prices, and What Each Is For

Routing only works if you know the roster. Both vendors ship a capability ladder, Anthropic in four rungs (frontier, flagship, workhorse, fast) and OpenAI's GPT-6 family in three, and the price gap between top and bottom on output tokens is about 100x on both sides. Verified prices and positioning across both CLIs (AIDEN runs both), as of October 9, 2026 (Claude) and September 30, 2026 (GPT-6):

ModelVendorTierPrice (per MTok)ContextWhere it fits
Claude Fable 5.1Anthropicfrontier$10 in / $50 out per MTok1M tokens (128K max output)Plan, architect, review the hard parts
Claude Opus 5.5Anthropicflagship$4 in / $20 out per MTok1M tokens (128K max output)Claude Code's default; complex day-to-day feature work
Claude Sonnet 5.5Anthropicworkhorse$2 in / $10 out per MTok1M tokens (128K max output)Routine features, tests, refactors
Claude Haiku 5.5Anthropicfast$0.10 in / $0.50 out per MTok1M tokens (128K max output)Mechanical edits, sub-agents, triage
GPT-6 AstraOpenAIfrontier$10 in / $50 out per MTok1,050,000 tokens (128K max output)The hardest Codex runs, when a failed run costs more than the premium
GPT-6.1 SolOpenAIflagship$2 in / $10 out per MTok1,050,000 tokens (128K max output)OpenAI's recommended Codex model; default executor
GPT-6 LunaOpenAIfast$0.10 in / $0.50 out per MTok1,050,000 tokens (128K max output)Cheap mechanical work in Codex

The prices tell you where each tier earns its place. Claude Fable 5.1 is the frontier: Anthropic's highest-capability model and its recommended step up when Claude Opus 5.5 at higher effort falls short, but $50/MTok out and not Claude Code's default; you select it explicitly. Claude Opus 5.5 is that default, at $20/MTok out. Claude Sonnet 5.5 gives you a 1M window at $10/MTok out and the best Terminal-Bench 4.0 score in Anthropic's launch table (70.6%), the value tier for real work. Claude Haiku 5.5 is the floor at $0.50/MTok out on prompts up to 100K tokens, now with a 1M window of its own, built for sub-agent fan-outs and lint-fix mechanical changes, not complex autonomous coding. On the Codex side the ladder has one rung fewer: GPT-6.1 Sol as the recommended default, GPT-6 Astra for the hardest runs, GPT-6 Luna for cheap volume. Full detail on each is on the models hub, with tier-picking guides for Claude and Codex.

03

The Delegation Pattern: Planner Drafts and Reviews, Executor Implements

Routing is not just picking a model once per task in isolation, the highest-leverage version is a delegation pattern within a single unit of work. The expensive model does the thinking that is hard to get right; a cheaper model does the typing that is not. Concretely, Fable plans, Codex or Sonnet execute, Fable reviews.

  1. 1

    The frontier model plans (spend frontier tokens here)

    Point Claude Fable 5.1 at the codebase and have it draft the spec: files to touch, the approach, acceptance criteria, explicit exclusions. This is exactly where its 1M-token window and Anthropic's highest-capability reasoning pay for themselves, a large-context spec review is a frontier-tier job. It is a small slice of the total tokens and the one place a wrong decision is expensive.
  2. 2

    A cheaper model executes (spend most tokens here)

    Hand the approved spec to a workhorse: Claude Sonnet 5.5 on the Claude side, GPT-6.1 Sol on the Codex side, or Claude Haiku 5.5/GPT-6 Luna for genuinely mechanical work. Because the scope is written down, the executor gets a bounded contract, not a vague brief, and a cheaper model with a good spec beats a frontier model with a fuzzy one.
  3. 3

    The frontier model reviews (spend a little frontier again)

    Bring the diff back to Claude Fable 5.1 and have it check the implementation against the spec: does it match, did anything out of scope change, do the acceptance criteria hold? The reviewer is not grading its own homework, and reviewing a diff is cheaper than writing it. This closes the loop without paying frontier rates for the bulk execution.

The reason this works is that the token distribution is lopsided. Planning and review are a thin layer of high-value tokens; execution is the thick layer of routine tokens. Routing puts the expensive model only on the thin layers. The same split works one rung down when a feature does not warrant Fable's rate: Claude Opus 5.5, Anthropic's recommended default, plans and reviews while Claude Sonnet 5.5 executes, and Claude Code's opusplan model setting builds exactly that in (Opus in plan mode, Sonnet for execution). The mechanics of running two model families on one repo, branches, worktrees, and the shared spec that acts as the contract, are covered in using Claude Code and Codex together; this article is about which model gets which layer and why.

Your AI workspace for shipping software.

Download AIDEN free and point it at your existing Claude Code or Codex setup. No credit card, running in minutes.

Download AIDEN free

Free to start · macOS 12+ · No credit card required

04

The Decision Matrix: Task Type to Model

Here is the routing table in one place. Read it as a starting heuristic tuned to the current roster, not a law, your codebase gets the final vote. The rule underneath every row: escalate a tier when a wrong early step is expensive, drop a tier when the work is bounded and you review it anyway.

Task typeRecommended modelWhy
Hard, cross-cutting refactorClaude Fable 5.1Tangled multi-file reasoning where one wrong step costs the run; Anthropic's highest-capability model earns its $10 in / $50 out per MTok here, once Claude Opus 5.5 at higher effort falls short
Spec drafting / large-context reviewClaude Fable 5.1 (or Claude Opus 5.5)The planning-and-review layer is where frontier tokens belong; Opus is the cheaper first try
Complex day-to-day featureClaude Opus 5.5Flagship, Anthropic's recommended default and Claude Code's starting model, at $4 in / $20 out per MTok; Fable costs 2.5x as much
Routine CRUD, tests, refactorsClaude Sonnet 5.5Workhorse with a 1M window at $2 in / $10 out per MTok; a good spec makes it as good as a frontier model on bounded work
Feature work and bulk edits in CodexGPT-6.1 Sol (or GPT-6 Astra)OpenAI's recommended Codex model at $2 in / $10 out per MTok; escalate to Astra ($10 in / $50 out per MTok) only when a failed run costs more than the premium
Cheap / throwaway mechanical editsClaude Haiku 5.5 / GPT-6 LunaBoth fast tiers cost $0.10 in / $0.50 out per MTok (Haiku's rate rises above 100K-token prompts); plenty for renames, lint fixes, sub-agents, and triage you review anyway

Two rows deserve a note. The frontier appears twice, refactors and spec review, because both are reasoning-bound and both are cheap as a share of total tokens; that is precisely the profile you want to spend up on. The fast tier also appears twice, Claude and Codex, because the cheapest model that clears the bar is a fine default for mechanical work regardless of vendor. When both CLIs are in play, route the feature to whichever family fits and let cost break the tie.

05

The Cost Math, Kept Honest

The savings claim is easy to hand-wave, so here is a rough, clearly illustrative split using catalog output prices (output dominates coding spend). Assume a feature worth roughly 2M output tokens of agent work: a thin planning-and-review layer and a thick execution layer. Take the split as about 15% planning/review and 85% execution, which matches the lopsided distribution routing exploits.

Illustrative feature ~= 2,000,000 output tokens
(output prices only; verified October 9, 2026)

A) All-frontier (Claude Fable 5.1, $50/MTok out)
   2.0M x $50                         = $100.00

B) Routed (plan/review on Fable, execute on Claude Sonnet 5.5)
   plan+review  0.3M x $50  = $15.00
   execution    1.7M x $10   = $17.00
   total                                   = $32.00

C) Routed to the floor (execute on Claude Haiku 5.5, $0.50/MTok)
   plan+review  0.3M x $50  = $15.00
   execution    1.7M x $0.50 = $0.85
   total                                   = $15.85

Routing execution to Claude Sonnet 5.5 takes the output bill from $100.00 to about $32.00, roughly a 3.1x reduction, and routing the mechanical slice to Claude Haiku 5.5 pushes it near $15.85, close to a 6.3x reduction, all while the planning and review stay on the frontier model. Plan and review on Claude Opus 5.5 instead of Fable and line B drops to $23.00. The exact multiple depends on your token split and ignores input tokens and caching, but the shape is robust: the more of your work is routine, the more routing saves, because you keep frontier rates on the thin layer and pay workhorse or fast rates on the thick one.

06

The Failure Modes of Routing

Routing is a lever, and like any lever it can be pulled wrong. Three failure modes account for most of the disappointment:

Routing too aggressively

Chasing the cheapest tier on work that is subtly hard. The cheap model fails, you re-run it, maybe escalate anyway, and the retries plus your wasted attention cost more than doing it on the right tier the first time. Cheap-per-token is not cheap-per-result.

Cheap model on a frontier task

A tangled refactor or an architecture call handed to Claude Sonnet 5.5 or a fast tier because it looked routine. Anthropic's own table puts Claude Sonnet 5.5 at 52.1% on FrontierCode v1.1 (at xhigh effort) against 54.4% for Claude Opus 5.5, and Claude Haiku 5.5 at 46.4%: modest gaps on a benchmark, but on genuinely hard work they become wrong code you review at length or ship by mistake.

Context handoff loss

The planner understood the codebase; the executor starts cold. If the only thing that crosses the handoff is a thin prompt, the cheap model re-derives context badly or misses constraints the planner knew. The fix is a written spec as the contract, not a verbal toss-over.
07

How AIDEN Routes: Both CLIs, One Board, Model per Feature

Routing only pays off if switching models is cheap and the handoff is enforced. That is what AIDEN is built for. It is a cockpit over the CLIs you already have, it orchestrates Claude Code and Codex side by side on one spec-first kanban board, BYO inference (your own Claude and Codex subs or keys), local-first, PR-per-feature. Because both CLIs run at once, routing is a per-card choice, not a per-project commitment.

Model per feature

Every feature card gets an agent and model assignment. The planning feature goes to your frontier model (Claude Fable 5.1); execution features go to a workhorse (Claude Sonnet 5.5) or to Codex (GPT-6.1 Sol). The delegation pattern becomes a dropdown instead of a discipline.

The spec is the handoff

AIDEN's spec gate means every feature gets a written, approved spec before any CLI starts coding. That approved spec is exactly the contract that prevents context-handoff loss, the executor inherits the planner's intent in writing, not a thin prompt.

Worktree and PR per feature

Each feature runs in its own git worktree and lands as its own PR, so a frontier planning session and a cheap execution session never collide, and every routed piece of work is reviewable in isolation.

The result is that plan-with-the-expensive-model, execute-with-the-cheap-one stops being a manual juggling act across terminals and becomes the default shape of the board. Assign the planning feature to Claude Fable 5.1, fan the execution features out to Claude Sonnet 5.5 and GPT-6.1 Sol, and review on the frontier again, all in one project. If you are still choosing between the two CLIs, start with Claude Code vs Codex; the routing pattern here assumes you have answered “both.” AIDEN is free for one project and Solo is $20/mo, so you can put a real routed workflow on a board today. And once the window matters as much as the model, pair this with context engineering, the other half of getting good work out of a coding agent cheaply.

QUESTIONS

FAQ

Should I use one model or several for coding?
Several, if you care about cost. Running a frontier model like Claude Fable 5.1 on every task is like hiring a principal engineer to write CRUD boilerplate: it works, but you overpay by multiples. The efficient pattern is model routing, use the expensive model for planning, architecture, and review, and delegate routine execution to cheaper, faster tiers. On the same task shape, that split can cut spend several-fold while keeping quality where it matters, on the hard parts.
Which Claude model is cheapest for coding?
Claude Haiku 5.5 at $0.10 in / $0.50 out per MTok, the fast tier built for sub-agents, classification, and quick mechanical edits, now with a 1M-token window. That rate covers prompts up to 100K tokens; above that it bills $0.50/$2.50. For real feature work at a low price, Claude Sonnet 5.5 is the value pick at $2 in / $10 out per MTok, with a 1M-token window. Claude Opus 5.5 ($4 in / $20 out per MTok) is Anthropic's recommended default and Claude Code's starting model; reserve Claude Fable 5.1 ($10 in / $50 out per MTok) for the hard, cross-cutting work that actually needs it. Prices verified October 9, 2026.
Can Claude and Codex work on the same project?
Yes. Both are CLIs operating on a local git checkout, so you can route a planning feature to Claude Code and execution features to Codex on the same repo. The safe pattern is one branch or worktree per task so the agents never share a working directory, plus a written spec as the contract between them. AIDEN runs both CLIs on one kanban board and lets you assign the model per feature.
How much can model routing save?
It depends on your task mix, but the arithmetic is favorable whenever most of your tokens are routine. Because output tokens dominate coding spend, moving execution off a frontier tier (Claude Fable 5.1 at $50/MTok out) onto a workhorse (Claude Sonnet 5.5 at $10/MTok out) or fast tier (Claude Haiku 5.5 at $0.50/MTok out) is a 5x to 100x reduction on those tokens, while you still spend frontier rates only on the small planning-and-review slice. The savings scale with how much of your work is genuinely routine.
Does a bigger model always write better code?
No. A frontier model earns its price on hard, cross-cutting reasoning, tangled refactors, architecture, review of large diffs, where a wrong early step is expensive. On well-scoped, mechanical work (a new endpoint matching an existing pattern, a batch of tests, a rename), a workhorse or fast tier produces the same result for a fraction of the cost and often faster. Anthropic's own launch table makes the point: on Terminal-Bench 4.0, Claude Sonnet 5.5 (70.6%) and Claude Opus 5.5 (66.4% at xhigh effort) both outscore Claude Fable 5.1 (55.8%). The skill is matching the tier to the task, not defaulting to the biggest model.
CONTINUE

Keep reading

START BUILDING

Route the model per feature, not per project.

AIDEN runs Claude Code and Codex side by side on one board, so the planning feature goes to your frontier model and execution features to a cheaper one, per card. Free for one project.

MACOS 12+ · BRING YOUR OWN CLAUDE CODE OR CODEX · YOUR CODE STAYS LOCAL