Repository navigation
Benchmark
Herd (Sonnet designs, Haiku builds) was fully correct in 6 of 6 runs at $0.48 per run. Bare Sonnet, same prompt and no plugin, was fully correct in 2 of 6 at $0.52. Bare Opus was fully correct in 0 of 3 at $2.51.
Every leg got the same prompt, word for word, in headless claude -p sessions (Claude Code 2.1.332, claude-*-5-5 models). The bare legs ran with no plugin installed. Scored strictly with the hidden verifier (48 stores: 40 in tiers S, M and L, 8 in XL) and the six-case robustness probe. Mean ± standard deviation:
| Herd 0.15.0 (Sonnet design + Haiku build) | Sonnet + Herd 0.14.14 | Sonnet, no plugin | Haiku, no plugin | Opus, no plugin | |
|---|---|---|---|---|---|
| Runs | 6 | 3 | 6 | 3 | 3 |
| Valid stores, of 48 | 48.0 ± 0.0 | 48.0 ± 0.0 | 23.8 ± 26.1 | 21.7 ± 16.6 | 7.7 ± 6.6 |
| Runs with every store valid | 6 of 6 | 3 of 3 | 2 of 6 | 0 of 3 | 0 of 3 |
| Bad inputs handled, of 6 | 6.0 ± 0.0 | 6.0 ± 0.0 | 4.3 ± 0.8 | 5.0 ± 1.0 | 4.0 ± 1.0 |
| Cost per run | $0.48 ± 0.10 | $1.17 ± 0.24 | $0.52 ± 0.04 | $0.13 ± 0.07 | $2.51 ± 0.26 |
| Active minutes per run | 9.3 ± 0.9 | 26.3 ± 8.3 | 9.9 ± 5.5 | 9.9 ± 4.0 | 12.6 ± 1.5 |
Why the bare runs lost stores:
| Failure | Sonnet, no plugin | Haiku, no plugin | Opus, no plugin | Herd (9 runs) |
|---|---|---|---|---|
| Reports a time with a fixed part the request did not ask for (handover, setup or turns) | 3 of 6 | 0 of 3 | 1 of 3 | 0 |
| Diagonal moves, which the store layout does not allow | 0 of 6 | 2 of 3 | 2 of 3 | 0 |
| Crash on a product it refuses as unreachable | 0 of 6 | 1 of 3 | 0 of 3 | 0 |
Limits:
- One task and 3 to 6 runs per leg. A run's stores are close to all or nothing.
- The request names the time to prepare a basket but gives no formula. A run that adds a fixed handover time still finds a correct route, yet reports a different time, so strict scoring marks every store wrong. With that fixed time set to 0, bare Sonnet scores 47.8 of 48 and bare Opus 23.7. Herd's design step pinned the time down before code in all 9 Herd runs.
- The leak audit found only sandbox blocks (and a blocked npm call in two bare runs), so no run is excluded.
Per run, bare legs
| Leg | Run | Stores S+M+L, of 40 | XL, of 8 | Probe, of 6 | $ | Min | Failure |
|---|---|---|---|---|---|---|---|
| Sonnet | a1 | 40 | 7 | 4 | 0.52 | 7.0 | 1 XL timeout (maze, 300 s) |
| Sonnet | a2 | 40 | 8 | 4 | 0.47 | 17.7 | none |
| Sonnet | a3 | 0 | 0 | 6 | 0.51 | 8.8 | fixed 60 s handover in the time |
| Sonnet | b1 | 40 | 8 | 4 | 0.58 | 15.8 | none |
| Sonnet | b2 | 0 | 0 | 4 | 0.53 | 5.3 | fixed 30 s packing in the time |
| Sonnet | b3 | 0 | 0 | 4 | 0.54 | 4.8 | fixed 30 s setup and 60 s handover |
| Haiku | 1 | 10 | 2 | 4 | 0.12 | 13.6 | diagonal moves |
| Haiku | 2 | 10 | 2 | 6 | 0.20 | 10.6 | diagonal moves |
| Haiku | 3 | 35 | 6 | 5 | 0.07 | 5.6 | crash on an unreachable product (7 stores) |
| Opus | 1 | 0 | 0 | 3 | 2.25 | 14.2 | 1.5 s per turn in the time |
| Opus | 2 | 10 | 2 | 4 | 2.52 | 11.3 | diagonal moves |
| Opus | 3 | 9 | 2 | 5 | 2.76 | 12.3 | diagonal moves; 1 store with a different time |
The same prompt, word for word, given to Herd in real headless claude -p sessions with all hooks on. A Claude Sonnet 5.5 subagent designs in every leg (Herd's default); the builder is Claude Haiku 5.5, except in the last leg, where Sonnet builds too. Scored with the same hidden verifier (48 stores: 40 in tiers S, M and L, 8 in XL) and the six-case robustness probe. Mean ± standard deviation:
| Haiku + Herd 0.15.0 | Haiku + Herd 0.14.14 | Haiku + Herd 0.14.13 | Sonnet + Herd 0.14.14 | |
|---|---|---|---|---|
| Runs | 6 | 6 | 6 | 3 |
| Stores solved with a valid route, of 48 | 48.0 ± 0.0 | 46.7 ± 2.1 | 32.0 ± 24.8 | 48.0 ± 0.0 |
| of which XL, of 8 | 8.0 ± 0.0 | 7.7 ± 0.5 | 5.3 ± 4.1 | 8.0 ± 0.0 |
| Runs with every store valid | 6 of 6 | 4 of 6 | 4 of 6 | 3 of 3 |
| Bad-input scenarios handled, of 6 | 6.0 ± 0.0 | 6.0 ± 0.0 | 5.8 ± 0.4 | 6.0 ± 0.0 |
| Cost per run (the session's own cost) | $0.48 ± 0.10 | $0.59 ± 0.10 | $0.42 ± 0.13 | $1.17 ± 0.24 |
| Active minutes per run | 9.3 ± 0.9 | 11.0 ± 3.1 | 8.1 ± 1.3 | 26.3 ± 8.3 |
| Main-session turns | 37.3 ± 12.9 | 47.2 ± 13.7 | 35.5 ± 10.7 | 16.0 ± 1.0 |
| Time saved against list order, XL | 83.8 ± 0.9% | 84.1 ± 0.4% | 83.4 ± 0.9% | 83.6 ± 0.5% |
- Haiku with Herd 0.15.0 matched Sonnet. All 6 runs solved all 48 stores and all six bad inputs, at about 40% of the Sonnet leg's cost and 35% of its minutes.
-
What changed in 0.15.0: the designer writes a small case by hand before any code (the input as the request describes it, and the whole expected output). Herd freezes it at the first
herd verify, the guard denies edits to it, and every verify runs the builder's program on it and compares every line. A builder that reads the request more narrowly, or prints a coarser unit, goes red. See the release notes. - Limits: one benchmark task; 6 runs per leg (3 for Sonnet), so Welch p is 0.175 for 0.15.0 against both Haiku legs (information only); the Sonnet leg ran on Herd 0.14.14, not 0.15.0; Sonnet designs in every leg.
- Plain baseline: Haiku with no workflow is in the 0.3.1 table below (41.7 of 48, 0 of 6 runs fully valid); it was not re-run.
Per run, lost stores and adapter notes
- Lost stores. In S, M, L and XL every lost store comes from three classes: (1) the solution simulates from pick to pick instead of cell by cell, so the verifier sees a non-adjacent move (v0.14.13 run 5, all 48 stores); (2) the reported time leaves out part of the route, so the verifier's recomputation differs, plus crashes on a product the project refuses as unreachable (v0.14.13 run 6); (3) a product on a shelf whose adapter-chosen pick cell sits in a walled-off pocket, so the project refuses it as unreachable (3 M stores and 1 XL store in each of design-leg runs 3 and 5). Class 3 is a limit of the adapter's naive "first walkable neighbour" rule, not of the route logic.
- XL timeouts. None. Every XL store finished in time in every run except v0.14.13 run 6, where one store crashed (class 2) and none timed out.
- Adapter conventions. Projects that need distinct start and checkout markers get the start on the station and the checkout on its first walkable neighbour (up, down, left, right); their route then ends there and is scored without a walk back. One 0.15.0 project (batch b, run 1) reports KPIs that stop at the last pick and leave out the checkout leg, so its S time saved is higher than the others.
- Cost and time. Sonnet costs about 2 to 2.4 times the Haiku cost per run (against the design leg and 0.15.0) and takes about 2.4 to 2.8 times as many active minutes, in about 16 main-session turns against 37 to 47 for Haiku. All three Sonnet runs and all six 0.15.0 runs are valid on all 48 stores.
One short prompt, a route optimizer for picking a shopping list in a supermarket that "works for any layout, even very big ones", was given 6 times each to four arms: Claude Sonnet 5.5 and Claude Haiku 5.5, each with Herd 0.3.1 and with no workflow. Every solution was then checked by a hidden verifier it had never seen: 48 generated stores from eight layout families, up to 600 by 400 cells with 200 items, with every walk validated step by step, plus six bad-input scenarios. Two more arms, Haiku with Herd 0.12.0 and Haiku with Herd 0.12.1, were added later with 6 runs each; they were built differently (see below), so read them next to the four arms, not as more of the same kind.
Mean ± standard deviation over 6 runs per arm:
| Sonnet + Herd 0.3.1 | Sonnet, no workflow | Haiku + Herd 0.3.1 | Haiku, no workflow | Haiku + Herd 0.12.0 (real hooks) | Haiku + Herd 0.12.1 (real hooks) | |
|---|---|---|---|---|---|---|
| Stores solved with a valid route, of 48 | 48.0 ± 0.0 | 45.2 ± 4.8 | 44.3 ± 2.0 | 41.7 ± 2.7 | 46.2 ± 3.0 | 47.3 ± 1.6 |
| Runs with every store valid | 6 of 6 | 3 of 6 | 1 of 6 | 0 of 6 | 4 of 6 | 5 of 6 |
| Bad-input scenarios handled, of 6 | 6.0 ± 0.0 | 3.5 ± 0.5 | 6.0 ± 0.0 | 4.3 ± 2.0 | 6.0 ± 0.0 | 6.0 ± 0.0 |
| Time saved against list order, mid stores | 66.8 ± 1.3% | 66.7 ± 1.1% | 68.2 ± 1.8% | 66.8 ± 1.4% | 68.5 ± 1.0% | 68.6 ± 1.8% |
| Time to a finished result | 4.2 ± 1.2 min | 1.1 ± 0.2 min | 10.3 ± 5.5 min | 2.7 ± 0.9 min | 20.4 ± 10.9 min (active) | 10.2 ± 1.4 min (active) |
| Estimated cost per run, API list prices | $0.61 ± 0.09 | $0.29 ± 0.03 | $0.29 ± 0.09 | $0.04 ± 0.02 | $0.76 ± 0.26 (the session's own cost) | $0.35 ± 0.13 (the session's own cost) |
- Sonnet with Herd never failed. All 6 runs solved all 48 stores and handled all six bad inputs. Without Herd, 3 of 6 Sonnet runs lost stores (up to 12), and all six crashed on a malformed map.
- Bad input is safe with Herd on both models. All 24 Herd runs (12 on 0.3.1, 6 on 0.12.0, 6 on 0.12.1) handled 6 of 6 bad inputs; without Herd the average was 3.5 (Sonnet) and 4.3 (Haiku).
- The route itself is not better. Once a store is solved, every arm saves about the same time against list order. Herd buys robustness and evidence, not a better optimizer.
- Haiku is cheaper but not as good. Haiku with Herd 0.3.1 costs half of Sonnet with Herd and matches it on bad input, but loses 3.7 stores per run, almost all to one bug (a product picked from a sealed side of its shelf). For the same $0.29 as Sonnet without a workflow, it is safer on bad input and solves about as many stores.
- Haiku with Herd 0.12.0 solves more, at about 2.6 times the cost. It solved 46.2 of 48 stores (44.3 on 0.3.1) and had every store valid in 4 of 6 runs (1 of 6 on 0.3.1), for $0.76 per run against $0.29. The two lost runs (7 and 4 stores) came from the same sealed-side bug. It is still short of Sonnet with Herd (48.0, 6 of 6). It cost more than Sonnet with Herd 0.3.1 ($0.61), partly because the Sonnet reviewers and the longer sessions are paid for in the real setup but were absent from the emulation.
- It costs more. Herd 0.3.1 runs make about 4 times as many model requests: about 2 times the cost on Sonnet and 8 times on Haiku, and 4 times the time. Herd 0.12.0 on Haiku is about 19 times the cost of Haiku without a workflow ($0.76 against $0.04); 0.12.1 is about 9 times ($0.35 against $0.04).
The new arm was built differently. Each of its 6 runs is a real headless claude -p session on Haiku 5.5 with the plugin installed at 0.12.0 and all its hooks active (Stop gate, guard, review hook), a Sonnet 5.5 reviewer spawned by the builder, the same prompt, an empty git repository, a $10 spend cap, and nobody to answer questions. The four 0.3.1 arms were emulated sessions with no Stop hook and no reviewer. Every 0.12.0 run ended with herd done passing. Scoring is the same hidden verifier and probe, through adapters written by a model from the same spec; when a solution takes a pick cell instead of the shelf, the adapter takes the first walkable neighbour with no reachability check. Cost is the session's own reported cost at API list prices, not an estimate from a token log. Five of the six runs ran at the same time on one machine, so wall-clock times are rough; the minutes in the table are active time (below). In 21 review rounds over the six runs, 6 returned FAIL with real findings (tracebacks on malformed input, a gap to the best route caused by fixing the side, a pick-order bug at the entrance, and README and test claims that disagreed with the code), and 8 PASS rounds did not count because the reviewer had not read every changed file (0.12.1 added herd review-brief for that; these runs did not have it).
The 0.12.1 arm was run the same way: six real headless claude -p sessions, Haiku 5.5 builder, the plugin installed at 0.12.1 with all hooks, a Sonnet 5.5 reviewer, the same prompt word for word, an empty repository, a $10 cap, nobody to answer. Minutes for both versions are active API-session time: the sum of duration_ms over every result event in a run's stream log. This leaves out idle time after the result, so it replaces the rough 0.12.0 figure; it is not the same measure as the 0.3.1 minutes. It was recomputed from the logs for both versions (0.12.1: 10.0, 11.9, 9.3, 10.0, 8.2, 11.7). Review rounds, recounted from each run's notes: 10 rounds in all (2 FAIL, 8 PASS), against 21 on 0.12.0; one FAIL did not count: that round ran on Haiku, was sent the message "noop" instead of the brief and reviewed nothing. Five of six runs solved all 48 stores. Run 6 lost 4 (M random seed 0, M clusters seeds 0 and 1, XL random seed 0), which crash with UnreachableError. The program takes each product on a walkable pick cell while the request gives products on their shelves; the adapter put each product on the first walkable neighbour of its shelf with no reachability check, and in those four stores that neighbour is a sealed pocket. The program's input form was narrower than the request's and pushed a choice onto the caller. 0.12.0 run 5 lost the same four stores the same way; 0.12.0 run 2 is the other class (a shelf side chosen by order, not by reachability).
Result of 0.12.1 against 0.12.0: it halved the cost ($0.35 against $0.76) and roughly halved the active time (10.2 against 20.4 minutes), with quality not lower (47.3 against 46.2 valid stores, 5 of 6 against 4 of 6 runs fully valid). With 6 runs per arm, the gap in stores is inside one standard deviation.
Was there a data leak? Checked by inspecting the logs of all 12 real-session runs (builder and reviewer): no tool call touched the hidden verifier, the probe, the adapters, the published solutions or another run; there was no web fetch, web search or message to another session (the ListAgents tool was called in five runs and listed the names of other open sessions; none was opened or messaged); the six 0.12.1 runs recorded the same request (identical request.md hashes); the 0.12.1 source files match the 36 published solution source files at most 0.46 (difflib ratio), and only boilerplate such as a 52-character __main__.py matches higher (0.92). One weakness: at the time, the installed plugin shipped the examples/ folder (the verifier and old runs) and the runs were not sandboxed. One 0.12.1 run listed that folder's name and did not open it. Since 0.12.10 an install no longer ships examples/, and a sandboxed launcher and a log audit are in examples/supermarket-route/verifier/; neither was used for these numbers.
One task. The four 0.3.1 arms are emulated Herd sessions (no Stop hook, no reviewer) with costs estimated from each run's own token log at API list prices; the 0.12.0 and 0.12.1 arms are real sessions with hooks and a reviewer, with six runs each, one model and a different method, so they show a trend, not a like-for-like comparison. Not proven: one cohort of six runs per version; the leak check was done by log inspection, not by a sandbox; minutes are active API-session time. The method, every number, the failure analysis and these limits are in examples/supermarket-route/BENCHMARK.md. To score one run:
sh examples/supermarket-route/verifier/score_run.sh sonnet-herd-1Since 0.12.10 an install ships only plugin/, not this folder. But the repository is public and a checkout holds verifier/ (the hidden verifier) and runs/ (the published solutions), so a run that can read the disk can read both. examples/supermarket-route/verifier/run_leg.py starts every run of a leg in a sandbox that denies:
- your home folder (
~/), so a run cannot read your other projects; - every other entry in the leg's parent folder, such as earlier benchmark legs;
- every other run of the same leg, including its log and error files;
- the network (
WebFetch,WebSearch, and outbound connections from Bash).
It refuses to start if the root is inside your home folder, if the root exists, or if a copy of the hidden verifier or a probe (verify_general.py, robustness_probe.py, probe6.py) sits under /tmp, /private/tmp or $TMPDIR where a run could read it. Each run gets its own empty git repository, git config and plugin copy. The plugin copy is built with git archive of the tag's plugin/ folder when the tag has one (0.12.10 and later), or, for older tags, of the whole tree without examples/, tests/ and docs/.
python3 examples/supermarket-route/verifier/run_leg.py --name haiku-herd-v0.12.1 --runs 6 \
--model claude-haiku-5-5 --prompt examples/supermarket-route/prompt.md --herd-tag v0.12.1
Check the sandbox on your machine and Claude Code version before a leg (about one cent):
python3 examples/supermarket-route/verifier/run_leg.py --selftest
After a run finishes, audit its log:
python3 examples/supermarket-route/verifier/leak_audit.py RUN.jsonl --work <root>/run-N/work
The audit does two things. It reports what the sandbox blocked: any tool result with a <sandbox_violations> block, Operation not permitted or denied by your permission settings (a blocked attempt is still a finding), and any WebFetch or WebSearch call, in the main run and in subagents. It also proves the run used the isolation settings: it reads <root>/run-N/settings.json (or --settings FILE) and reports not isolated unless the sandbox is on, unsandboxed commands are off, and the deny rules for ~/, Read(~/**), WebFetch and WebSearch are present. It does not try to read paths from commands: shell text cannot be parsed completely. The sandbox is the guard, and --selftest shows it blocks reads on your machine.
Do not put the root directly in /tmp: every other entry of the root's parent is denied, which would include Claude Code's own scratch folder. The default root is $TMPDIR/herd-bench/<name>.
A leg's siblings are denied as they are when it starts, so start a leg only after the earlier legs in the same parent exist. --dry-run also creates the root and the run folders, so delete the root before the real start. A checkout outside your home folder is added to the deny list.
A finding marked blocked is an attempt that the sandbox refused, such as mktemp -d in the system temp folder or an access to __pycache__. It counts as clean. Only a read of the hidden verifier, of another run or of the network voids a run.
So a run's score counts when the audit prints leak audit: clean, or when every finding it lists is blocked, or is a refused network call as below. The audit still exits 1 for blocked findings, so read its lines. Two kinds of finding print as not blocked and need a look. A not isolated finding is different: it shows no read, but the sandbox is not proven to be on, so do not score the run. A network tool call finding can be a refused call: check its tool result. A refused call counts as blocked.