Melo Labs

← All articles

SDD with Haiku only: what quality is left when the cost drops

2026-11-08

sddhaikusonnetcostagentsstudy

TL;DR. I measured Claude Haiku 5.5 against Sonnet 5.5 on spec-driven development (SDD: PRD, technical spec, tasks and code) in the open-source project h3, over 198 isolated runs. For about 1/5 of the list cost (0.18 of Sonnet), Haiku writes TechSpec and Tasks documents with almost the same scores as Sonnet, but it gets the full code right in 72% of runs against 91% for Sonnet. Most of that gap is a single test (a non-existent route answering 404 as problem+json, which the task contract did not explicitly ask for); without it Haiku is at 94% against 91%. And when tasks, not runs, are the unit, the interval includes zero. So the study does not decide whether Haiku loses on code. What the measurement supports: cost drops to about 1/5, documents do not differ by 3 points or more, the hybrid design does not pay for its cost, and Haiku with tests first and a loop improves a lot over simple Haiku. By the rule I wrote beforehand, the formal verdicts for H1, H4, H5 and H11 come out “underpowered”, because the rubric fell below the reliability I required and there are few tasks per condition. An independent adversarial review recomputed the numbers, found them right and several readings overstated; they are corrected here.

The question

Each SDD stage is a request to a model: write the PRD, the TechSpec, the task list and finally the code. Small models cost a fraction of large ones. The practical question is: can the whole cycle be delivered with the small model and the right engineering around it (tests first, gates, a correction loop) without losing much quality? Most of what you read about this is opinion. I wanted numbers, with the rules written down beforehand. The closest design I found in the literature, by Rosa et al. (2026), is a study registration with no results yet.

Hypotheses (summary)

I wrote 11 hypotheses before running anything, with margins and decision rules (git tag prereg-haiku-sdd-producao, plus three dated addenda). The main ones:

Four of them (H2, H7, H8, H9) are out of this study by my decision: voting, planted errors, caching and extra variations are left for a future paper.

How I measured

All code, raw data, prompts and transcripts are in the study repository, and one command reproduces the tables in a clean clone.

Results

Cost: Haiku wins by a wide margin, even using more tokens

List cost and tokens relative to Sonnet

Haiku with tests first and a loop (C4) costs 0.18 of Sonnet in list dollars (95% CI: 0.16 to 0.20). In return it uses 1.5 times Sonnet’s total tokens (1.39 to 1.64) and 1.55 times the new tokens. The cascade comes in at 0.15. In 52 of the 54 C4 runs the prompt went past 100 thousand tokens, where Haiku’s price goes up; the tool already charges that tier, so the 0.18 ratio includes it. By the metric I had registered, cost per run with an accepted core, it is US$ 0.31 for C4 against US$ 1.36 for Sonnet (ratio 0.23); by variant, C4’s cost ranges from 0.14 to 0.23 of Sonnet’s. The 100 thousand figure is only a price step, not a context limit, and failures are not associated with prompt size.

List cost per run and per run with accepted core

ConditionRunsMean list costMean total tokens
Default Sonnet (C0)54US$ 1.232.41 M
Simple Haiku (C1)36US$ 0.264.13 M
Haiku + tests + loop (C4)54US$ 0.223.64 M
Cascade (C5)12US$ 0.192.88 M

Documents: nearly a tie, but with a fragile instrument

Mean rubric score by condition

With 18 artifacts per arm and all three features, Sonnet is 0.7 points above simple Haiku on TechSpec (95% CI: −0.2 to +1.6, out of 35) and 0.2 below on Tasks (−0.8 to +0.5, out of 25). Far from the 3 points H1 predicted. The cascade scores 0.99 and 1.01 of Sonnet’s, at 0.15 of the cost. The weak point: Krippendorff’s alpha between the judges was 0.61, below the 0.67 I had set, and the scores are stuck near the ceiling (about 32 out of 35). By my own rule, the document hypotheses come out formally underpowered: the rule only allows “confirmed” with a reliable rubric. Two reading cautions: that alpha was computed per rubric criterion; for the mean of the three judges (the score that decides), estimated reliability goes above 0.67 (about 0.72 on TechSpec and 0.83 on Tasks, by Spearman-Brown, exploratory). And the intervals already exclude a difference of 3 points or more; what remains uncertain is whether the rubric, saturated near the ceiling and without access to the original request, sees real quality differences. The judges do not see the PRD, so “coverage of the request” was not measured. So “nearly a tie” holds for what the rubric measures.

Code: where Haiku still loses

Core tests by condition and variant

Sonnet passed the core in 49 of 54 runs (91%). Haiku with tests first and a loop (C4) passed in 39 of 54 (72%), and simple Haiku in 21 of 36 (58%). The difference between C4 and Sonnet is −18.5 points, with a one-sided Newcombe interval of −32.6 to −3.8: the interval does not rule out a deficit smaller than the 10-point margin, so H4’s formal status is “underpowered”. But two warnings change the reading, both from the adversarial review:

  1. The deficit is almost one test. Of the 15 C4 runs that failed the core, 12 failed only on P1 (“non-existent route answers 404 as problem+json”), in the #1384 tasks. The lean contract for #1384-a and #1384-c does not explicitly ask for it, and I classified P1 as core after the pilot. If P1 were an observation, C4 would pass 51 of 54 (94%) against Sonnet’s 49 of 54 (91%), a difference of +3.7 points (95% CI −7.2 to +15.0). The sign flips. So do not read “72% against 91%” as general code quality: what the data show is that Haiku handles this edge case worse, plus the failures on #1267 (3 runs).
  2. The unit is the task, not the run. The Newcombe interval treats the 54 runs as independent, but generalization is to tasks. By variant the difference was −44, +11, −44, −33, 0 and 0 points; the 95% t interval over 6 variants is −45 to +8 (by feature, −63 to +24), and includes zero. Two of the six variants (#1050) saturate at 100% in every condition. “Negative with credibility” holds only for these six tasks.

Saying “Haiku matches Sonnet on code” would be false; saying “it loses by more than 10 points” would be too.

Effect of test P1 on the C4 minus Sonnet difference

The pattern is by task, not general:

Hit map by task and condition

VariantSonnetSimple HaikuHaiku + tests + loop
#1384-a7/90/63/9
#1384-b7/96/68/9
#1384-c8/92/64/9
#12679/91/66/9
#1050-a9/96/69/9
#1050-b9/96/69/9

In both #1050 variants everyone reaches 100%. The loss shows up in #1384-a, #1384-c and #1267. If we count the fraction of tests passing (including the observation tests), the picture is milder: 0.89 for C4 against 0.91 for Sonnet. From 58% (simple Haiku) to 72% (C4) there is an improvement, but it cannot be attributed to “tests first and a loop”: C4 against C1 is +13.9 points with a 95% CI of −8.3 to +35.4, inconclusive. Also, in many runs some test commands were denied by the allowed-tools list (count from the adversarial review: 146 denials for Sonnet and 74 for C4), which may have limited the “loop with real output”.

What did not work or could not be tested

What this means in practice

Limitations

One project (h3, TypeScript), three features and six variants; models and prices as of 2026-11-04; judges that are samples of the same model (alpha 0.61 per criterion) and do not see the PRD; tests written by me, with the core defined by me after the pilot; an extension triggered by the partial result and a reduction of judges decided after seeing the primary (both registered before seeing the extension data; the final interval does not correct for this interim look, and the extension repeats the primary’s pattern); the study’s git history still holds old versions of the tests in clear text, out of the agent’s reach; the duration of the extension runs may have been affected by a judge running in parallel (tokens and cost are not affected); phase C (voting, planted errors, caching) was left out. The full threats to validity are in the repository.

Conclusion

Haiku 5.5 cuts the cost to about 1/5 and delivers SDD documents very close to Sonnet’s, but it loses more on the code of some tasks (mainly one #1384 edge case and #1267), and the study cannot say whether the overall loss is small, large or null. “The whole SDD with Haiku only, without losing quality” is not what the data show. What they show is a good case for a hybrid design (documents on Haiku, hard code on Sonnet), which is left for the next study.

References


The experiments, data and conclusions are mine. The writing was AI-assisted and reviewed by me.

The experiments, data and conclusions are the author's. The writing is AI-assisted and reviewed by him.