Model config in settings.json silently ignored
Summary
Claude Code v2.1.75 ignores the "model" key in ~/.claude/settings.json
and provides no error or warning. The CLAUDE_MODEL env var is partially
read but misinterprets the alias opus, silently downgrading to Sonnet 4.5.
Only ANTHROPIC_MODEL=opus works.
Environment
- Claude Code version: v2.1.75
- OS: macOS (M1 Mac, 32GB RAM)
- Shell: zsh (Oh My Zsh)
- Subscription tier: Claude Max
- Relevant config: Custom statusline, pyright-lsp plugin enabled
Steps to reproduce
- Add
"model": "claude-opus-4-6"to~/.claude/settings.json - Kill all Claude Code processes (
pkill -f "claude") - Verify the file contains the model key (
cat ~/.claude/settings.json) - Launch
claude - Observe: starts as
claude-sonnet-4-6-20260217— model key ignored
- Try
"model": "opus"instead — same result
- Set
CLAUDE_MODEL=opusin environment - Launch
claude - Observe: starts as
Sonnet 4.5— alias not recognised, silent downgrade
- Set
ANTHROPIC_MODEL=opusin environment - Launch
claude - Observe: starts as Opus — this is the only method that works
Expected behaviour
Any of these three config methods should set the model, or produce a clear
error explaining why they can't.
Actual behaviour
settings.json"model"key: silently ignored, no errorCLAUDE_MODEL=opus: silently downgrades to Sonnet 4.5ANTHROPIC_MODEL=opus: works (only working method found)
Workarounds attempted
| Method | Result |
|---|---|
| "model": "claude-opus-4-6" in settings.json | Ignored |
| "model": "opus" in settings.json | Ignored |
| claude config set model claude-opus-4-6 | Launched interactive session instead of writing config |
| CLAUDE_MODEL=opus | Downgraded to Sonnet 4.5 |
Resolution
ANTHROPIC_MODEL=opus in ~/.zshrc is the only reliable method.
Additional context
settings.jsonwas not being overwritten (verified viadiff) — the key
is simply not read.
claude config setappears to launch an interactive session rather than
acting as a standalone config command.
- The silent downgrade when using
CLAUDE_MODEL=opus(Sonnet 4.6 → 4.5)
suggests partial env var parsing with broken alias resolution.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗