← All recipes

Haiku was enough

We gave all three models a checkout feature with coupons, tax and edge cases. All nine runs passed every hidden test. Haiku averaged under a cent; Opus cost 25 times more.

Cost per run Each bar is the average cost of the runs, starting at $0.

See every run, check and diff →

Most people pick one model and use it for everything. We wanted to know what you actually get for the price on an ordinary, well-specified coding task.

The setup

The same small cart module as our CLAUDE.md recipe, with the same short CLAUDE.md, so every model knew the house rules. The prompt asks for a real feature with several edge cases (quoted exactly):

Add a checkout(items, { coupon } = {}) function to the cart module. It returns { subtotal, discount, tax, total }. Rules: items with qty 0 or less are ignored. Coupons are case-insensitive and ignore surrounding spaces: ‘SAVE10’ takes 10% off the subtotal, ‘FLAT5’ takes $5 off but never more than the subtotal, an empty or missing coupon means no discount, and any other code throws an Error whose message is ’Unknown coupon: ’ followed by the trimmed code. Tax applies to the subtotal after the discount. subtotal, discount and tax are each rounded to cents, and total is subtotal - discount + tax. Add tests.

After each run we copied in hidden tests Claude never saw, covering every rule in the prompt.

What happened

Haiku 5.5 Sonnet 5.5 Opus 5.5
Hidden tests pass (all edge cases) 3 of 3 3 of 3 3 of 3
npm run check passes 3 of 3 3 of 3 3 of 3
Added its own tests 3 of 3 3 of 3 3 of 3
Followed the CLAUDE.md rules 3 of 3 3 of 3 3 of 3
Average cost per run $0.009 $0.105 $0.221
Average turns 14.7 14.3 12
Average time 28s 27s 42s

Claude Code 2.1.296, 3 runs per model. Costs are as Claude Code reports them, at list prices. Every run, check and diff: run data.

What we learned

On a clear task, all three were equally right. Every run passed every hidden test, kept the generated file untouched, added a changelog line and ran the checks before finishing. Nothing in the results separates the models on quality.

The price gap was huge. Haiku averaged under a cent per run. Sonnet cost about 12 times more, and Opus about twice Sonnet, or 25 times Haiku.

Haiku worked harder for it. It wrote about 50% more output tokens than Sonnet and had more shell commands refused by the permission checks (3 or 4 per run, against 2 to 4 for Sonnet and 1 for Opus). It still finished in about the same time, and the price per token is low enough that the extra work barely shows.

Opus was the most direct, and the slowest. It took the fewest turns and hit the fewest dead ends, but each turn took longer, so it finished about 15 seconds behind the others.

This was an easy test to pass. The prompt spelled out every rule. We haven’t yet tested vague requests, bugs with no clear cause or changes across many files, which is where the bigger models are supposed to earn their price.

The recipe

  1. Try Haiku first for well-specified tasks. If you can write the rules down as clearly as our prompt, Haiku is likely enough. Switch models in a session with /model.
  2. Write the spec, not just the request. Our prompt listed every edge case. We think that clarity is what let the cheapest model match the most expensive one, though we haven’t yet run the same task with a vague prompt.
  3. Keep a test the model didn’t write. Our hidden tests are what made the comparison trustworthy. In your project, that’s your existing test suite plus a review.
  4. Move up a tier when the task gets fuzzy, not by default. Our working assumption is that bigger models earn their price on ambiguity, not typing. That’s the next thing we’ll test.

Keep reading

All recipes →
  • Verified

    5 of 5 vs 4 of 5runs passing the hidden edge-case test: Opus-written locked tests ($0.219 a run) vs plain Sonnet 5.5 ($0.079 a run)

    Opus writes the tests, Sonnet implements: 5 of 5 on the hidden edge cases, but 0 of 5 passed the lint check, at 2.8x the cost

    We built the same bill-splitting function 15 times: plain Sonnet 5.5, Sonnet told to write tests first, and Sonnet implementing against a test file Opus 5.5 wrote in a separate session and Sonnet was not allowed to edit. Hidden edge-case test: 4 of 5, 4 of 5 and 5 of 5. But none of the 5 Opus-tests runs passed the project's own npm run check, and they cost $0.219 a run vs $0.079 for plain Sonnet.

    • testing
    • models
    • cost
  • Verified

    5 of 5 vs 4 of 5runs passing the hidden tests: Sonnet 5.5 high effort ($0.386 a run) vs Opus 5.5 low effort ($0.461 a run)

    Sonnet on high effort vs Opus on low: Sonnet passed 5 of 5 for 16% less, Opus finished sooner

    We ran the same 3-step CSV export feature in a 164-file repo 5 times with Sonnet 5.5 at --effort high and 5 times with Opus 5.5 at --effort low. Sonnet high passed the hidden tests in 5 of 5 runs for $0.386 a run. Opus low passed 4 of 5 for $0.461, but its median run took 98s vs 134s for Sonnet.

    • models
    • effort
    • cost
  • Verified

    $2.64 vs $3.28average cost per run, Fable 5.2 (Claude Code 2.1.321 rerun) vs Fable 5.1 (both fixed the bug in every scored run)

    Fable 5.2 is 20% cheaper per token. On our bug fix it averaged $2.64 a run, under Fable 5.1's $3.28

    Launch-day test: Claude Fable 5.2, Fable 5.1 and Opus 5.5 on the same planted bug in undici (902 files), same prompt and tools. Fable 5.2 (rerun on Claude Code 2.1.321) fixed the bug in 3 of 3 and averaged $2.64 a run and 2.37M tokens. Fable 5.1 averaged $3.28 and 2.04M; Opus $0.77 and 1.39M. Small samples: 3, 2 and 3 runs.

    • models
    • cost

Compare this test with every other one on the scoreboard.