[BUG] claude code doesn't use claude-3-7-sonnet-20250219 model by default. It is using 3.5 and the quality of code output is dramatically bad

Status Fixed / completed
Maintainer reply ✓ Yes — dicksontsai
Activity 11 comments · opened May 21, 2025 · closed May 21, 2025
💡 Likely answer: A maintainer (dicksontsai, collaborator) responded on this thread — see the highlighted reply below.

It doesn't use the default model as expected claude-3-7-sonnet-20250219. It is using 3.5 and the quality of code output is dramatically bad. you can check this by calling /cost

View original on GitHub ↗

11 Comments

kcindric · 1 year ago

Can you show us the output? Can't test /cost on max plan.

bickster · 1 year ago

I'm seeing the same thing. I asked claude code how to change the model and it said to use the --model option. Looks like that worked.

claude --model claude-3-7-sonnet-20250219 "your prompt here" @gautammd

<img width="1372" alt="Image" src="https://github.com/user-attachments/assets/d18b0b0c-27a9-468d-abcc-8b4c80a03c3c" />

gautammd · 1 year ago

@kcindric yeah, I can't now either, I could see this when I was on pay as you go mode and then I switched to max thinking that it will do me better of using latest model but, it isn't looking at the quality of code.

@bickster how did you use the -model option, I get these errors -

(base) gautam@Gautams-MacBook-Pro browsermagic % claude -model claude-3-7-sonnet-20250219
error: unknown option '-model'
(base) gautam@Gautams-MacBook-Pro browsermagic % claude -0model claude-3-7-sonnet-20250219
error: unknown option '-0model'
(base) gautam@Gautams-MacBook-Pro browsermagic % claude --model claude-3-7-sonnet-20250219
error: unknown option '--model'
gautammd · 1 year ago

I switched to pay as you for a second. here's the output from /cost

> /cost 
  ⎿  Total cost:            $0.0002
     Total duration (API):  1.8s
     Total duration (wall): 33.2s
     Total code changes:    0 lines added, 0 lines removed
     Token usage by model:
         claude-3-5-haiku:  177 input, 14 output, 0 cache read, 0 cache write
backnotprop · 1 year ago

we really need more insight here

#1098 https://github.com/anthropics/claude-code/issues/1098#issuecomment-2884244872

(non-anthropic?) > Thanks for digging in, but Claude Code uses Haiku for some operations like generating conversation summaries or the words that you see in the spinner. The reporting breakdown by model is new but the behavior isn't. Unless you are having problems, I don't think this is a bug.

#1177 related as well

backnotprop · 1 year ago

My last long session:

 /cost
  ⎿ Total cost:            $29.82
    Total duration (API):  1h 29m 9.7s
    Total duration (wall): 20h 20m 48.6s
    Total code changes:    2382 lines added, 552 lines removed
    Token usage by model:
        claude-3-5-haiku:  471.0k input, 20.4k output, 0 cache read, 0
    cache write
       claude-3-7-sonnet:  1.6k input, 149.1k output, 38.0m cache read,
    4.2m cache write
gautammd · 1 year ago

@backnotprop I see, thanks for clarity there. how can we enforce it to use claude-3-7-sonnet for both input tokens and output. like I see another comment here - https://github.com/anthropics/claude-code/issues/1177#issuecomment-2892421511 , this true for me as well.

max-sixty · 1 year ago

is there any evidence that this has _changed_?

my understanding is that — broadly — Haiku has always been used to read & summarize files, Sonnet has always been used to think & write code

bickster · 1 year ago

I don't think what I suggested above is truly working. Looks to be an hallucination. Chatting with some people in discord about it. If you're running Bedrock & Vertex you might be able to control the input and output model - https://docs.anthropic.com/en/docs/claude-code/bedrock-vertex

dicksontsai collaborator · 1 year ago

Hi all, I can help clarify a couple things:

As of the latest version of Claude Code (0.2.125):

  • claude-3-7-sonnet-20250219 is the default version.
  • There is no --model flag. You can use claude --help to see the available flags.

When you see claude-3-5-haiku in /cost, the Haiku usage comes from "Background Token Usage" described in https://docs.anthropic.com/en/docs/claude-code/costs#background-token-usage

If you _really_ need to change the model (though there should be no reason to and there are limitations), you can use the ANTHROPIC_MODEL environment variable described in https://docs.anthropic.com/en/docs/claude-code/bedrock-vertex#model-configuration. For example, you'll find that if you actually use Claude 3.5 Sonnet v2, ANTHROPIC_MODEL=claude-3-5-sonnet-20241022 claude, you'll get a very different response.

github-actions[bot] · 1 year 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.