Launch Claude Code with a Specific Model Using --model
You already know you can switch models mid-conversation with /model — but you can also set it upfront when launching Claude Code from the command line.
# Use Opus for a complex architecture task
claude --model claude-opus-4-6 \
"Design the data model for a multi-tenant SaaS billing system"
# Use Haiku for a quick, cheap lookup
claude --model claude-haiku-4-5-20251001 \
"What does this regex match? /^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/"
The --model flag sets the starting model for your session. You can still switch with /model during the conversation if your needs change.
This is especially useful when you're scripting Claude Code invocations and want deterministic, reproducible behaviour — like in CI pipelines or automation scripts where you'd rather explicitly pin the model than rely on a default that might change.
# In a Makefile or automation script
review:
git diff HEAD | claude --model claude-sonnet-4-6 -p \
"Review this diff for bugs and security issues."
docs:
claude --model claude-opus-4-6 \
"Read the codebase and write comprehensive API documentation."
Matching model to task is a quick way to optimise for cost, speed, or quality depending on what the job actually needs.
Pick your model before you start — match the horsepower to the task.
Log in to leave a comment.
The autoUpdatesChannel setting pins Claude Code to a stable release track that skips versions with major regressions.
The language setting makes Claude respond in your preferred language by default, across every session and project.
The attribution setting lets you customize or completely remove Claude's Co-Authored-By trailer from git commits and pull requests.