claude-code - 💡(How to fix) Fix [BUG] | v2.1.156: settings.json "model" field silently ignored for interactive sessions

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

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

  1. Add "model": "claude-opus-4-8" to ~/.claude/settings.json at the top level.
  2. Fully quit Claude Code (Cmd+Q) and relaunch with bare claude (no flags).
  3. 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 "..." → reports claude-opus-4-8
  • export ANTHROPIC_MODEL=claude-opus-4-8 in shell rc → next session reports claude-opus-4-8

What I ruled out

  • ANTHROPIC_MODEL env var unset before the workaround.
  • No --model flag in the launch command.
  • No model override in project-level .claude/settings.local.json.
  • No model key in ~/.claude.json (only historical usage stats).
  • Tried "model": "opus" (family alias) first, same result. Switching to the explicit dateless ID claude-opus-4-8 per the docs (model IDs are pinned snapshots from the 4.6 generation onward) didn't change the behaviour.

Error Message

Error Messages/Logs

Root Cause

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

  1. Add "model": "claude-opus-4-8" to ~/.claude/settings.json at the top level.
  2. Fully quit Claude Code (Cmd+Q) and relaunch with bare claude (no flags).
  3. 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 "..." → reports claude-opus-4-8
  • export ANTHROPIC_MODEL=claude-opus-4-8 in shell rc → next session reports claude-opus-4-8

What I ruled out

  • ANTHROPIC_MODEL env var unset before the workaround.
  • No --model flag in the launch command.
  • No model override in project-level .claude/settings.local.json.
  • No model key in ~/.claude.json (only historical usage stats).
  • Tried "model": "opus" (family alias) first, same result. Switching to the explicit dateless ID claude-opus-4-8 per the docs (model IDs are pinned snapshots from the 4.6 generation onward) didn't change the behaviour.

Fix Action

Fix / Workaround

Confirmed workarounds (both work)

  • claude --model claude-opus-4-8 --print "..." → reports claude-opus-4-8
  • export ANTHROPIC_MODEL=claude-opus-4-8 in shell rc → next session reports claude-opus-4-8

What I ruled out

  • ANTHROPIC_MODEL env var unset before the workaround.
  • No --model flag in the launch command.
  • No model override in project-level .claude/settings.local.json.
  • No model key in ~/.claude.json (only historical usage stats).
  • Tried "model": "opus" (family alias) first, same result. Switching to the explicit dateless ID claude-opus-4-8 per the docs (model IDs are pinned snapshots from the 4.6 generation onward) didn't change the behaviour.

Workaround that confirms the env-var path works too:

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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

  1. Add "model": "claude-opus-4-8" to ~/.claude/settings.json at the top level.
  2. Fully quit Claude Code (Cmd+Q) and relaunch with bare claude (no flags).
  3. 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 "..." → reports claude-opus-4-8
  • export ANTHROPIC_MODEL=claude-opus-4-8 in shell rc → next session reports claude-opus-4-8

What I ruled out

  • ANTHROPIC_MODEL env var unset before the workaround.
  • No --model flag in the launch command.
  • No model override in project-level .claude/settings.local.json.
  • No model key in ~/.claude.json (only historical usage stats).
  • Tried "model": "opus" (family alias) first, same result. Switching to the explicit dateless ID claude-opus-4-8 per 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):

  1. --model CLI flag
  2. ANTHROPIC_MODEL env var
  3. model field in settings.json
  4. CLI built-in default

A fresh claude launch (no flags, no env override) with "model": "claude-opus-4-8" set in ~/.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

  1. On Claude Code v2.1.156 (native install), edit ~/.claude/settings.json and add the top-level field: "model": "claude-opus-4-8".
  2. Confirm ANTHROPIC_MODEL is unset: echo "${ANTHROPIC_MODEL:-(unset)}".
  3. Fully quit Claude Code (Cmd+Q on macOS) and relaunch with bare claude (no flags).
  4. 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:

  1. From the same shell, run: claude --model claude-opus-4-8 --print "respond with only the literal model id you are running"
  2. Output: claude-opus-4-8.

Workaround that confirms the env-var path works too:

  1. Add export ANTHROPIC_MODEL=claude-opus-4-8 to ~/.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 effortLevel field in the same settings.json is being honoured (or at least re-exported). My CLAUDE_EFFORT env var is automatically set to xhigh, matching "effortLevel": "xhigh" in settings.json. So settings.json is being parsed at session start; only the model field 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:

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".

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] | v2.1.156: settings.json "model" field silently ignored for interactive sessions