Claude Code model selection: session choice and defaults
Separate /model, --model and defaults; inspect resumed sessions and model restrictions before assuming the active model.
Separate a temporary choice from a saved default · Inspect the effective selection by source · Inspect resume and allowlists separately
At a glance
The goal is to explain the model used in a session and why a later launch may differ. The official model-config page was checked. Claude Code was not started, models were not switched and settings were not changed. Selection precedence and organizational restrictions need separate inspection.
Runtime and applicability
- Article type
- Spec file
- Verified
- Applies to
- Claude Code Applies to Claude Code as documented; environment prerequisites appear in the body.
- Tools
File locations
| Path | Scope | How it is read |
|---|---|---|
CLI 的 --model、会话 /model 与 settings.json 的 model | Session model selection and persistent defaults. | Startup reads arguments, environment and settings; /model requests a session switch. |
When to use
- When session choice differs from later startup, or separate terminals need separate models.
When not to use
- When model restrictions or account eligibility are unknown, inspect conditions before changing arguments.
Separate a temporary choice from a saved default
The current docs say /model opens the picker: Enter switches and saves a default, while s switches for this session only. Direct /model <name> behaves like Enter. --model and ANTHROPIC_MODEL apply to the launched session. Inspect per-terminal launch arguments for separate models so a persistent choice does not unintentionally alter later defaults. Older picker behavior differs; inspect the CLI version first.
Inspect the effective selection by source
The page lists session switches, --model, ANTHROPIC_MODEL, model settings and ANTHROPIC_DEFAULT_MODEL in selection order. /model saves user settings; project, managed settings or an organization default can reapply on later launch. Inspect a source named in the startup header before changing user defaults. No specific model ID is prescribed here: a family alias is not a permanently pinned version, which requires an actual provider ID.
Inspect resume and allowlists separately
Resume normally retains the saved model, while a new --model or ANTHROPIC_MODEL takes precedence. Retirement or availableModels exclusion falls through to normal selection; some providers with deployment IDs do not restore it. The allowlist also covers subagents and skill models. /model rejects blocked selections, while blocked startup values can be replaced with a warning. Family aliases with allowed versions have separate substitution rules, so rejection is not universal.
Record the actual source and stop conditions
Inspect version, launch arguments, environment, setting sources and startup warnings before checking the current model. For resume, record the transcript model separately. Only documentation and original argument strings were checked; picker behavior, provider availability and model requests were not verified. Stop model-pinned tasks when the active model, saved default or substitution is unclear and retain the error for diagnosis.
Sources
All links are official pages; verification dates are listed per source, and links point to the version checked.