A smarter model budget for Claude Code
Your coding agent doesn't need Opus for every turn.
SmartAsk routes each Claude Code step to Sonnet or Opus, escalates when the work gets harder, and shows exactly what every turn costs.
Local proxyNative Anthropic APIAuditable JSONL metrics
Interactive product simulation · not benchmark output
One coding session.
Two models.
No wasted intelligence.
01 / UNEVEN WORK
Coding sessions are not uniformly hard.
A session is a sequence of different jobs. Every one should earn the model it uses.
02 / THE ROUTER
Judge. Work. Adapt.
Routing is not a one-time choice. SmartAsk judges every substantive message, then checks the evidence that comes back from Sonnet's tools.
03 / MEASURED EVIDENCE
Proof, not promises.
Controlled results, exact outcomes, and the sample size in plain sight.
lower cost on a live repository lookup
Both returned the same correct schema_version answer. SmartAsk routed 2/2 visible steps to Sonnet.
lower aggregate cost on a real SWE-bench repository task
Same exact patch across all four runs. Both strategies reached 115 passed, 1 skipped.
Read the methodologyFULL DISCLOSURE +
Real upstream repository
pytest-dev/pytest at commit 6995257cf470d2143ad1683824962de4071c0eb7, task pytest-dev__pytest-11143.
Counterbalanced result
Two isolated pairs per strategy. One reversed pair favored Opus-only due to provider-cache variance; the aggregate result favored SmartAsk.
Identical outcome
Patch SHA-256: 6574b635…ec89a8f. The official hidden regression patch produced 115 passed, 1 skipped.
04 / COMPACT HANDOFF
Change models without making the new model reread the whole room.
Caches do not transfer between models. SmartAsk does something explicit instead: the warm model creates a bounded factual handoff.
in a controlled trace
task + verified state + latest tool result
Controlled live trace comparison. Context and savings vary by switch.
❯ Fix the failing slugify tests.
⏺ Read(tests/test_slugify.py)
⏺ Update(src/slugify.py)
⏺ Fixed the delimiter branch. 3 tests passed.
05 / NATIVE WORKFLOW
Claude Code stays Claude Code.
No new chat UI. No copy-pasting between models. Start Claude Code through one launcher and work normally.
- Same interactive workflow, tools, and normal flags
- Private loopback proxy to the native Anthropic API
- Colored model and cost footer after every response
- Prompt-free JSONL metrics written locally
./scripts/claude-smart-ask06 / OBSERVABILITY
The router is not a black box.
Every decision and provider request becomes structured evidence. See why a turn escalated, what model answered, and what the switch cost.
07 / YOUR NUMBERS
Run the economics on your workload.
No magical total. Start from an observed Opus-only session and inspect every assumption.
Assumption: equivalent Sonnet work costs 20% of Opus work. Replace this with your observed ratio as pricing changes.
$9.80 estimated saving 39.2%
+ $2.90 Sonnet work
+ $1.50 classifier
+ $0.30 handoffs
08 / QUALITY BOUNDARIES
Conservative by design.
The cheap route is never the default when the evidence is unclear.
Uncertainty goes up.
Below 0.75 confidence routes to Opus.
Evidence can escalate.
Tool failures trigger a new judgment.
Opus keeps hard loops.
No oscillation during deep reasoning.
Unsafe summaries fail closed.
Incomplete handoffs use full context.
09 / OPEN ARCHITECTURE
Local, inspectable, and bounded.
Strategy files choose trusted target IDs. They cannot inject endpoints, credential names, or commands.
Inspect the routing policy ↗10 / FAQ
The sharp questions.
And the non-marketing answers.
Is routing decided only once per session?+
No. Every substantive user message is classified. Sonnet tool results are also reclassified so newly exposed complexity can escalate the current task.
What model decides?+
Claude Sonnet 4.6 is the default classifier. It returns sonnet, opus, or uncertain plus confidence.
What happens on classifier failure?+
The default strategy fails conservatively to Opus.
Can “fix” automatically mean easy?+
No. Substantive prompts are judged semantically. Keywords such as “fix” do not determine the route.
Do Sonnet and Opus share prompt cache?+
No. Provider caches are model-specific. SmartAsk reduces switch cost with a compact factual handoff.
Will it always save money?+
No router can guarantee that for every stochastic session. Savings depend on task mix and cache state. SmartAsk exposes the real cost so you can evaluate your own workload.
Does SmartAsk replace Claude Code?+
No. It runs as a local proxy underneath the existing Claude Code harness.
Does traffic go through a SmartAsk cloud?+
No. The default setup uses the native Anthropic API from the local adapter.
READY WHEN YOU ARE
Let every turn earn its model.
Clone. Add your Anthropic key locally. Keep working in Claude Code.
git clone git@github.com:arshiaafzal/smart-ask.git
cd smart-ask
cp scripts/claude-smart-ask.local.env.example scripts/claude-smart-ask.local.env
# Add ANTHROPIC_API_KEY, then:
./scripts/claude-smart-ask