Skip to content

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

Description

@renatogcarvalho

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:
    claude --model claude-opus-4-6
  2. Use Claude Code normally during the session
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions