--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
- Set
"model": "opusplan"in~/.claude/settings.json(resolves toclaude-sonnet-4-6) - Launch with
claude --model nemo-toolspointing at an Ollama backend viaANTHROPIC_BASE_URL - Status bar shows "Sonnet 4.6" — the
--modelflag is ignored
Also tested:
ANTHROPIC_MODEL=nemo-toolsenv var before launch — ignored--settings '{"model":"nemo-tools"}'inline JSON — ignored (merges additively, base file wins)- Temporarily swapping
settings.jsonon disk — works, confirming the file is always authoritative
Expected Behavior
Per the docs, priority order should be:
/modelcommand during session--modelflag at launchANTHROPIC_MODELenv varsettings.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"
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗