Claude Code

Claude Code /model: switch models, aliases (opus, sonnet, haiku, opusplan), ANTHROPIC_MODEL and effort

How do I change the model Claude Code uses?

Run /model inside a session to open the picker, or /model sonnet to switch directly. At startup use claude --model opus, or set ANTHROPIC_MODEL or the model key in settings.json for a lasting default. Use /effort to trade reasoning depth for speed and cost.

Ways to set the model, in priority order

  • During a session: /model <alias|name>, or /model with no argument to open the picker
  • At startup: claude --model <alias|name>
  • Environment variable: ANTHROPIC_MODEL=<alias|name>
  • Settings: the model field in your settings file
  • Default for new sessions: ANTHROPIC_DEFAULT_MODEL=<alias|name> (v2.1.236 or later)

In the /model picker, Enter switches and saves the choice as your default. Press s on a row to switch for this session only.

Start with Opus

claude --model opus

Switch mid-session

/model sonnet

settings.json

{
  "model": "opus"
}

Model aliases

  • default: clears any override and returns to your account's default
  • sonnet: latest Sonnet, for daily coding
  • opus: latest Opus, for complex reasoning
  • haiku: fast and efficient, for simple tasks
  • sonnet[1m], opus[1m]: 1 million token context window variants
  • opusplan: Opus during plan mode, then Sonnet for execution
  • fable: the Fable model for your provider, for your hardest and longest-running tasks
  • best: the model fable resolves to where Fable is available to you, otherwise the same model as opus

On the Anthropic API, opus, sonnet and haiku currently resolve to Opus 5.5, Sonnet 5.5 and Haiku 5.5. Some other providers resolve them to earlier versions. To pin a version, use the full model name such as claude-opus-5-5.

Pin aliases with environment variables

Each value must be a full model name or your provider's identifier.

  • ANTHROPIC_DEFAULT_OPUS_MODEL: model for opus, and for opusplan in plan mode
  • ANTHROPIC_DEFAULT_SONNET_MODEL: model for sonnet, and for opusplan outside plan mode
  • ANTHROPIC_DEFAULT_HAIKU_MODEL: model for haiku and background functionality
  • CLAUDE_CODE_SUBAGENT_MODEL: default model for subagents that are not assigned one

Shell

export ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-5-5

Adjust effort level

Opus 5.5, Sonnet 5.5 and Haiku 5.5 support low, medium, high, xhigh and max, and default to medium. Set it with /effort, --effort, CLAUDE_CODE_EFFORT_LEVEL, or the effortLevel settings key. /effort auto clears the saved level. max is session-only unless set through CLAUDE_CODE_EFFORT_LEVEL, and is not accepted by effortLevel.

Inside Claude Code

/effort high

Restrict models for a team

Admins can limit choices with availableModels in managed or policy settings. Add enforceAvailableModels to also restrict the Default option (v2.1.175 or later).

Managed settings

{
  "availableModels": ["sonnet", "haiku"],
  "enforceAvailableModels": true
}

Sources

More on Claude Code

Other guides

Cursor: allow all terminal commandsClaude Code: allow commands without promptsCodex CLI: approval and sandbox modesGemini CLI: YOLO mode, auto_edit and allowing specific shell commandsCursor Privacy Mode: telemetry, training and data retentionClaude Code telemetry and data retention: what is sent and how to turn it offGemini CLI: turn off usage statistics and telemetryCLAUDE.md: where it goes, how it loads, and how it works with AGENTS.mdClaude Code hooks: format on save, block risky edits, get notifiedClaude Code subagents: create one, limit its tools, and call itAdd MCP servers to Cursor with mcp.json: Keep files out of Cursor with .cursorignore: Configure Codex with config.toml: Configure Gemini CLI with settings.json: Add MCP servers to Claude Code (claude mcp add, .mcp.json, scopes): Claude Code custom slash commands and skills (SKILL.md): GitHub Copilot custom instructions: Adding MCP servers to GitHub Copilot: Claude Code settings.json: file locations, precedence, and key settingsClaude Code plugins and marketplaces: install, create, and shareGemini CLI extensions and custom commands: Configuring OpenCode with opencode.json: Cline Rules: workspace, global, and conditional rulesKiro steering files: .kiro/steering, inclusion modes, and AGENTS.mdZed agent: instruction files, MCP servers, tool permissions, and ACP agentsCursor CLI: install, headless mode, permissions and CIAider: CONVENTIONS.md, .aider.conf.yml and API keysJunie guidelines, MCP and the Action Allowlist: Amp AGENTS.md, settings.json and MCP: Configure Goose extensions, hints, recipes and permissions: Customize OpenHands with skills, AGENTS.md, setup.sh and MCP: Configure Factory Droid CLI: AGENTS.md, settings.json, autonomy, custom droids and MCPConfigure Qwen Code: settings.json, providers, QWEN.md, MCP and approval modesCursor hooks: hooks.json, beforeShellExecution, afterFileEdit and exit codesCursor sandbox: sandbox.json, network allowlist and run modesCursor settings: settings.json, Cursor Settings and the ~/.cursor config filesCursor browser agent: @browser, browser automation and approval modesCursor subagents: .cursor/agents, frontmatter, built-in Explore, Bash and BrowserCursor telemetry and OpenTelemetry export (Privacy Mode, OTLP, Analytics API): Cursor rules setup: .cursor/rules, .mdc frontmatter, globs, alwaysApply and AGENTS.mdClaude Code headless mode: claude -p, --output-format json, --bare and CI flagsClaude Code statusline: custom status bar in settings.json with context %, cost and git branchClaude Code /cost and /usage: check token spend, usage limits and reduce costsClaude Code VS Code extension: install, shortcuts, settings and /ideCodex AGENTS.md: global, project and override instruction files explainedCodex MCP servers: codex mcp add and [mcp_servers] in config.tomlCodex sandbox modes: read-only, workspace-write, danger-full-access and network accesscodex exec: run Codex non-interactively in scripts and CI with JSON outputCodex skills: create SKILL.md, skill folder locations and $skill invocationGEMINI.md in Gemini CLI: context file locations, imports and /memoryGemini CLI MCP servers: gemini mcp add and mcpServers in settings.jsonGemini CLI custom slash commands: TOML files, {{args}}, !{shell} and @{file}Gemini CLI headless mode: gemini -p, JSON output and exit codes for scripts and CIGemini CLI sandbox: enable Docker, Podman, macOS Seatbelt or gVisorcopilot-setup-steps.yml: set up the GitHub Copilot cloudGitHub Copilot CLI permissions: --allow-tool, --deny-tool, --allow-all-tools and trusted directoriesGitHub Copilot custom agents: .github/agents/*.agent.md profiles, tools and frontmatterGitHub Copilot code review settings: automatic PR reviews, rulesets, effort level and approvals

Get the weekly agent stack update

New official MCP servers, spec changes and harness releases, checked against the source. One email a week, no fluff.

Reviewed Oct 13, 2026. Settings change often; the linked vendor docs are the source of truth.