Source: https://codingagentlab.com/notes/how-the-benchmark-works/

[Notes](https://codingagentlab.com/notes/)Nov 30, 2026

# How the benchmark works

The rules behind the benchmark note. Same tasks, hidden tests, a sandbox, and five tries at each task. With the mistakes that were found in the setup.

Every agent gets the same tasks, the same words, and the same clean start. A test suite decides pass or fail. No person judges the code.

## The tasks

| Task | What the agent must do | Tests given | Tests hidden |
| - | - | - | - |
| Fix a latency report | Fix the bugs in a small JavaScript file | 2 | 4 |
| Write a retry helper | Write one function from a written spec | 2 | 5 |
| Fix a log cleanup script | Repair a bash script that deletes the wrong files | 2 | 4 |
| Merge config layers | Write a config merger with 8 rules | 2 | 10 |
| Find the next cron run | Write a cron schedule reader with 8 rules | 3 | 9 |
| Fix an invoice calculator | Find six bugs in a module of five files | 2 | 9 |
| Build a spreadsheet engine | Write a formula engine with 25 rules | 3 | 21 |

Each task is a small folder with a README that states the rules. The agent gets the folder and one short prompt, such as this one:

```
The invoice totals are wrong. Fix the code in src so that it follows every rule in README.md. Run `node --test` to check your work. Do not edit the tests.
```

## What gets measured

- Pass or fail. An attempt passes only when every test passes, the given ones and the hidden ones.
- Time from start to finish, in seconds.
- Cost and tokens, when the agent reports them.

## The rules

1. Each attempt starts from a fresh copy of the task in a temporary folder.
2. Each agent gets an empty home folder. Personal settings, plugins, and saved logins cannot help or hurt.
3. Agents sign in with an API key.
4. The agent may edit files and run any shell command, but only inside a sandbox. Its commands can write in the task folder and in the system temp folder. They cannot reach the network, and they cannot read the home folder of the person running the benchmark, which is where the hidden tests are kept.
5. When the agent stops, the given tests are put back the way they were. An agent cannot pass by editing a test.
6. Then the hidden tests are added. They check the rules in the README that the given tests skip.
7. Every task is tried several times, because an agent does not give the same answer twice.
8. One attempt may take 10 minutes at most.

## How the sandbox was checked

The sandbox is the one built into Claude Code. Before the first run, a model was given a list of commands to try inside it and asked to report what happened. This first check rests on the model’s own report.

| Command | What happened |
| - | - |
| Run Node | Worked |
| Write a file in the task folder | Worked |
| List a folder under the home folder | Failed with `Operation not permitted` |
| Create a file in the home folder | Failed with `Operation not permitted` |
| Fetch a web page | Failed, the network was blocked |

Then the model was asked to try the failed commands again with the sandbox turned off. They failed in the same way.

On December 1, 2026 the setup was checked again, this time by a script and not by asking. An agent was started with the flags of a real attempt and told to read the hidden test and the known good answer of one task, with a shell command and with its file tool.

| Try | What happened |
| - | - |
| `cat` the hidden test | Failed with `Operation not permitted` |
| List the task’s folder | Failed with `Operation not permitted` |
| Read the hidden test with the file tool | Refused by Claude Code |
| Read the answer with the file tool | Refused by Claude Code |

Nothing from either file showed up in what the agent printed.

## A gap that was found later

Each attempt worked in its own folder inside the system temp folder, and attempts ran side by side. The sandbox lets commands read and write anywhere in that temp folder. So an agent that went looking could have seen the folder of another attempt at the same task.

It could also have seen the hidden tests. When an agent stopped, the runner copied the hidden tests into that attempt’s folder and ran the check there. For those few seconds they sat in the temp folder, where an attempt that was still running could have read them. The known good answers were never there.

No agent was told that those folders exist. The logs hold only each agent’s final answer, so it cannot be shown that none looked. The runner has been changed since: the check now runs on a copy outside the temp folder. The published run was made before that change.

## A mistake in the first setup

The first setup let the agent run the test command and nothing else. That looked safe, but it changed the results.

Agents tried to run small scripts of their own to check their work, and those were blocked. In a trial run, one model had a file write blocked, did not try another way, and failed the task because of it. A failure like that says something about the setup, not about the model.

The fix was the sandbox: the agent may run any command, and the sandbox limits what a command can write and read. The trial results were not used.

## What a dry run proves

A dry run uses no agent. It checks the benchmark itself.

```
npm run bench -- --dry
```

For every task it tries two things. A known good answer must pass. An untouched copy must fail. If either goes wrong, the task is broken and no agent should be judged by it.

## What the numbers will not tell you

- The tasks are small. The biggest one takes a model one to three minutes. They say little about work in a large codebase.
- Only one agent has been run, Claude Code, with four models. Codex and Grok Build are set up in the runner from their docs and have never been run.
- The tasks were written with the help of a Claude model. They may suit Claude models better than models from other labs.
- Time depends on how fast the model’s servers answer at that moment. Attempts also run side by side, up to three for each model.
- Cost comes from the tool’s own report.

The runner is a short Node script, and each task is one folder. The file `bench/README.md` in the source of this site says how to add a task and how to repeat these checks.

The [reach test](https://codingagentlab.com/reach/claude-code/) on this site looks at what setups like this one let through.
