Using /model command overwrites and removes manually-added fields in settings.json
Description
When a user manually adds a field to ~/.claude/settings.json (such as "model": "opus"), using the /model or /config command causes Claude Code to rewrite the file and delete the manually-added configuration.
Steps to Reproduce
- Manually edit
~/.claude/settings.jsonand add a custom field (e.g.,"model": "opus") - Start Claude Code
- Use the
/modelcommand to change models - Check
settings.json- the manually-added field is gone
Expected Behavior
Claude Code should preserve any existing fields in settings.json that it doesn't manage. When writing changes, it should merge its updates with existing config rather than overwriting the entire file.
Actual Behavior
The entire settings.json file is rewritten, dropping any fields that Claude Code doesn't explicitly track.
Impact
Users lose custom configuration they've added to settings.json, which is frustrating and requires them to re-add their settings after any config change through the CLI.
🤖 Generated with Claude Code
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗