November 24, 202612 min read
Spinning up a coding agent eval on your own repo takes an afternoon. Google AI overview even does a pretty good job of explaining how to do it!
The standard recipe is more or less to mine ~30-50 merged PRs and turn them into environments: check out the parent commit, hand the agent the PR description, run the held out tests, and add an LLM judge because passing tests doesn’t mean a maintainer would merge the PR (METR found roughly half of SWE bench passing PRs wouldn’t merge).
Coding agent evals are an 80/20 problem — getting the first 80% takes 20% of the effort and feels really great. Making it trustworthy takes the remaining 80%.
I’ve been building a system that automates coding agent evals for the past few months.
My goal here is to walk through the traps that broke our own measurements, help you build evals you can trust, and convince you that getting this right is hard enough that you want to use Stet ;)
Most of the numbers below come from an early benchmark we built on Click (29 merged PRs), comparing a cheap, fast setup (GPT-6 Luna at low effort, $0.27 total) against a frontier setup (GPT-6.1 Sol at high effort, $4.38 total). Click is small, which made it easy to dissect every failure mode — and on larger, multi-package repos, these traps get worse, not better.
Here are 5 areas of unexpected complexity:
Evals are world simulation #
An eval is a simulation of reality built to help you make a decision. To get a high quality signal, the tasks, prompts, and environments need to look like the work you actually hand to agents.
If I tell the model to
Implement function `parse_pkg_version(name)` in `src/click/decorators.py` using `importlib.metadata.version()`, catching `PackageNotFoundError` and falling back to `__version__`. Add unit tests in `tests/test_options.py` covering missing distributions, mismatched import names, and empty strings.
most models, from Haiku to Fable, will probably nail it. In this world, the agent is implementing a specification.
Instead, if I ask the agent to
hey big dawg, `--version` is broken when a package's import name doesn't match its pip name. can u fix?
the agent is determining user intent, researching a bug, figuring out how to fix it, and implementing the fix, which is far closer to how engineers use agents day-to-day.
This creates a tightrope between specifying the interface contract and leaking the implementation. If the hidden tests we use for grading import a specific public function name foo or specific exported constants, these constraints must be named in the prompt, or an otherwise good solution will fail for trivial reasons. At the same time, if you over specify, and describe how to wire them up, the task can become trivially easy for agents to solve.
Our approach is for public APIs/constants, name them naturally in the initial prompt. We don’t expose private names, and if a hidden test calls a private helper, we move the test to a public entry point instead of turning the prompt back into a spec that names everything to implement.
Additionally, the size and complexity of the tasks you use should represent the capabilities you are trying to test. Mining PRs naturally biases toward easy to isolate changes. When we audited our 29 Click tasks, 22 were small changes and none touched 150 lines of production code (we have since updated the task pipeline to choose harder tasks, but this illustrates the difficulty in doing so).
You simulate the reality you want to measure. Alternatively, you can create an eval on specific parts of the codebase, eval on specific tasks (e.g. refactoring or optimization), or an eval on frontier capabilities (using harder tasks).
Environments leak and fail silently #
Agents yearn to cheat. It’s your responsibility to stop them.
The most common way is realizing that the fix for the issue is tantalizingly sitting in git commit history, available as an existing PR, or sitting in a closed ticket via your ticketing system.
This is a well-documented pattern (Cognition’s FrontierCode 1.1 saw 37.2% unfair solution source usage on one frontier model before adding guardrails, and SWE-bench+ found ~33% solution leakage), and all high quality evals should guard against this failure mode.
What makes cheating a quagmire and not just a 5 line Dockerfile fix is how it warps your results. First, cheating looks like the agent is doing great! On one task we audited, a contaminated run graded “identical to the human patch”. Second, cheating scales with reasoning effort. Higher effort / more persistent agents search harder (checking git reflogs, tags, remote PRs, or closed issues), so leakage doesn’t lift every model evenly. It silently manufactures a win for higher effort configs that “make sense” to be winners.
To block this, you must set up the environment as it would have been at the start of the task: cut off git history and refs after the parent commit, snapshot Jira/Linear to the same cutoff if agents have access, preinstall deps in setup, run the agent behind a provider-only relay (blocking web/PR/commit lookups while letting model traffic through), and finally audit tool traces after the fact to find cheating.
Another crucial part of environment hygiene is handling silent infrastructure failures. Even in a sealed, warm container, dependency installs may flake, sandboxes time out, and API rate limits hit on turn 1. Historically, roughly a third of our candidate attempts failed on infrastructure or setup rather than the agent itself (we are driving this down). If your grading instrument scores an empty or timed out run as 0, an infra failure looks identical to a model failure.
In practice, you need to snapshot and reuse verified environments (reusing 2 Click snapshots across 29 tasks cut median verification time from ~15 minutes to ~20 seconds) and classify every non-pass so infra and quota losses get rerun (and fixed) instead of being scored as failures by the agent.
Testing is hard #
Human (or even agent) written unit tests pin incidental implementation choices, and static LLM review can’t tell a good test from an overly restrictive one.
A valid test must fail on the repo before the “gold” (original) change, and succeed after the change (fail-to-pass, or F2P, as pioneered by SWE-bench). Even then, the tests are written with a specific implementation in mind. A good eval will have tests that allow for agent creativity in solving the problem.
Tests can be wrong in both directions. On our 29 Click PRs, we found 7 runs where the held-out tests failed an agent’s patch even though our LLM reviewers passed it. Three turned out to be real regressions the reviewers missed (like --help exiting with code 2).
The other four failures were the result of overly picky tests pinning unstated details, such as exact error wording. On one task, we were moving to relax a picky error message test assertion. However, running both agents’ patches against real packages outside the test suite resulted in both returning the wrong version (8.7.6 instead of 2.3.4) and crashing where the human PR succeeded. The failing assertion had been complaining about error message prose, while hiding a very real behavioral bug the test suite didn’t cover.
When we asked an automated LLM reviewer to screen those Click tasks for bad tests, it flagged 17 of the 18 tasks another blind audit confirmed were completely fair, while missing half the real test defects.
Because static LLM review can’t reliably separate a picky test from a real behavioral assertion, we verify tests by execution. Prove that every test fails on the parent commit and passes on the merged patch, and when a reasonable patch disagrees with a test, run a quick behavioral check against both the human patch and the agent patch outside the test suite before blaming or relaxing the test.
A trap here is that peeking at agent patches while fixing tests to be more fair overfits the eval. Keep test authoring blind to agent patches, mark individual unfair cases so they don’t count (without dropping the file), and use outside behavioral checks executed on both patches as an audit step for disputed verdicts.
Note on reward hacking: In writing evals, as opposed to RL training, reward hacking of bad tests is much less of an issue. During RL, a 1% loophole gets gradient amplified into policy collapse because the weights update on it. In a well isolated eval with held-out grading tests, the model weights never update and the agent can’t optimize directly against the hidden tests. Occasional reward hacking is still bad, of course, but the much bigger day to day risk in evals is accidental misalignment from overly strict or under-specified tests.
Static diff review isn’t execution #
Because tests miss nuance around how real engineers use and maintain code, many evals turn to LLM judges to evaluate patches in less deterministic ways, such as asking if the code is maintainable, or if it is equivalent in intent to the original patch.
However, one-shot LLM judges struggle to trace edge cases from a static diff, and neither their self-reported confidence nor the strictness of their prompt correlates cleanly with accuracy.
On a Click PR, both models wrote the exact same bracket bug, turning [a|b]! into [[a|b]!]. At low reasoning effort, our equivalence judge called the broken patch equivalent to the human PR in 3 of 4 draws at 0.99 confidence. At medium effort it was still wrong at 0.98. Only high reasoning effort caught the bug. (On another batch, dropping judge effort from high to low flipped 4 of 18 verdicts in the same direction.)
Tightening the prompt doesn’t automatically fix it either. Across 14 Click patches we knew by execution were broken, a requirement checklist judge still marked 5 as meeting every essential requirement (and 3 of those 5 had also passed the hidden unit tests). When we tightened the prompt to force tracing edge cases and compatibility paths, false passes went up from 5 of 14 to 6 of 14. Faros AI saw a similar style bias in their effort halo study, where an LLM judge scored a model solving 16% of tasks above one solving 33% because its failed patches looked thorough.
The takeaway here is to not trust judges by themselves. Treat the judge (model, prompt, and reasoning effort) as a measurement instrument, calibrate its error rate, and deploy it according to its measured performance, not its self-reported confidence.
Your scoreboard invents winners #
Taking an information theory view of evals — our goal is to maximize the bits of real signal we get out of every task, without mistaking noise for signal.
An eval acts as a noisy channel trying to answer one question: is Setup B actually better than Setup A on my repo? Most tasks we mine naively are either too easy or too hard for current models. If we compress each task down to binary test pass/fail, we get at most 1 bit of information per task, and 0 bits whenever both setups pass or both fail.
On our 29 Click PRs looking at tests alone, 22 tasks told us nothing about which model was better (13 both passed, 5 both failed, 4 unresolved). The entire 29-task benchmark came down to 7 deciding tasks, which the frontier setup won 7–0.
Worse, small samples actively hallucinate winners out of run-to-run noise. Before comparing two setups, compare one setup against itself (an A/A test). When we ran the exact same configuration twice across 24 tasks, checking results partway through at 16 tasks reported an 89.8% probability that one identical run was better than the other. Across simulations, false-winner rates ran 11.3% at 5 tasks and still sat at 6.1% at 24 tasks.
Finally, collapsing cost and quality into a single ratio (“cost per successful task”) rewards the model that gives up fastest. On our 24 task benchmark on our own repo, the cheap Luna low setup ranked #1 on cost per success ($0.26) while losing 0–13 head-to-head, because on hard multi-file tasks it quit in under four minutes for a few cents (details).
Handling this takes two moves that have to work together:
- Don’t over read the bits you have. Pair results by task (counting head to head wins on the tasks that actually disagree, rather than comparing unpaired averages), run an A/A test first so you know your noise floor, keep cost and quality on separate axes, and treat an underpowered tie as*“can’t tell”* . However, a tie that says a patch is no worse within a stated margin, that’s backed by calibrated judges, is an actionable result.
- Carefully extract more signal per task. Binary pass/fail throws away real differences when one model fails 1 edge case test and the other fails 40, or when both pass tests but one leaves behind an unmergeable diff. Vectorizing test output (per test vectors instead of a single boolean) and layering calibrated LLM judges can recover finer grained signal.
Finer granularity in signal is only more information if it correlates with the truth. Adding a noisy, uncalibrated LLM judge increases entropy (more spread in your scores), not mutual information (actual signal about which patch is better).
Conclusion #
Building a basic benchmark is relatively easy.
The hard part is building a benchmark that is calibrated, reliable, and representative of how agents actually work in your codebase.
Synthesizing learnings from above, here’s a checklist you can use going forward to raise the quality of coding agent evals you make:
- Ensure tasks are representative and fair. 1. Compare task size/type to the changes you actually make.
- Specify the interface contract hidden tests import without leaking the implementation.
- Snapshot envs and block history. 1. Reuse verified environments so observation stays fast.
- Catch and rerun infra/quota losses instead of scoring
0. - Aggressively block git/web/ticket lookups of the answer and audit traces.
- Verify tests by execution. 1. Prove tests fail on parent and pass with the solution.
- Run behavioral checks outside the suite before relaxing a disputed test; use LLMs in tandem with execution, not as a replacement.
- Calibrate LLM judges. 1. Pin judge model, prompt, and reasoning effort across every arm you compare.
- Don’t trust judges’ self-stated confidence — calibrate against execution-verified bad patches and factor that error rate into your decision.
- Pair results, run A/A, and extract calibrated signal. 1. Count head-to-head wins per task on disagreements, and keep cost separate from quality.
- Run A/A tests to know your noise floor, and only add finer-grained grading dimensions whose accuracy you’ve measured.
Running the coding agents is the cheapest and easiest part: on the 29 Click PRs, running both models e2e cost $4.65 total ($0.27 + $4.38). Everything else (building clean tasks, maintaining sandbox snapshots, verifying disputed tests by execution, calibrating judges on known-bad patches, and running A/A checks) costs an order of magnitude more time, money, and engineering discipline. And validity isn’t a one-time setup; it changes every time a new model, harness, or judge drops.
That’s the layer we’re building Stet to run for you. Point it at your repo and the change you’re weighing (switching to a cheaper model, tuning reasoning effort, editing AGENTS.md, evaluating whether skills are helpful) and get evidence-backed recommendations.
If you’re facing one of those calls right now, bring a repo and the question.
FAQ #
How do I build a coding agent eval on my own repo?
Mine 30-50 merged PRs, check out each parent commit, give the agent the PR's request, and grade with held-out tests that fail on the parent and pass on the merged patch, plus an LLM judge. To make it trustworthy, cut git history and ticket access at the parent commit, rerun infra failures instead of scoring them 0, calibrate the judge on known-bad patches, run an A/A test, and pair results per task.
Why aren't pass/fail tests enough to compare coding agents?
Binary tests give at most 1 bit per task and 0 when both setups pass or both fail. On 29 Click PRs, 22 tasks told nothing about which model was better; the comparison came down to 7 deciding tasks. Tests also err both ways: of 7 runs where hidden tests failed a patch reviewers passed, 3 were real regressions and 4 were overly picky tests.
How do coding agents cheat on evals?
They find the human fix in git history, refs, open PRs or closed tickets. Cognition's FrontierCode 1.1 saw 37.2% unfair solution source usage on one frontier model before guardrails, and higher-effort agents search harder, so leakage manufactures wins for them. Cut history after the parent commit, snapshot tickets to the same cutoff, run the agent behind a provider-only relay and audit tool traces.
Can I trust an LLM judge to grade coding agent patches?
Not by itself. On a Click PR with a bracket bug, a low-effort equivalence judge called the broken patch equivalent in 3 of 4 draws at 0.99 confidence. A checklist judge passed 5 of 14 patches known broken by execution, and a stricter prompt raised that to 6 of 14. Calibrate the judge's error rate against execution and pin model, prompt and effort.
How many tasks does a coding agent eval need?
Enough to beat your noise floor, which an A/A test measures. Running one configuration against itself, false-winner rates were 11.3% at 5 tasks and 6.1% at 24 tasks, and a check at 16 tasks reported an 89.8% probability that one identical run was better. Treat an underpowered tie as "can't tell".