A developer cut Claude API spend 35% by routing tasks across Opus, Sonnet, and Haiku. Quality on hard tasks rose because Opus stopped handling busywork.
A developer cut monthly Claude API spend about 35% by routing tasks across Opus, Sonnet, and Haiku by task type. The move also improved quality on hard tasks by reserving Opus for work where being wrong is expensive.
Key facts
- Monthly API spend dropped ~35% after routing by task type
- Defaulting down to Sonnet drove most of the cost savings
- Haiku handles lint fixes, renames, commit messages, log summaries
- Opus reserved for architecture, race conditions, security reviews
- Escalation rule: 2 validation failures moves task one tier up
The developer, writing on dev.to, ran a fully autonomous coding agent that handles dozens of tasks daily — from lint fixes to multi-file refactors. For months, every task went to the same top-tier model. After a month of splitting work across Claude Opus, Sonnet, and Haiku by task type, monthly API spend dropped about 35%, average latency fell, and quality on hard tasks went up because Opus stopped burning attention on busywork According to the developer's post on dev.to.
The routing logic is deliberately simple: a category lookup, not a dynamic classifier. Haiku handles mechanical, low-ambiguity work — lint fixes, import sorting, renames, commit messages. Sonnet is the default workhorse for anything unclear. Opus handles architecture decisions, race conditions, security reviews, and auth/data integrity. The developer tried building a "meta-agent" to decide routing in real time and abandoned it: "Static rules beat a dynamic router for the 80% of tasks where the answer doesn't change."
Key Takeaways
- A developer cut Claude API spend 35% by routing tasks across Opus, Sonnet, and Haiku.
- Quality on hard tasks rose because Opus stopped handling busywork.
Why defaulting down beat routing up
The single biggest cost driver wasn't the Haiku bucket — it was changing the default. "That single habit change (defaulting down, not up) accounted for more of the cost savings than the Haiku bucket did," the developer wrote. Sending unclear tasks to Sonnet instead of Opus "just in case" eliminated the top-tier price premium on routine work.
This is a pattern worth watching as Anthropic ships more model tiers. Claude Code with Opus 4.8 scores 88.6% on SWE-bench Verified and 69.2% on SWE-bench Pro, per the knowledge graph — but those benchmarks measure top-tier capability, not cost efficiency. The economics of an agentic workload depend on routing discipline, not raw model quality.
The safety mechanism is the escalation rule: if a Haiku or Sonnet task fails validation twice, it automatically moves one tier up. "Fails validation" means the test suite still fails, the diff doesn't apply cleanly, or a follow-up check flags the change as only partially done. This lets the cheap tier be aggressively cheap without betting the whole task on correct classification the first time.
The developer's numbers are self-reported from a single month of operation, and the post doesn't disclose absolute dollar figures or task counts. The 35% figure is directional — routing savings will vary with the mix of trivial vs. hard tasks in any given workload. But the structural insight holds: "best model for everything" is not a strategy, it's the absence of one.
What to watch
Watch whether Anthropic's pricing tiers shift to make this routing calculus more or less attractive, and whether agent frameworks like Claude Code add native routing or escalation features. The developer's 35% figure is from one month; a longer-term report would confirm whether the savings hold as task mix drifts toward harder work.
Source: dev.to
Originally published on gentic.news

Top comments (0)