[BUG] Default Model Not Updating Correctly After Switching
Problem Description
When using claude, after switching the model using the /model command, the default model does not update correctly upon re-entering claude. The specific steps and issue are as follows:
- Initial State: Enter
claude, and the default model isopus. - Switch Model: Use the
/model sonnetcommand to switch the model tosonnet. - Re-enter: Exit and re-enter
claude, and the default model is stillopus, not the previously switchedsonnet. - Manual Fix: It is necessary to manually edit the
setting.jsonfile in the.claudedirectory to set the default model tosonnet.
Expected Behavior
- After switching the model using the
/modelcommand, the default model should automatically be the one previously switched to, without needing to manually edit the configuration file.
Current Behavior
- Every time
claudeis entered, the default model is alwaysopus, even after switching the model using the/modelcommand.
Environment Information
- Operating System: Ubuntu 20.04
claudeVersion: lasted
Reproduction Steps
-
Enter
claude.$ claude -
Check the current default model:
$ /modelOutput:
Current model: opus -
Switch the model to
sonnet:$ /model sonnetOutput:
Model switched to sonnet -
Exit
claude.$ exit -
Re-enter
claude.$ claude -
Check the current default model again:
$ /modelOutput:
Current model: opus
Temporary Solution
- Manually edit the
setting.jsonfile in the.claudedirectory to set the default model tosonnet.
Impact of the Issue
- Poor user experience, as users need to manually edit the configuration file each time they enter
claude. - There may be an issue with the configuration file not updating correctly or a problem with the command logic.
Priority
- Medium
Changing it in settings.json does not solve the issue. It is very annoying that it forces Opus which is just burning quota without providing any value. We need a way to set sonnet permanently.
AI Assistant:
I strongly support this issue and have created a related feature request #4807 that extends this concept further.
With the upcoming weekly rate limits (24-40 hours for Opus 4 starting August 28), the need for proper model persistence and granular control has become critical. The fact that model changes affect all sessions globally is particularly problematic when:
- Running multiple sub-agents in parallel (4 agents = 4x faster quota consumption)
- Different parts of a project require different models (e.g., Rust code needs Opus, documentation can use Sonnet)
- We need to optimize model usage per task type to conserve precious Opus hours
Our issue proposes extending model selection beyond just persistence to include:
- Per-sub-agent model configuration
- Rule-based model selection (by file type, task type)
- Dynamic model switching based on task complexity
This would work alongside fixing the persistence issue you've identified here. Without these features, the new rate limits will make Claude Code unusable for many professional workflows.
Please see #4807 for a comprehensive proposal on granular model selection to address these urgent challenges.
Found 2 possible duplicate issues:
- https://github.com/anthropics/claude-code/issues/1523
- https://github.com/anthropics/claude-code/issues/5558
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
This issue has been automatically closed as a duplicate of #1523.
If this is incorrect, please re-open this issue or create a new one.
🤖 Generated with Claude Code
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.