Claw Mart
← All issuesClaw Mart Daily
Issue #173July 8, 2026

Claude Sonnet vs Opus vs Haiku — the routing pattern that cuts costs 60%

Your agent is burning through your API budget because it's using Opus to write commit messages and Haiku to architect systems. Here's the routing pattern that matches models to tasks and cuts costs without losing quality.

Most people pick one model and stick with it. That's expensive and slow. Opus costs 15x more than Haiku. Sonnet is 3x faster than Opus for most tasks. Route intelligently and you'll cut costs 60% while getting better results.

The Three-Tier Routing Pattern

Route by cognitive load, not task type:

Haiku (cheap, fast): Classification, validation, formatting, simple edits, status checks, parsing structured data

Sonnet (balanced): Code reviews, debugging, refactoring, writing documentation, complex analysis, multi-step tasks

Opus (expensive, deep): Architecture decisions, complex problem solving, creative writing, novel integrations, research synthesis

Here's how to implement it in your agent:

def route_model(task_type, complexity_score, context_size):
    # Quick tasks always go to Haiku
    if task_type in ['validate', 'format', 'parse', 'classify']:
        return 'haiku'
    
    # Large context or high complexity gets Opus
    if complexity_score > 8 or context_size > 100000:
        return 'opus'
    
    # Everything else gets Sonnet
    return 'sonnet'

The Real-World Results

I tracked this for a month on a coding agent that ships features daily:

  • 65% of calls went to Haiku (validation, formatting, simple edits)
  • 30% went to Sonnet (code reviews, refactoring, documentation)
  • 5% went to Opus (architecture decisions, complex debugging)

Total cost dropped from $180/month to $65/month. Quality stayed the same — actually improved because each model was doing what it's best at.

The Routing Rules That Matter

Don't route by task name. Route by cognitive requirements:

Send to Haiku if: The task has a clear right/wrong answer, follows a template, or processes structured data. Think: "Does this need intelligence or just following instructions?"

Send to Sonnet if: The task requires analysis, synthesis, or multi-step reasoning but stays within a defined domain. Think: "Does this need judgment calls but not breakthrough thinking?"

Send to Opus if: The task requires novel connections, creative problem-solving, or handling truly ambiguous requirements. Think: "Would a senior engineer need to think hard about this?"

The Handoff Pattern

Sometimes you need multiple models for one task. Route the planning to Opus, execution to Sonnet, and validation to Haiku:

# Complex refactoring example
1. Opus: Analyze codebase, create refactoring plan
2. Sonnet: Execute the refactoring steps  
3. Haiku: Validate syntax, run formatters, check tests

This costs 40% less than running everything through Opus and catches more errors than a single model doing everything.

The Budget Governor

Set spending limits per model tier. When Opus hits its daily limit, route complex tasks to Sonnet with a note: "Budget-constrained, focus on practical solutions." Your agent stays functional instead of going dark.

Most agents waste money on model overkill. Route by cognitive load, not convenience, and your budget will thank you.

Paste into your agent's workspace

Claw Mart Daily

Get tips like this every morning

One actionable AI agent tip, delivered free to your inbox every day.