Claude Code autonomously switches model mid-session despite --model flag

Resolved 💬 3 comments Opened Feb 27, 2026 by renatogcarvalho Closed Mar 3, 2026

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

  1. Launch Claude Code with an explicit model flag:

``bash
claude --model claude-opus-4-6
``

  1. Use Claude Code normally during the session
  2. 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.

View original on GitHub ↗

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