Blog · 2026-07-14 · Vynaris Team
Do coding-agent model routers actually save money? Up to 58%, until the cache resets
Routing a coding agent's mechanical turns to a cheaper model saves up to 58%, but cross-model cache churn cuts real savings to 25-45%. The per-task math.
Route a coding agent's mechanical turns to a cheaper model and you cut the bill 43% with [Claude Haiku 4.5](/models) or 58% with deepseek-v4-flash, in the best case. Interleave those turns the way a real agent loop does, add a 15% misroute rate, and the same routing nets 25–39%. The savings are real. They are also smaller than the router READMEs suggest, and the gap is prompt-cache churn.
Prices verified 2026-07-14 against Anthropic's live pricing page; deepseek-v4-flash from our 2026-07-13 price snapshot.
Verdict
Strategy Model mix $/1,000 tasks Savings vs all-Opus Pick when
--------------------------------------- ------------------------------- ------------- ------------------- ------------------------------------
All Opus 4.8 (baseline) Opus every turn $1,353 — every turn needs the quality ceiling
Route to Haiku 4.5, batched Opus plan / Haiku mechanical $773 43% mechanical turns run consecutively
Route to Haiku 4.5, interleaved plan and mechanical alternate $950 30% the realistic agent loop
Route to deepseek-v4-flash, batched Opus plan / DeepSeek mechanical $568 58% cheapest, cross-provider is fine
Route to deepseek-v4-flash, interleaved alternate $751 45% realistic, cross-providerAdd a 15% misroute rate (cheap model flubs a turn, you redo it on Opus) and the interleaved rows land at $1,019 (25%) for Haiku and $819 (39%) for DeepSeek. Every number here is recomputed from the assumptions below by a script we publish; edit the inputs and the answer moves.
Three routers shipped this week
The reason this question is live: three coding-agent [model routers](/glossary/model-routing) hit Hacker News in the same week, and none of them charges you a classification tax.
Router Approach Routing cost HN
------------------------ --------------------------------------------------------------------------- ---------------------------------- ----------------------
Weave (workweave/router) on-device cluster scorer, picks a model per turn in under 50ms local compute, no extra model call 216 pts / 113 comments
WayfinderRouter deterministic offline hard-or-easy score, 0.0–1.0, per prompt local compute, no model call 123 / 56
Frugon analyzes your call logs, flags which calls a cheaper model could take (MIT) local, offline 66 / 23All three score difficulty locally. That matters for the math: an [LLM router](/glossary/llm-router) that called a model to decide would add tokens to every request. These do not. Weave's README claims "Cut costs 40-70% with just an endpoint change" and its Show HN reports "40% savings on tokens" by sending planning to Opus 4.8 and context-gathering to DeepSeek V4. Frugon is honest about its own limit: its split is "a projection, not a measurement," and it ships a --measure flag to verify on real outputs before you switch.
Our model lands in the same range as Weave's 40% claim, and shows where it holds and where it slips.
What we modeled
A [coding agent](/glossary/coding-agent) does not send one prompt. It runs a loop: read the repo, plan, edit, run tests, read the failure, edit again. Each turn re-sends a large cached prefix, the [system prompt](/glossary/system-prompt) plus [tool](/glossary/tool-use) schemas plus your instruction file, then adds a little fresh input and generates a little output.
Assumption Value
------------------------------------------ --------------------------------------------
Turns per task 12 (4 planning, 8 mechanical)
Cached prefix (system + tools + CLAUDE.md) 40,000 tokens
Growth per turn (fresh input + output) 4,500 tokens
Output per turn 1,500 tokens
Prompt caching on: read 0.1x input, 5-min write 1.25x input
Prefix at turn 12 89,500 tokensThe 40,000-token prefix is the middle of the range we measured in our [coding-agent scaffolding teardown](/blog/coding-agent-scaffolding-token-overhead-cost-2026): 33,000 bare, 59,000 loaded with a production instruction file. The prices:
Model Input $/1M Output $/1M Cache write 5m Cache read
----------------- ---------- ----------- -------------- ----------
Opus 4.8 5.00 25.00 6.25 0.50
Haiku 4.5 1.00 5.00 1.25 0.10
deepseek-v4-flash 0.14 0.28 0.14* 0.0028*DeepSeek charges no cache-write premium; a write is billed at standard input, a hit at $0.0028/1M.
Where the savings come from, and where they leak
With caching on, the baseline's $1,353 per 1,000 tasks splits into $559 cache writes, $344 cache reads, and $450 output. Routing attacks two of those.
Output is the easy win. Every mechanical turn still generates 1,500 tokens. On Opus that output costs $0.0375 a turn; on Haiku, $0.0075; on [deepseek-v4-flash](/glossary/deepseek), $0.00042. Move eight mechanical turns off Opus and you stop paying the $25/1M [output rate](/glossary/cost-per-token) on two thirds of the session.
The leak is the cache. Prompt caching is per model. When the agent hands a turn to Haiku, Haiku has never seen the 40,000-token prefix Opus already cached. Haiku must write its own copy first. That cross-model cold write costs $72.50 per 1,000 tasks on Haiku and $8.12 on DeepSeek, at the point of the switch.
Do it once and it barely dents the win. That is the batched case: group all mechanical turns together, pay the cross-model write a single time, and Haiku routing saves 43%. Interleave planning and mechanical turns, which is what an agent loop actually does, and every switch back to a model forces it to re-cache the prefix growth it missed while the other model worked. Haiku routing falls from 43% to 30%. The 13-point drop is pure [cache](/glossary/prompt-caching)-write churn, the same failure mode we quantify in the [cache-write penalty analysis](/blog/prompt-cache-write-churn-cost-2026).

DeepSeek survives interleaving better because its write premium is zero. Re-caching a 58,000-token prefix on DeepSeek costs $8.12; on Haiku it costs $72.50. The cheaper the model's cache write, the less interleaving hurts. That is the counterintuitive part: cross-provider routing to DeepSeek, which sounds like it should suffer the worst cache penalty, suffers the least, because DeepSeek does not charge extra to write cache.
To test your own task shape, prefix size, and planning-to-mechanical ratio, put your numbers into the cost calculator before you wire up a router.
The misroute tax
Local scorers are fast and free, but they are not oracles. When a cheap model takes a turn it cannot handle, the agent notices on the next test run and redoes the work, often on the expensive model. Each redo is a full Opus turn you pay twice for.
At a 15% misroute rate on mechanical turns, one of eight turns gets redone, and the interleaved Haiku route drops from 30% to 25% savings. This is where Frugon's honesty matters: its --measure flag exists because a projected easy/hard split is not a measured one. A router that misroutes 30% of the time can erase most of its own savings.
When not to route
Routing is a net loss on the short, high-stakes session. If your task is three turns and every turn is real reasoning, there are no mechanical turns to offload, and the cross-model cache write costs more than the output you saved. Skip it.
Skip it too when your agent already runs on a mid-tier model. Route from Opus to Haiku and you cut output cost 5x. Route from Haiku to DeepSeek and the absolute dollars are already small; the [context window](/glossary/context-window) management and the misroute risk cost more attention than the cents you recover.
And skip it when your prefix is not cached. Routing assumes a stable cached prefix that the cheap model reads instead of the expensive one. If your harness churns the cache every turn, you are paying write rates everywhere, and routing changes which expensive write you pay, not whether you pay it.
The honest verdict
Coding-agent routers save money. On a realistic interleaved session with a modest misroute rate, expect 25–45%, not the 40-70% on the box. The savings are largest when you route to a model with a cheap cache write (DeepSeek), when mechanical turns are groupable, and when your prefix is genuinely cached. They shrink toward zero on short sessions, high misroute rates, and cache-churning harnesses.
The routers themselves are not the variable. All three we looked at score locally and add no token overhead. What decides the outcome is your task shape and your cache discipline. Fix the cache first; then route.
For the broader question of whether router vendors' savings claims survive scrutiny, see our [router savings claims audit](/blog/llm-router-savings-claims-audit-2026).
Sources
- Anthropic pricing (input/output, cache multipliers), verified 2026-07-14: https://platform.claude.com/docs/en/docs/about-claude/pricing
- Weave router, "Smart model routing directly in Claude, Codex and Cursor" (HN 216/113): https://github.com/workweave/router
- WayfinderRouter (HN 123/56): https://github.com/itsthelore/wayfinder-router
- Frugon, local cost analyzer, MIT (HN 66/23): https://github.com/Rodiun/frugon
- Reproducible math for every figure in this post: artifacts/coding-agent-model-routers-savings-math-2026-math.py