[BUG] Claude Code seems to use Sonnet even when configured explicitly to use Opus
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: v1.0.92
- Operating System: macOS 15.3.2
- Terminal: Terminal App
Bug Description
I'm on the 20x subscription and have my model set explicitly to Opus 4.1, not the automatic selection default or the "plan in Opus, work in Sonnet" option. After working in it for a while, I check ccusage and notice that Sonnet has appeared in my usage summary even though I've never configured Claude Code to use Sonnet. In the past I used to see warnings about reaching an Opus limit but I haven't seen those in a while, and I assume some update made it helpfully fall back to Sonnet when my Opus limit runs out. I'd much rather that be an explicit decision from me rather than an implicit one that happens without warning.
Steps to Reproduce
- Use
/modelto configure Claude Code to use only Opus - Work in Claude Code for a while until Opus limit runs out
- Monitor
ccusageand notice Sonnet appear in usage even though the configuration doesn't mention it
Expected Behavior
Some sort of hard failure, or an explicit prompt saying "please configure /model to Sonnet or the automatic switcharoo mode if you would like to proceed"
Actual Behavior
CC transparently downgrades to Sonnet usage despite explicit configuration
Additional Context
After seeing ccusage I actually asked Claude Code what model it was and it told me Sonnet 3.5. I then asked why it was Sonnet 3.5 when /model was configured to be Opus. It then told me it was Opus and had made a mistake. I told it that ccusage made me doubt its response and it "admitted" that it was Sonnet 3.5 after all and that it wasn't sure why the model configuration wasn't working.
11 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
It is a duplicate, but the previous issue (https://github.com/anthropics/claude-code/issues/3434) was closed as completed, so this is either a regression or the other issue was closed prematurely.
Subagents use Sonnet, even if you set
/model opus./modelcontrols the model for the main agent loop.This is unreliable. The more reliable approach is to look at your transcript files in ~/.claude/projects (which ccusage also looks at)
If you do find concrete evidence of Sonnet appearing in main loop queries despite
/model opus, let us know.I'm not using any subagents in any of my projects. Does the
Tasktool also have the same Sonnet behavior? I assumed it was a regression because I simply continue to do the same work I've always done (no subagents) and after a while, presumably when I hit some limit, I start to see Sonnet in my usage.I tried looking through the transcript files in the main project I'm working on right now and here's a sample event (there are _lots_ of these, way more than I was expecting) from it that uses sonnet, despite my Opus-only
/modelconfiguration and no configured subagents:The only thing I can think of is that
Taskmight do something similar, but if so, can we get an option to stop that? I don't control when CC decides to useTaskand it shouldn't silently switch to a different model.Yes,
Task=== subagents (with the default subagent prompt).I don't recommend it, but you can use
/permissionsto addTaskto the tools underDeny. Subagents are a proven usage pattern to preserve main loop context space while providing similar performance.Is there an indication of
Taskhappening in the event I posted above? How would I identify thatTasktriggered it? I'd much rather forceTaskto run on Opus than disable it entirely.You can use the
CLAUDE_CODE_SUBAGENT_MODELenv var to force the model to a certain value:opus,sonnet, etc.inheritlets you use the same model as the main loop.It's not subagents. It was probably this: https://status.anthropic.com/incidents/h26lykctfnsz
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.