Smart Model Switching
Three-tier Claude routing: Haiku โ Sonnet โ Opus
Start with the cheapest model. Escalate only when needed. Save 50-90% on API costs.
The Golden Rule
If a human would need more than 30 seconds of focused thinking, escalate from Haiku to Sonnet. If the task involves architecture, complex tradeoffs, or deep reasoning, escalate to Opus.
Cost Reality
| Model | Input | Output | Relative Cost |
|---|---|---|---|
| Haiku | $0.25/M | $1.25/M | 1x (baseline) |
| Sonnet | $3.00/M | $15.00/M | 12x |
| Opus | $15.00/M | $75.00/M | 60x |
Bottom line: Wrong model selection wastes money OR time. Haiku for simple, Sonnet for standard, Opus for complex.
๐ HAIKU โ Default for Simple Tasks
Stay on Haiku for:
- Factual Q&A โ "what is X", "who is Y", "when did Z"
- Quick lookups โ definitions, unit conversions, short translations
- Status checks โ calendar, file reads, session monitoring
- Heartbeats โ periodic checks, HEARTBEAT_OK responses
- Memory & reminders โ "remember this", "remind me to..."
- Casual conversation โ greetings, small talk, acknowledgments
- Simple file ops โ read, list, basic writes
- One-liner tasks โ anything answerable in 1-2 sentences
NEVER do these on Haiku
- โ Write code longer than 10 lines
- โ Create comparison tables
- โ Write more than 3 paragraphs
- โ Do multi-step analysis
- โ Write reports or proposals
๐ SONNET โ Standard Work (The Workhorse)
Escalate to Sonnet for:
Code & Technical
- Code generation โ write functions, build features, scripts
- Code review โ PR reviews, quality checks
- Debugging โ standard bug investigation
- Documentation โ README, comments, user guides
Analysis & Planning
- Analysis & evaluation โ compare options, assess trade-offs
- Planning โ project plans, roadmaps, task breakdowns
- Research synthesis โ combining multiple sources
- Multi-step reasoning โ "first... then... finally"
Writing & Content
- Long-form writing โ reports, proposals, articles (>3 paragraphs)
- Creative writing โ blog posts, descriptions, copy
- Summarization โ long documents, transcripts
- Structured output โ tables, outlines, formatted docs
โค๏ธ OPUS โ Complex Reasoning Only
Escalate to Opus for:
Architecture & Design
- System architecture decisions
- Major codebase refactoring
- Design pattern selection with tradeoffs
- Database schema design
Deep Analysis
- Complex debugging (multi-file, race conditions)
- Security reviews
- Performance optimization strategy
- Root cause analysis of subtle bugs
Strategic & Creative
- Strategic planning โ business decisions, roadmaps
- Nuanced judgment โ ethics, ambiguity, competing values
- Deep research โ comprehensive multi-source analysis
๐ Implementation
For Subagents
```javascript // Routine monitoring sessions_spawn(task="Check backup status", model="haiku")
// Standard code work
sessions_spawn(task="Build the REST API endpoint", model="sonnet")
// Architecture decisions sessions_spawn(task="Design the database schema for multi-tenancy", model="opus") ```
For Cron Jobs
```json { "payload": { "kind": "agentTurn", "model": "haiku" } } ``` Always use Haiku for cron unless the task genuinely needs reasoning.
๐ Quick Decision Tree
``` Is it a greeting, lookup, status check, or 1-2 sentence answer? YES โ HAIKU NO โ
Is it code, analysis, planning, writing, or multi-step?
YES โ SONNET
NO โ
Is it architecture, deep reasoning, or critical decision? YES โ OPUS NO โ Default to SONNET, escalate if struggling ```
๐ Quick Reference Card
``` โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ SMART MODEL SWITCHING โ โ Haiku โ Sonnet โ Opus โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ ๐ HAIKU (cheapest) โ โ โข Greetings, status checks, quick lookups โ โ โข Factual Q&A, definitions, reminders โ โ โข Simple file ops, 1-2 sentence answers โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ ๐ SONNET (standard) โ โ โข Code > 10 lines, debugging โ โ โข Analysis, comparisons, planning โ โ โข Reports, proposals, long writing โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ โค๏ธ OPUS (complex) โ โ โข Architecture decisions โ โ โข Complex debugging, multi-file refactoring โ โ โข Strategic planning, deep research โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ ๐ก RULE: If a human needs > 30 sec thinking โ escalate โ โ ๐ฐ COST: Haiku 1x โ Sonnet 12x โ Opus 60x โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ```
Built for Claude-only setups with Haiku, Sonnet, and Opus. Inspired by save-money skill, extended with three-tier progression.