Model Aliases - Claude Code
Use opus, sonnet, haiku, and best to switch models easily.
Model aliases let you pick a model by role rather than memorizing version numbers. opus, sonnet, haiku, and best all map to the current release of that tier.
What it does
You set opus and Claude Code picks the latest Opus model available on your plan. sonnet maps to the latest Sonnet. best picks whichever model is highest-tier for your account. Aliases update automatically when Anthropic releases new versions, so you don't rewrite scripts every release.
When to use it
- Config files that should stay valid across model updates.
- Quick switching during a session via
/model. - Scripts and routines that target a tier, not a specific version.
- Teaching examples where you don't want to pin a version.
Gotchas
- Aliases change under you when a new model ships. If you need stability, pin a specific version ID.
- Some aliases are plan-gated -
beston a Pro plan differs frombeston Max. - Benchmarks that depend on a specific model should never use aliases.
Official docs: https://code.claude.com/docs/en/model-config.md
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.
Get the weekly deep dive
Tutorials on Claude Code, AI agents, and dev tools - delivered free every week.
Was this helpful?




