Problem
Power users burn significant tokens using expensive models (Opus) for tasks that don't need them. There's no way to automatically route to the right model based on what Claude Code is doing. Today, users must manually run /model opus, /model sonnet, /model haiku throughout a session — which is easy to forget, leading to Opus-level costs on routine file reads and simple edits.
Proposed Solution
Allow users to configure model routing rules based on task type or mode in settings.json:
{
"modelRouting": {
"plan": "claude-opus-4-6",
"code": "claude-sonnet-4-6",
"default": "claude-haiku-4-5"
}
}
Routing triggers
| Mode |
Trigger |
Suggested model |
plan |
EnterPlanMode, architecture/design discussions |
Most capable (Opus) |
code |
Edit, Write, Bash tool use, implementation work |
Mid-tier (Sonnet) |
default |
Everything else — questions, exploration, chat |
Cheapest (Haiku) |
How it could work
- When Claude Code enters plan mode → auto-switch to the configured
plan model
- When the first
Edit/Write/Bash tool call happens → switch to code model
- When exiting plan mode or between tasks → fall back to
default model
- A status line indicator shows the current routing mode (e.g.,
[plan:opus], [code:sonnet])
- Users can still override with
/model at any time
Alternative: Hook-based approach
If native routing is too opinionated, expose model switching to the hooks system:
{
"hooks": {
"PrePlanMode": [{ "type": "model", "model": "claude-opus-4-6" }],
"PostPlanMode": [{ "type": "model", "model": "claude-haiku-4-5" }],
"PreToolUse": [{
"type": "model",
"matcher": "Edit|Write|Bash",
"model": "claude-sonnet-4-6"
}]
}
}
This would let users build their own routing logic without Claude Code being opinionated about which model fits which task.
Why this matters
Real usage data from a power user (44 days, single account):
| Month |
API-equivalent cost |
Primary model |
| Feb 2026 |
$1,217 |
Opus |
| Mar 2026 |
$2,965 |
Mixed |
| Apr 2026 (7 days) |
$1,307 |
Opus |
| Total |
$5,489 |
|
Conservatively, 60-70% of those tokens were spent on tasks where Sonnet or Haiku would have been sufficient (file reads, simple edits, exploration, chat). Auto-routing could cut costs by $2,000-3,000/month for heavy users without any loss in output quality.
For organizations paying API rates, this is the difference between Claude Code being viable or not for a team.
Related
Environment
- Claude Code CLI on macOS
- Individual Claude Code user
- Heavy agent teams usage (multiplies the cost problem)
Problem
Power users burn significant tokens using expensive models (Opus) for tasks that don't need them. There's no way to automatically route to the right model based on what Claude Code is doing. Today, users must manually run
/model opus,/model sonnet,/model haikuthroughout a session — which is easy to forget, leading to Opus-level costs on routine file reads and simple edits.Proposed Solution
Allow users to configure model routing rules based on task type or mode in
settings.json:{ "modelRouting": { "plan": "claude-opus-4-6", "code": "claude-sonnet-4-6", "default": "claude-haiku-4-5" } }Routing triggers
planEnterPlanMode, architecture/design discussionscodeEdit,Write,Bashtool use, implementation workdefaultHow it could work
planmodelEdit/Write/Bashtool call happens → switch tocodemodeldefaultmodel[plan:opus],[code:sonnet])/modelat any timeAlternative: Hook-based approach
If native routing is too opinionated, expose model switching to the hooks system:
{ "hooks": { "PrePlanMode": [{ "type": "model", "model": "claude-opus-4-6" }], "PostPlanMode": [{ "type": "model", "model": "claude-haiku-4-5" }], "PreToolUse": [{ "type": "model", "matcher": "Edit|Write|Bash", "model": "claude-sonnet-4-6" }] } }This would let users build their own routing logic without Claude Code being opinionated about which model fits which task.
Why this matters
Real usage data from a power user (44 days, single account):
Conservatively, 60-70% of those tokens were spent on tasks where Sonnet or Haiku would have been sufficient (file reads, simple edits, exploration, chat). Auto-routing could cut costs by $2,000-3,000/month for heavy users without any loss in output quality.
For organizations paying API rates, this is the difference between Claude Code being viable or not for a team.
Related
/modelcommand infrastructureEnvironment