[BUG] | v2.1.156: settings.json "model" field silently ignored for interactive sessions
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Summary
field in ~/.claude/settings.json is silently ignored for interactive sessions. The CLI accepts the same model ID via the --model flag and via the ANTHROPIC_MODEL env var, so the model is available and the ID is correct - only the settings.json path fails.
## Repro
- Add
"model": "claude-opus-4-8"to~/.claude/settings.jsonat the top level. - Fully quit Claude Code (Cmd+Q) and relaunch with bare
claude(no flags). - Ask "what model are you running" in the new session.
## Expected
Banner / session reports claude-opus-4-8.
## Actual
Banner / session reports Opus 4.7 (claude-opus-4-7).
## Confirmed workarounds (both work)
claude --model claude-opus-4-8 --print "..."→ reportsclaude-opus-4-8export ANTHROPIC_MODEL=claude-opus-4-8in shell rc → next session reportsclaude-opus-4-8
## What I ruled out
ANTHROPIC_MODELenv var unset before the workaround.- No
--modelflag in the launch command. - No
modeloverride in project-level.claude/settings.local.json. - No
modelkey in~/.claude.json(only historical usage stats). - Tried
"model": "opus"(family alias) first, same result. Switching to the explicit dateless IDclaude-opus-4-8per the docs (model IDs are pinned snapshots from the 4.6 generation onward) didn't change the behaviour.
What Should Happen?
The model field in ~/.claude/settings.json should be honoured at session
start for interactive sessions, matching the documented behaviour:
> model — Override the default model to use for Claude Code. --model and
ANTHROPIC_MODEL override this for one session.
> (https://code.claude.com/docs/en/settings)
Expected precedence (highest → lowest):
--modelCLI flagANTHROPIC_MODELenv varmodelfield in settings.json- CLI built-in default
A fresh claude launch (no flags, no env override) with "model": set in
"claude-opus-4-8"~/.claude/settings.json should report
claude-opus-4-8. Today it reports claude-opus-4-7, indicating step 3 is
being skipped entirely.
Error Messages/Logs
Steps to Reproduce
- On Claude Code v2.1.156 (native install), edit
~/.claude/settings.json
and add the top-level field: "model": "claude-opus-4-8".
- Confirm
ANTHROPIC_MODELis unset:echo "${ANTHROPIC_MODEL:-(unset)}". - Fully quit Claude Code (Cmd+Q on macOS) and relaunch with bare
claude(no
flags).
- Ask the assistant: "what model are you running".
Expected: assistant reports claude-opus-4-8 and the launch banner shows
"Opus 4.8".
Actual: assistant reports claude-opus-4-7 and the launch banner shows "Opus
4.7".
Sanity-check showing the model ID is valid and reachable:
- From the same shell, run: `claude --model claude-opus-4-8 --print "respond
with only the literal model id you are running"`
- Output:
claude-opus-4-8.
Workaround that confirms the env-var path works too:
- Add
export ANTHROPIC_MODEL=claude-opus-4-8to~/.zshrc, open a new
terminal, launch claude, ask the same question. Reports claude-opus-4-8 as
expected.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
N/A
Claude Code Version
2.1.156 (native install)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
Terminal: Hyper 3.4.1 (selected "Other" since not in the dropdown).
Partial-read clue (might narrow the bug):
- The
effortLevelfield in the same settings.json is being honoured (or at least re-exported). MyCLAUDE_EFFORTenv var is automatically set toxhigh, matching"effortLevel": "xhigh"in settings.json. So settings.json is being parsed at session start; only themodelfield path appears to be skipped. - The launch banner reflects the wrong model too: it says "Opus 4.7 with high effort" rather than "Opus 4.8 with high effort". So the model isn't being chosen above the banner-render layer either.
Tried unsuccessfully:
"model": "opus"(family alias) — session stayed on 4.7."model": "claude-opus-4-8"(explicit dateless ID per
https://platform.claude.com/docs/en/about-claude/models/overview, which says model IDs in the 4.6 generation onward are pinned snapshots, not evergreen pointers) — same result.
Workaround in place: export ANTHROPIC_MODEL=claude-opus-4-8 in ~/.zshrc.
Next session reports claude-opus-4-8 and banner says "Opus 4.8".
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗