Bug: /model command overwrites settings.json, wiping statusLine and hooks config
Description
The /model command (and possibly /effort) performs a full overwrite of ~/.claude/settings.json instead of a merge, which silently destroys user-configured statusLine and hooks settings.
Steps to Reproduce
- Configure
statusLineandhooksin~/.claude/settings.json:
``json``
{
"env": {},
"statusLine": {
"type": "command",
"command": "bash ~/.claude/statusline-command.sh"
},
"hooks": {
"SessionStart": [{ "hooks": [{ "type": "command", "command": "...", "async": true }] }]
}
}
- Run
/modelto switch models - Check
~/.claude/settings.json— it now contains only{"env": {}}, all other config is gone
Evidence
settings.jsonbirth date:2026-04-08 13:18:26— exactly when/modelwas executed 3 times in quick successionsettings.jsonlast modified:2026-04-11 18:26:33— overwritten again (no matching user activity, possibly auto-update or background process)- The
statusline-command.shscript andhooks/peon-ping/directory remained intact on disk — only the JSON config pointing to them was lost - User history log confirms
/clear→/model× 3 →/effort→/clearat the exact moment the file was recreated
Expected Behavior
Commands like /model and /effort should read-modify-write (merge) settings.json, only updating the fields they own, preserving all other user configuration.
Actual Behavior
The file is fully overwritten with a minimal object (e.g., {"env": {}}), destroying statusLine, hooks, and potentially other user-configured fields.
Environment
- Claude Code version: 2.1.104
- Platform: Windows 11 (10.0.26200)
- Installation: standalone (
~/.local/bin/claude.exe)
Impact
Users who invest time configuring statusLine scripts and hooks lose their setup silently with no warning and no backup. The data loss is not immediately obvious — users only notice when sounds stop playing or the status bar disappears.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗