claude-code-strategy
Key Limitation: No Effort/Thinking Parameter Access
Critical finding: Claude Code custom commands and Task subagents support model selection but NOT effort/thinking parameters.
| Feature | Direct API | Claude Code |
|---|---|---|
| Model selection | ✅ | ✅ |
| Opus effort parameter | ✅ | ❌ |
| Haiku thinking budget | ✅ | ❌ |
What This Means
- Opus 4.5 in Claude Code runs at default (high) effort
- Haiku 4.5 in Claude Code runs with thinking OFF (default)
- Cannot access the 39% cost savings from
effort: medium - Cannot enable Haiku extended thinking for complex tasks
Claude Code-Specific Pricing
Since we can’t use Opus medium effort, the cost comparison changes:
| Model | Config in Claude Code | Cost/10K task | Quality |
|---|---|---|---|
| Haiku 4.5 | thinking: OFF (default) | $0.060 | ~70% |
| Sonnet 4.5 | standard | $0.180 | 77.2% |
| Opus 4.5 | effort: HIGH (default) | $0.180 | 80.9% |
Key insight: Opus high = Sonnet cost, but Opus has better quality!
Revised Strategy for Claude Code
┌─────────────────────────────────────────────────────────────┐│ MAIN CONVERSATION: Opus 4.5 (high effort - default) ││ Or: Sonnet 4.5 for cost-conscious users │└─────────────────────────────────────────────────────────────┘ │ Task Subagents │ ┌───────────────────┴───────────────────┐ ▼ ▼┌─────────────────┐ ┌─────────────────┐│ HAIKU 4.5 │ │ OPUS 4.5 ││ (Simple) │ │ (Complex) │├─────────────────┤ ├─────────────────┤│ Cost: $6/M │ │ Cost: $18/M ││ Quality: ~70% │ │ Quality: 80.9% ││ Speed: Fastest │ │ Speed: Fast │├─────────────────┤ ├─────────────────┤│ • Install deps │ │ • Schema design ││ • Run tests │ │ • Refactoring ││ • File ops │ │ • Architecture ││ • Verification │ │ • Integration ││ • Simple docs │ │ • Critical code │└─────────────────┘ └─────────────────┘Why Sonnet is Now Obsolete in Claude Code
Since Opus high effort = Sonnet cost ($18/M):
| Comparison | Sonnet 4.5 | Opus 4.5 (high) | Winner |
|---|---|---|---|
| Cost | $18/M | $18/M | Tie |
| Quality | 77.2% | 80.9% | Opus (+3.7pp) |
| Long tasks | Baseline | +29% | Opus |
| Code quality | 1/8 langs | 7/8 langs | Opus |
Verdict: For complex tasks in Claude Code, always use Opus 4.5 - same cost, better quality.
Custom Command Configuration
Simple Task Command (Haiku)
---model: claude-haiku-4-5-20251015description: Run tests and report resultsallowed-tools: Bash(bun test:*), Read---
Run the test suite and provide a summary of results.Complex Task Command (Opus)
---model: claude-opus-4-5-20251101description: Architectural analysis and refactoringallowed-tools: Read, Write, Edit, Glob, Grep---
Analyze the codebase architecture and propose improvements.Planning Command (Opus)
---model: claude-opus-4-5-20251101description: Create detailed implementation planallowed-tools: Read, Glob, Grep, Write---
Create a comprehensive plan for the requested feature.Task Subagent Model Selection
In the Task tool, specify the model:
// Simple task → HaikuTask( subagent_type: "general-purpose", model: "haiku", prompt: "Install dependencies and verify setup")
// Complex task → Opus (NOT Sonnet)Task( subagent_type: "general-purpose", model: "opus", prompt: "Design the Zod schema with .passthrough() for flexibility")Cost Comparison: Claude Code vs Direct API
For Complex Tasks (18 tasks like frontmatter-improvement)
Claude Code (no effort parameter):
Planning: 1 × Opus high = $18/MSimple (11 tasks): 11 × Haiku = $66/MComplex (7 tasks): 7 × Opus high = $126/MTotal: $210/MDirect API (with effort parameter):
Planning: 1 × Opus high = $18/MSimple (11 tasks): 11 × Haiku = $66/MComplex (7 tasks): 7 × Opus MEDIUM = $77/MTotal: $161/M
Savings: 23% cheaper with direct APIWhen to Use Direct API Instead
Consider direct API calls when:
- Running high-volume batch operations
- Need the 39% cost savings from Opus medium
- Building custom tooling outside Claude Code
- Cost optimization is critical
Updated Execution Pattern
For the /execute Slash Command
---model: claude-opus-4-5-20251101description: Execute a plan with optimal model routingallowed-tools: Task, Read, Write, Bash, Glob, Grep---
Execute the plan at .claude/plans/$ARGUMENTS.md
Task routing:- Simple/mechanical tasks → model: haiku- Complex reasoning tasks → model: opus- All tasks → NO Sonnet (Opus same cost, better quality)Example Task Classification
| Task Type | Model | Rationale |
|---|---|---|
bun install | Haiku | Command execution, no reasoning |
bun test | Haiku | Command execution, report results |
| Verify TypeScript | Haiku | Simple check, pass/fail |
| Create Zod schema | Opus | Requires design reasoning |
| Replace parser | Opus | Complex refactoring |
| Update functions | Haiku or Opus | Depends on complexity |
| Documentation | Haiku | Straightforward writing |
Speed Considerations
Haiku advantages:
- 3-5x faster than Opus for simple tasks
- Lower latency for quick operations
- Ideal for parallel execution of many simple tasks
Opus advantages:
- Better first-attempt success (fewer retries)
- Token efficient (generates less verbose output)
- Better for sequential complex reasoning
Monitoring and Optimization
Track These Metrics
-
Task success rate by model
- Haiku failures on “simple” tasks → reclassify as complex
- Opus overkill on tasks → downgrade to Haiku
-
Cost per successful task
- Haiku: Should be ~$0.06 per task
- Opus: Should be ~$0.18 per task
- Watch for retry overhead
-
Total execution time
- Haiku parallelization benefits
- Opus single-attempt efficiency
Adjustment Triggers
- Haiku failure rate >10%: Reclassify tasks or use Opus
- Opus tasks too simple: Downgrade to Haiku
- Cost exceeds budget: Review task classification
Summary: Claude Code Optimal Strategy
| Role | Model | Why |
|---|---|---|
| Main conversation | Opus 4.5 or Sonnet 4.5 | User preference/budget |
| Planning | Opus 4.5 | Best reasoning |
| Simple execution | Haiku 4.5 | Fastest, cheapest |
| Complex execution | Opus 4.5 | Same cost as Sonnet, better quality |
| Sonnet 4.5 | Skip it | No advantage in Claude Code |
Future Considerations
If Claude Code Adds Effort Parameter Support
The strategy would change to:
- Simple tasks: Haiku (unchanged)
- Complex tasks: Opus medium (39% cheaper than current)
- Critical tasks: Opus high (unchanged)
Potential savings: ~23% reduction in complex task costs
Feature Request
Consider requesting Anthropic add effort/thinking parameters to:
- Custom slash command YAML frontmatter
- Task subagent configuration
- Claude Code settings
Last updated: 2025-11-24 Key insight: In Claude Code, Opus 4.5 (high effort) costs the same as Sonnet 4.5 but delivers +3.7pp better quality. Always prefer Opus over Sonnet for complex tasks.