You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Selecting model with /model deletes content of settings.json #3123
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.
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.
No mine got deleted when it auto upgraded to 1.0.43.
Same. Previously it didn't happen.
Do you happen to have the ~/.claude/settings.json file before your usage of /model?
@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.
Note: The /doctor command 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 /model will overwrite your invalid settings. We are working on changing the behavior so that if the settings are invalid, /model will 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.
Activity
dgtise25 commentedon Jul 7, 2025
downgrade to npm install -g @anthropic-ai/claude-code@1.0.41
dicksontsai commentedon Jul 7, 2025
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.
dgtise25 commentedon Jul 7, 2025
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.
dre-on commentedon Jul 7, 2025
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.
jacquesjg commentedon Jul 9, 2025
Happens to me as well.
dre-on commentedon Jul 15, 2025
seems to be fixed as of 1.0.51
samburger commentedon Jul 16, 2025
still occurring to me as of 1.0.53, both standalone binary and npm install. @dre-on if you wouldn't mind re-opening?
dicksontsai commentedon Jul 17, 2025
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.github-actions commentedon Dec 3, 2025
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 commentedon Jan 5, 2026
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 commentedon Jan 13, 2026
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.