--model flag does not override settings.json model field

Resolved 💬 3 comments Opened Apr 3, 2026 by wslyfrnkln Closed Apr 6, 2026

Summary

The --model flag at launch does not override the "model" field in ~/.claude/settings.json. The settings value always wins.

Steps to Reproduce

  1. Set "model": "opusplan" in ~/.claude/settings.json (resolves to claude-sonnet-4-6)
  2. Launch with claude --model nemo-tools pointing at an Ollama backend via ANTHROPIC_BASE_URL
  3. Status bar shows "Sonnet 4.6" — the --model flag is ignored

Also tested:

  • ANTHROPIC_MODEL=nemo-tools env var before launch — ignored
  • --settings '{"model":"nemo-tools"}' inline JSON — ignored (merges additively, base file wins)
  • Temporarily swapping settings.json on disk — works, confirming the file is always authoritative

Expected Behavior

Per the docs, priority order should be:

  1. /model command during session
  2. --model flag at launch
  3. ANTHROPIC_MODEL env var
  4. settings.json "model" field

None of 1-3 actually override 4 in practice.

Context

Use case: launcher that routes to a local Ollama backend (zero-cost) for lightweight tasks, while keeping settings.json set to opusplan for regular sessions. Currently impossible without swapping the settings file on disk, which is fragile.

A CLAUDE_CODE_SETTINGS_PATH env var pointing to an alternate settings file would solve this cleanly.

Environment

  • Claude Code v2.1.91
  • macOS Darwin 24.6.0 arm64
  • settings.json "model" value: "opusplan"

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗