Bug: /model command overwrites settings.json, wiping statusLine and hooks config

Resolved 💬 3 comments Opened Apr 12, 2026 by joinvar Closed Apr 15, 2026

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

  1. Configure statusLine and hooks in ~/.claude/settings.json:

``json
{
"env": {},
"statusLine": {
"type": "command",
"command": "bash ~/.claude/statusline-command.sh"
},
"hooks": {
"SessionStart": [{ "hooks": [{ "type": "command", "command": "...", "async": true }] }]
}
}
``

  1. Run /model to switch models
  2. Check ~/.claude/settings.json — it now contains only {"env": {}}, all other config is gone

Evidence

  • settings.json birth date: 2026-04-08 13:18:26 — exactly when /model was executed 3 times in quick succession
  • settings.json last modified: 2026-04-11 18:26:33 — overwritten again (no matching user activity, possibly auto-update or background process)
  • The statusline-command.sh script and hooks/peon-ping/ directory remained intact on disk — only the JSON config pointing to them was lost
  • User history log confirms /clear/model × 3 → /effort/clear at 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.

View original on GitHub ↗

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