Switch Models Mid-Conversation with /model
Not every task needs the most powerful (and expensive) model. Switch on the fly with /model.
/model sonnet
This is a game-changer for cost management. Use Opus for complex architecture decisions and tricky debugging, then drop to Sonnet for straightforward file edits and boilerplate generation.
A practical workflow:
# Start with Opus for the hard thinking
/model opus
"Design the database schema for a multi-tenant SaaS app"
# Switch to Sonnet for the implementation grunt work
/model sonnet
"Now create the migration files based on that schema"
You can also set the default model when launching Claude Code:
claude --model sonnet
Here's a rough guide for when to use each:
- Opus — complex debugging, architecture decisions, multi-file refactors, subtle logic bugs
- Sonnet — boilerplate generation, simple edits, test writing, documentation, routine tasks
- Haiku — quick questions, formatting, simple lookups
The context window carries over when you switch, so Claude doesn't lose any conversation history.
Match the model to the task — your wallet will thank you.
Log in to leave a comment.
A PreToolUse hook can intercept test runner commands and filter output to show only failures, cutting thousands of tokens from Claude's context.
CLAUDE.md loads into every message. Move workflow-specific instructions into skills that load on demand to reduce token costs across your session.
Every event emitted while processing a single prompt shares a prompt.id UUID, letting you trace the complete chain of API calls and tool executions.