Using /model command overwrites and removes manually-added fields in settings.json

Resolved 💬 3 comments Opened Feb 3, 2026 by guzman109 Closed Feb 6, 2026

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

  1. Manually edit ~/.claude/settings.json and add a custom field (e.g., "model": "opus")
  2. Start Claude Code
  3. Use the /model command to change models
  4. 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

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗