[BUG] Claude Code seems to use Sonnet even when configured explicitly to use Opus

Status Closed — not planned
Maintainer reply ✓ Yes — dicksontsai
Activity 11 comments · opened Aug 26, 2025 · closed Jan 5, 2026
💡 Likely answer: A maintainer (dicksontsai, collaborator) responded on this thread — see the highlighted reply below.

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

  1. Use /model to configure Claude Code to use only Opus
  2. Work in Claude Code for a while until Opus limit runs out
  3. Monitor ccusage and 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.

View original on GitHub ↗

11 Comments

github-actions[bot] · 1 year ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/3434
  2. https://github.com/anthropics/claude-code/issues/1722
  3. https://github.com/anthropics/claude-code/issues/6546

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

copumpkin · 1 year ago

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.

dicksontsai collaborator · 1 year ago

Subagents use Sonnet, even if you set /model opus. /model controls the model for the main agent loop.

I actually asked Claude Code what model it was and it told me Sonnet 3.5

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.

copumpkin · 1 year ago

I'm not using any subagents in any of my projects. Does the Task tool 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 /model configuration and no configured subagents:

{
  "parentUuid": "67a73fed-e3ed-4d39-89cd-af6b77cd4a7b",
  "isSidechain": true,
  "userType": "external",
  "cwd": "/some/path",
  "sessionId": "59b0764b-5191-4b92-acac-728980e8a05d",
  "version": "1.0.92",
  "gitBranch": "main",
  "message": {
    "id": "msg_01SSjkZJW4376mqzh2GTwr5r",
    "type": "message",
    "role": "assistant",
    "model": "claude-sonnet-4-20250514",
    "content": [
      {
        "type": "tool_use",
        "id": "toolu_01NChtZ24ZAWFwVNr7EMizvp",
        "name": "Read",
        "input": {
          "file_path": "/some/path/file"
        }
      }
    ],
    "stop_reason": null,
    "stop_sequence": null,
    "usage": {
      "input_tokens": 5,
      "cache_creation_input_tokens": 15809,
      "cache_read_input_tokens": 33226,
      "cache_creation": {
        "ephemeral_5m_input_tokens": 15809,
        "ephemeral_1h_input_tokens": 0
      },
      "output_tokens": 95,
      "service_tier": "standard"
    }
  },
  "requestId": "req_011CSVtH2hCXryaJdmRutN5m",
  "type": "assistant",
  "uuid": "c033a3f4-97eb-433c-98c5-ec5fd8368551",
  "timestamp": "2025-08-26T06:56:35.284Z"
}

The only thing I can think of is that Task might do something similar, but if so, can we get an option to stop that? I don't control when CC decides to use Task and it shouldn't silently switch to a different model.

dicksontsai collaborator · 1 year ago

Yes, Task === subagents (with the default subagent prompt).

I don't recommend it, but you can use /permissions to add Task to the tools under Deny. Subagents are a proven usage pattern to preserve main loop context space while providing similar performance.

copumpkin · 1 year ago

Is there an indication of Task happening in the event I posted above? How would I identify that Task triggered it? I'd much rather force Task to run on Opus than disable it entirely.

dicksontsai collaborator · 1 year ago

You can use the CLAUDE_CODE_SUBAGENT_MODEL env var to force the model to a certain value:

  • opus, sonnet, etc.
  • inherit lets you use the same model as the main loop.
guidedways · 1 year ago

It's not subagents. It was probably this: https://status.anthropic.com/incidents/h26lykctfnsz

github-actions[bot] · 8 months ago

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.

github-actions[bot] · 7 months ago

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.

github-actions[bot] · 7 months ago

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.