Skip to main content

What is the --model Flag in Claude Code

The --model flag selects which Claude AI model to use for your session, enabling you to choose between Claude Sonnet 4.5, Claude Haiku 4.5 (near-frontier), Opus, and Claude 3.5 Haiku (legacy) based on task complexity, speed requirements, and cost considerations.



How to Use It

Use --model when launching Claude Code with simple aliases like sonnet, opus, or haiku, or specify the full model name for precise version control.

claude --model claude-sonnet-4-5-20250929
claude --model claude-haiku-4-5
claude --model claude-opus-4-20250514
claude --model claude-3-5-haiku-20241022

Why Use Different Models

Different models offer distinct advantages for specific development scenarios. Sonnet 4.5 provides balanced performance for most coding tasks, Haiku 4.5 achieves 90% of Sonnet's capability at 3x cost savings, Opus delivers maximum reasoning for complex problems, and Haiku 3.5 (legacy) offers basic fast responses.

Strategic Usage:

  • Sonnet 4.5: Regular development, file operations, routine coding (most tasks)
  • Haiku 4.5: Lightweight agents, high-frequency tasks, 90% capability at 3x savings (near-frontier)
  • Opus: Complex debugging, architecture decisions, security analysis (premium tasks)
  • Haiku 3.5: Legacy simple edits, basic formatting (consider upgrading to Haiku 4.5)

I use Sonnet 4.5 for daily development work, Haiku 4.5 for lightweight agents and high-frequency tasks (90% capability at 3x cost savings), escalate to Opus for complex architectural decisions, and use Haiku 4.5 when approaching usage limits.

Model Access by Plan

Claude Pro ($17/month annually, $20/month monthly) - Access to Sonnet model with 5x usage limits compared to free tier.

Claude Max 5x ($100/month) - Access to Sonnet with 5x higher usage limits than Pro, plus limited Opus access.

Claude Max 20x ($200/month) - Full access to all models including unrestricted Opus with 20x higher usage limits than Pro.

API Usage - Pay-per-token pricing with access to all models based on API tier.


See Also: Model Comparison|Pricing|Configuration