Skip to content

[BUG] Selecting model with /model deletes content of settings.json #3123

Closed as not planned

Description

@dre-on

Environment

  • Platform (select one):
    • Anthropic API
    • AWS Bedrock
    • Google Vertex AI
    • 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

  1. Start claude code CLI with default claude (or any flag really)
  2. Select model with /model
  3. 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.

Activity

  1. self-assigned this
    on Jul 7, 2025
  2. dgtise25 commented on Jul 7, 2025

    @dgtise25

    downgrade to npm install -g @anthropic-ai/claude-code@1.0.41

  3. dicksontsai commented on Jul 7, 2025

    @dicksontsai
    Collaborator

    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.

  4. dgtise25 commented on Jul 7, 2025

    @dgtise25

    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.

  5. dre-on commented on Jul 7, 2025

    @dre-on
    Author

    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.

  6. jacquesjg commented on Jul 9, 2025

    @jacquesjg

    Happens to me as well.

  7. dre-on commented on Jul 15, 2025

    @dre-on
    Author

    seems to be fixed as of 1.0.51

  8. samburger commented on Jul 16, 2025

    @samburger

    still occurring to me as of 1.0.53, both standalone binary and npm install. @dre-on if you wouldn't mind re-opening?

  9. reopened this on Jul 17, 2025
  10. dicksontsai commented on Jul 17, 2025

    @dicksontsai
    Collaborator

    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.

  11. github-actions commented on Dec 3, 2025

    @github-actions

    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.

  12. github-actions commented on Jan 5, 2026

    @github-actions

    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.

  13. github-actions commented on Jan 13, 2026

    @github-actions

    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.

  14. locked as resolved and limited conversation to collaborators on Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:corearea:modelautocloseIssue will be closed automaticallybugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOS

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions