[BUG] Why does --model sonnet sometimes invoke Opus during task execution?
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other:
- Claude CLI version: 1.0.53
- Operating System: macOS 15.4.1
- Terminal: iTerm2
Bug Description
When running Claude CLI with --model sonnet, some tasks unexpectedly seem to invoke Opus during execution, even though the model is explicitly set to Sonnet. This causes usage to consume both Sonnet and Opus credits.
This behavior is confusing, as the expectation is that specifying a model should constrain the execution entirely to that model.
Steps to Reproduce
- Run a complex or multi-step command using:
``bash``
claude -p "Write a full-stack project with detailed implementation plans and multi-file TypeScript code" --model sonnet
- Let the conversation or generation proceed.
- Monitor usage during the session and notice that some tasks are handled by Opus, despite having selected Sonnet
Expected Behavior
All tasks and completions should be handled exclusively by Sonnet, as specified by --model sonnet. No Opus usage should occur unless explicitly requested.
Actual Behavior
Some parts of the task seem to be completed using Opus, resulting in:
- Mixed model usage (Sonnet + Opus)
- Unexpected credit consumption from the Opus pool
Additional Context
This issue occurs even when Sonnet is explicitly selected via the CLI.
If this behavior is expected, it would be helpful to clarify it in the documentation and ideally provide an option to enforce strict model usage — for example, something like --strict-model sonnet.
Thanks for your time and for building this great tool!
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗