/model saves ANSI formatting fragment into settings.json model value (e.g. "claude-fable-5[1m]")
Version: 2.1.212 (macOS, Darwin 25.5.0, zsh)
What happens: After selecting a model via the /model command, ~/.claude/settings.json is saved with a terminal-formatting fragment appended to the model value:
"model": "claude-fable-5[1m]"
The /model command's own output shows where it comes from — the confirmation string carries ANSI bold markers:
Set model to [1mFable 5[22m and saved as your default for new sessions
([1m/[22m are SGR bold-on/bold-off with the ESC byte stripped.) A fragment of that styled display string ends up persisted in the JSON value.
Reproduction (intermittent but has occurred twice on this machine within two days):
- Run
/model, select a model (observed with Fable 5), let it save as default. - Inspect
~/.claude/settings.json→.modelcontains the[1m]fragment.
Impact: cosmetic-plus — model resolution appears to tolerate the suffix, but the corrupted value churns settings.json for anyone tracking it in git, and any tooling that string-matches the model id exactly breaks.
Expected: the persisted model value is the bare model id, never styled display text.
🤖 Generated with Claude Code
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗