/model saves ANSI formatting fragment into settings.json model value (e.g. "claude-fable-5[1m]")

Status Fixed / completed
Reported on v2.1.212
Maintainer reply None cached
Activity 1 comment · opened Jul 17, 2026 · closed Aug 21, 2026

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):

  1. Run /model, select a model (observed with Fable 5), let it save as default.
  2. Inspect ~/.claude/settings.json.model contains 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

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗