C:/Program Files/Git/config model command writes ANSI escape codes into settings.json
Open 💬 1 comment Opened Jun 11, 2026 by wjpmptrnzy-netizen
Bug Description
The /config command (or /model) writes ANSI terminal formatting escape sequences into settings.json instead of the clean model identifier.
Steps to Reproduce
- Open Claude Code on Windows (Git Bash shell)
- Run
/configand select a model (e.g., Opus) - Check
~/.claude/settings.json
Expected Behavior
{
"model": "claude-opus-4-6"
}
Actual Behavior
The terminal output already shows the escaped formatting:
Set model to [1mopus[1m] (claude-opus-4-6[1m])[22m
And settings.json contains the ANSI bold marker in the value:
{
"model": "opus[1m]"
}
[1m is the ANSI escape code for bold text. It appears the display formatting is leaking into the persisted value.
Impact
Claude Code silently uses the default model instead of the configured one, since opus[1m] is not a valid model identifier. The user has no indication that the setting is broken until they manually inspect settings.json.
Environment
- OS: Windows 11 Pro (10.0.26200)
- Shell: Git Bash (mintty/MSYS2)
- Claude Code: Latest (installed via npm)
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗