Magic Tools
Hands-OnBy CooconAugust 6, 2026158 views3 min read

Which Model Is Claude Code Actually Using? settings.json vs ANTHROPIC_MODEL vs --model, Tested

Why this deserves scrutiny

A wrong model configuration does not error — the session runs fine, just on a different model. In GitHub issue #82466, a user configured Fable in ~/.claude/settings.json, ran multi-agent workloads for a full day silently on Sonnet, and had to discard everything.

The official docs describe the model field in settings.json, the ANTHROPIC_MODEL environment variable, the --model flag, and the /model command separately — but never one table saying who wins when they coexist. Here are the measured results.

Method: hard evidence from modelUsage

In headless mode with --output-format json, the modelUsage key in the result is the model ID you were actually billed for — more reliable than any UI display or the model's self-description (what a model says about itself can be shaped by system prompts and does not count as evidence):

claude -p "reply ok" --output-format json | python3 -c \
  "import json,sys; print(list(json.load(sys.stdin)['modelUsage'].keys()))"

The tested priority matrix

Environment: macOS + Claude Code v2.1.220. Each row is an independent experiment in a clean directory, evidence taken from modelUsage:

Configuration Actually used Conclusion
Project .claude/settings.json set to haiku, nothing else haiku ✅ project-level settings honored
settings set to claude-fable-5[1m] (1M-context suffix) claude-fable-5[1m] ✅ the [1m] suffix form works too
settings haiku + env ANTHROPIC_MODEL=sonnet sonnet env var overrides settings
settings haiku + flag --model sonnet sonnet flag overrides settings
env haiku + flag --model sonnet sonnet flag overrides env var

The resulting priority chain (high → low):

--model flag  >  ANTHROPIC_MODEL env  >  project settings.json  >  built-in default

It matches the Unix intuition that configuration closer to the invocation wins — but until now that was intuition. Now it is evidence.

About that Windows issue

Issue #82466 reports a different layer: the user-level ~/.claude/settings.json (note: not project-level) being ignored on Windows 11 + PowerShell, and /model <exact-id> in interactive sessions replying "Kept model as X" and refusing to switch. The reporter ruled out env vars, project overrides, and every known on-disk location, and suspects some client-side UI state that never hits disk.

We could not reproduce it on macOS (every layer worked, as the table shows), and the issue has no official response at the time of writing. If your model looks wrong on Windows: do not assume you misconfigured it — collect evidence with the modelUsage method above, then add your environment details to that issue. Every cross-environment report moves the fix closer.

Practical recommendations

  • CI / scripts: pass --model explicitly — highest priority, smallest scope, immune to any persisted state
  • Project-wide default: use the project's .claude/settings.json (checked into the repo, shared with the team) — verified reliable
  • Verification: whenever a model "feels wrong", run one --output-format json call and read modelUsage; in interactive sessions, run /model with no argument and trust the highlighted item in the picker — the issue reporter found the "Kept model as X" text misleading, while the picker highlight reflects the real current state
  • Cost-sensitive setups: modelUsage also carries token counts and cost, handy for auditing bills

Scope and boundaries

  • Test environment is in the scope card above; the matrix covers headless (-p) with project-level settings / env / flag. The user-level ~/.claude/settings.json and interactive /model switching are outside this article's tested scope (the former is unsafe to mutate on a production machine, the latter is discussed in the issue)
  • Bedrock / Vertex channels have their own model ID schemes and env vars; conclusions here apply to direct Anthropic API/subscription only
  • Priority ordering is stable design semantics and should hold across versions; we will update the status here once the Windows issue is fixed

Related Articles

You Set ANTHROPIC_BASE_URL. Claude Code Ignored It.

I exported ANTHROPIC_BASE_URL in .zshrc to point at a self-hosted API gateway, and Claude Code kept talking to Google Vertex anyway. On the same machine, a launchd-managed web UI insisted it wasn't authenticated at all. Neither bug was in the gateway — both were in the gap between 'I set the env var' and 'the process actually has it.'

claude-codebug-postmortem+2
pitfallsAug 24, 20265 min
32

Claude Didn't Write That Printer Driver: 14KB of Glue, a Linux Container, and HP's Own Binary

A tweet claiming Claude wrote a macOS driver for a Windows-only HP printer pulled 2.62 million views. Pull the repo and you find 6,497 bytes of shell, 7,638 of Python, 550 of Dockerfile — not one line of C. The actual encoding is done by rastertospl, a binary from HP's official Linux driver, running in a Linux container on the Mac. Hacker News caught this. But debunking isn't the point: the genuinely valuable parts of that four-hour session (reading the printer's own error pages, escaping the CUPS sandbox, writing USB directly) and the fact that the decisive turn came from the human, not from Claude, are a precise measurement of where AI's grunt-work ability currently ends.

claude-codeopen-source+6
claudeAug 19, 202611 min
98

Fable 5 Has a 1M Context Window, So Why Does the Status Line Say 200k? Capture the Data Before You Swap the Tool

Claude Fable 5 officially ships with a 1M-token context window, yet the Claude Code status line kept showing 200k as the denominator. The first instinct — 'let's switch to a better statusline' — was wrong. This postmortem walks through the full debugging process: one line of tee to capture the statusline's stdin, hard evidence that the official field misreports 200000 for new models, and a model-table fix. Plus a general lesson: swapping tools never fixes a broken data source.

llmclaude-code+3
pitfallsAug 14, 20264 min
192

claude install Creates a Broken %h Symlink? Clean Debian Test Comes Out Fine (Not Reproduced)

A Fedora user reports on GitHub that the official one-line installer leaves ~/.local/bin/claude as a broken symlink pointing at the literal %h/.local/share/claude/versions/2.1.220 — the %h placeholder never expanded to the home directory. We ran the exact same install command in a clean Debian 12 container: the resulting symlink is correct (%h properly expanded), and install.sh now ships 2.1.223 (the report was against 2.1.220). This is a not-reproduced field report: full environment, commands, and raw output are included, along with three candidate explanations and a one-minute manual fix if you are currently stuck on the broken link.

claude-codeclaude-code-lab+4
hands-onAug 7, 20262 min
145