[BUG] Selecting model with /model deletes content of settings.json
Status Closed — not planned
Maintainer reply ✓ Yes — dicksontsai
Activity 11 comments · opened Jul 7, 2025 · closed Jan 5, 2026
💡 Likely answer: A maintainer (dicksontsai, collaborator)
responded on this thread — see the highlighted reply below.
Environment
- Platform (select one):
- [ ] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [x] Other: Claude Max
- Claude CLI version: 1.0.43 (Claude Code)
- Operating System: macos 15.5
- Terminal: zish shell - iTerm, Ghostty, vscode terminal - same issue
Bug Description
When selecting the model with /model, everything in ~/.claude/settings.json gets replaced with model key value in case of opus or sonnet or just empty {} in default case.
So settings.json is left with just {} or
{
"model": "<sonnet or opus>"
}
Steps to Reproduce
- Start claude code CLI with default
claude(or any flag really) - Select model with /model
- Check ~/.claude/settings.json
Expected Behavior
Only model should change in settings when selecting model with /model
Actual Behavior
Any other settings that are not model selection gets removed and only model is left
Additional Context
Launching with --model <modelname> does not affect the settings.json file.
11 Comments
downgrade to npm install -g @anthropic-ai/claude-code@1.0.41
Do you happen to have the ~/.claude/settings.json file before your usage of /model? The main issue is likely that whatever was in ~/.claude/settings.json before was invalid JSON, so Claude Code thinks that it should just replace the entire file.
No mine got deleted when it auto upgraded to 1.0.43. This latest version is full of bugs, I'd stay away from it. I am NOT a fan of their frequent updates, their version releases are not well bug checked, so I stick with an old version I know that works.
Same. Previously it didn't happen.
@dicksontsai The JSON is valid as hooks and all worked fine. This started after the upate, with no changes done to settings.json at all, when running with no changes to the models the settings file is parsed correctly, hooks work as intended, etc.
Happens to me as well.
seems to be fixed as of 1.0.51
still occurring to me as of 1.0.53, both standalone binary and npm install. @dre-on if you wouldn't mind re-opening?
Note: The
/doctorcommand now warns you if your settings file is valid (and you can also see that warning in/status). Currently, if your settings file is invalid, using/modelwill overwrite your invalid settings. We are working on changing the behavior so that if the settings are invalid,/modelwill instead warn you to check your settings file first.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.