Skip to main content
Tips

beginner tip

Pick the Right Model in Claude Code to Stop Wasting Tokens

AIErudit angle: Cost-aware AI delivery means allocating reasoning power where it actually matters instead of defaulting to the frontier model for everything. This tip shows the plan-execute-explore strategy — Opus for architecture, Sonnet for implementation, Haiku for search — and the opusplan alias that automates it. It's a direct lever on your AI spend and latency.

model-selectiontoken-efficiencyclaude-codetips
Tip visual

Published: Mar 2, 2026 Updated: 2026-06-14

Original: https://wmedia.es/en/tips/claude-code-choose-right-model

Model snapshot — 2026-09-24. The model names and version numbers in this tip are as of this tip's last update, not a standing recommendation. Anthropic's line-up moves; run /model or check the official models overview for the tiers available to you today. Not every task needs the frontier model. A frontier model is the most advanced, capable model available at any given time — which specific model that is changes every few months, so read it off /model rather than memorising a version number. Above the everyday frontier default there is also a ceiling tier for the hardest and longest-running work (see the tier above Opus). On Anthropic's current lineup (per the models overview, checked 2026-09-24), that is Claude Opus 5.5 for flagship coding and agentic work, with Claude Fable 5.1 above it for the hardest and longest-running tasks; Claude Sonnet 5 is the balanced workhorse and Claude Haiku 4.5 the fast, cheap tier. It's tempting to use it for everything: if you have access to the best, why settle for less?. But doing so wastes tokens, wait time, and resources. Most daily development tasks don't require deep reasoning.

Claude Code already applies this logic internally. Its Explore agent runs on Haiku for fast codebase searches. The opusplan alias automates the full strategy: Opus reasons through planning, Sonnet handles execution.

TL;DR Use opusplan to plan with Opus and execute with Sonnet. Switch to Haiku for quick exploration. Don't use the frontier model for everything — allocate power where it actually matters.

Result:

> /model

    default
  ● opusplan   ← Plan: Opus 5.5 · Execution: Sonnet 5
    opus
    sonnet
    haiku

The strategy: plan, execute, explore

1. Plan with the frontier model

Deep reasoning is only justified when designing architecture, evaluating trade-offs, or making decisions that affect the entire project. This is where Opus makes the difference.

claude --model opus
# Or switch mid-session:
/model opus

2. Execute with Sonnet

Writing functions, tests, refactoring — doesn't need the same level of reasoning. The balanced tier behind the sonnet alias delivers comparable intelligence at lower cost and higher speed.

/model sonnet

3. Explore with Haiku

Codebase searches, file reads, structure analysis. Read-only tasks where speed matters more than depth.

/model haiku

4. The shortcut: opusplan

If you don't want to switch manually, opusplan automates the strategy:

claude --model opusplan
# Or during a session:
/model opusplan

Opus activates during plan mode. When Claude transitions to execution, it switches to Sonnet automatically. This is exactly what Claude Code's native agents do — each task gets the right model for the job.

Reference

The aliases are stable; the model version behind each one is not, so this table keys on the alias you actually type. On the Anthropic API the models behind them as of 2026-09-24 are Haiku 4.5, Sonnet 5, Opus 5.5 and, above Opus, Fable 5.1 (other providers can resolve the aliases to older models).

AliasTierRelative costBest for
opusFrontier$$$Architecture, complex debugging, design decisions
sonnetBalanced$$Daily development, implementation, tests
haikuFastest$Exploration, searches, simple tasks
opusplanFrontier plan → balanced executionMixedFull workflow: plan + execute

Permanent configuration

Add the model to your settings.json so you don't have to choose every session:

{
  "model": "opusplan"
}

Or via environment variable:

export ANTHROPIC_MODEL=opusplan

You can also set it from the picker: since v2.1.153, Enter in /model saves it as your default and s keeps it to that session only. If your model sticks or resets when you didn't mean to, that's why.

If you want to further fine-tune Opus's reasoning during the planning phase, combine this strategy with Claude Code effort level adjustment: lower the effort for quick decisions and reserve high for architectural ones.

And there's a third option besides opusplan: the /advisor toggle. Unlike opusplan (Opus only in plan, Sonnet in execution), /advisor keeps Opus available during execution for on-demand consultations when Sonnet stalls — Anthropic measured −11.9% cost and +2.7% accuracy with that pattern.

Official docs: Model configuration

Part of the 10 habits to save tokens in Claude Code.