Description
Claude Code is autonomously switching the model during a session, even though a specific model was set via the --model CLI flag at launch. The model change is not initiated by the user — Claude itself is switching it mid-session.
Steps to Reproduce
- Launch Claude Code with an explicit model flag:
claude --model claude-opus-4-6
- Use Claude Code normally during the session
- Observe that the model indicator changes (e.g., from Opus 4.6 to Sonnet 4.6) without user action
Expected Behavior
The model set via --model should remain active for the entire session unless the user explicitly switches it (e.g., via /model).
Actual Behavior
Claude Code autonomously switches to a different model mid-session without user input.
Environment
- Platform: macOS (Darwin 25.2.0)
- Model: claude-opus-4-6
Workaround
Setting availableModels in .claude/settings.json to restrict to a single model may prevent this, but it also prevents legitimate user model selection via CLI flags.
Description
Claude Code is autonomously switching the model during a session, even though a specific model was set via the
--modelCLI flag at launch. The model change is not initiated by the user — Claude itself is switching it mid-session.Steps to Reproduce
Expected Behavior
The model set via
--modelshould remain active for the entire session unless the user explicitly switches it (e.g., via/model).Actual Behavior
Claude Code autonomously switches to a different model mid-session without user input.
Environment
Workaround
Setting
availableModelsin.claude/settings.jsonto restrict to a single model may prevent this, but it also prevents legitimate user model selection via CLI flags.