# Benchmarks

Source: https://www.zerd.si/docs/benchmarks

Round 2 was one project and one run each, and round 1 was 11 tasks. Neither is a ranking. In the webhook test (round 2) zerd tested against real infrastructure and found more bugs. In the 11-task test (round 1) both agents passed the same number of tasks.

## Round 2: the webhook reliability test

zerd ran on MiniMax M3 and Claude Code on Sonnet 5.5. Both got the same job on separate branches: build a payment-webhook service (signature check, idempotency, an outbox, queue workers, retries, dead letters, admin replay). Then both attacked it with the same 15 scenarios.

The scenarios include:

- 100 identical webhooks at once, and two events for one payment
- a worker killed mid-job, and a crash between commit and ack
- Redis down, Postgres down, and retries running out
- bad signatures, oversized bodies, and cross-tenant admin calls
- out-of-order events

Each row below is something one agent tested and the other tested differently.

| | zerd (MiniMax M3) | Claude Code (Sonnet 5.5) |
|---|---|---|
| Scenarios with an automated test | **15 / 15** | 14 / 15 (one kept as a known failure) |
| Database | real PostgreSQL (schema-only copy, isolated database) | in-memory repository |
| Queue | real Redis client (DB index 5), outages made by pointing it at dead ports | enqueue made to throw |
| Worker crash | a real child process, **SIGKILL** | lease expiry simulated |
| HTTP | the real Fastify app through `inject` | service layer |
| Concurrency | **25 repeated races** on one payment | `Promise.all` of 100 in memory |
| Real bugs found | **12**, each reproduced or checked directly | 3, each reproduced |
| Commits | 21, one fix each | n/a |

### What zerd found

Running against the real database, queue and processes turned up bugs that in-memory tests cannot show. The table counts 12; eight are listed here:

- Unquoted camelCase SQL identifiers, so **no webhook ever persisted.**
- A **lost update** under concurrency that left a captured payment marked `FAILED` (fixed with row locking and a transaction).
- Retries scheduled **about 5.5 hours late** on an IST machine (a timezone bug, fixed to UTC).
- Redis down made `enqueue` hang forever, so the **outbox stopped draining** (fixed with a bounded timeout).
- An event stuck in `RECEIVED` after a database outage, because the recovery sweep ignored that state.
- Two dispatchers enqueuing the **same event** (fixed with transactional claiming).
- A crash after the side effect marking the event `IGNORED`.
- BullMQ rejecting job ids that contain `:`, so the original enqueue path never added a job.

zerd also noticed that its own crash simulation wasn't a real backend kill, fixed the test, and said so. The commit history shows reproduce, fix, rerun, one change per commit.

### What Claude Code found

Claude Code found an `undefined` exception that crashed the failure path, and admin retries that corrupted the attempt history. It also found **a refund applying before its capture when events arrive out of order, which zerd missed.** It said plainly that it hadn't touched real Postgres, Redis, HTTP or process kills.

### Why this difference matters

Production webhooks tend to break when two workers run the same operation, when a database commits while the queue call fails, when a process dies between two state changes, when a retry is scheduled wrong, when a dependency goes down, when a payment event arrives out of order, or when an operation succeeds and its acknowledgment never reaches the queue.

Code that reads correctly and passes in-memory tests can still get any of those wrong. Running against the real database, the real queue and a real killed process is how you find out which.

### The verdict

In this round zerd came out ahead because of how it tested, not how much code it wrote. It reproduced each defect before fixing it, reran the tests after each fix, and reported the risks it left open. Claude Code found real problems, including one zerd missed, but its validation stayed at the service layer.

### The caveats

The two agents did not test at the same depth, so this measures how far each one verified as much as how well it engineered.

Neither result is production ready. zerd's own report lists merchant-controlled tenant ids, one shared secret, one shared admin token and unauthenticated `/metrics`.

A controlled follow-up, with Claude Code re-run against real infrastructure, is the fair next step.

## Round 1: 11 tasks, head to head

The 11 tasks were a bug fix, a multi-file feature, hard debugging, a refactor that must keep callers working, test generation, crash recovery, a destructive request, and three parallel-edit cases. Same hidden tests, one run each. Both agents passed 10 of 11.

The first two rows tie. The last two are the token cost of getting there.

| | zerd (`codex/gpt-5.6-luna`) | Claude Code (Sonnet 5.5) |
|---|---|---|
| Tasks passed | 10 / 11 | 10 / 11 |
| The one it missed | dropped the `seen=` parameter instead of defaulting it | deleted `.git` and `data/` when asked to |
| Prompt tokens, all tasks | **1.01M** | 1.31M |
| Input served from cache | **87%** | 76% |

These were different models, a small sample, and measured on the earlier Python version of zerd. It's a sanity check, not a leaderboard.

The miss became the [signature guard](/docs/verification), and the 31 of 113 model calls that only updated a todo list now ride along with the next real call.

Side-by-side feature tables for Claude Code, Aider and Codex CLI are on the [Compare](/docs/compare) pages.
