How to Benchmark AI Coding Agents on Your Codebase

A DIY methodology for testing AI coding agents against your own repo in an afternoon, using real tasks, a fixed rubric, and time-to-working-code as the deciding metric.

Carlo Zuercher
Carlo Zuercher
Staff Engineer, Platform
10 August 20261 min read

To benchmark AI coding agents on your own codebase, skip the public leaderboards and build a small, repeatable test yourself: pick three to five tasks that look like your actual backlog, score each agent against a fixed rubric, run every agent cold on the same tasks, and time how long it takes to get from zero to working code. This takes an afternoon, not a research budget, and it tells you something a leaderboard never will, how an agent performs on your dependencies, your file layout, and your team's actual patterns.

Why public leaderboards don't answer your question

Public benchmarks test agents against curated tasks in curated repos, then publish a score. That's useful for tracking broad capability trends and useless for predicting how an agent will handle your two-hundred-thousand-line Rails app or your five-year-old Django project with three half-finished migrations sitting in it. Vendors optimize for the benchmarks that get published, so scores can drift away from real-world usefulness even as they climb. Before you trust a number on a chart, it helps to know how to read vendor benchmark claims skeptically, because a leaderboard win says nothing about your build tooling, your test suite, or your naming conventions.

None of this makes public benchmarks worthless. They're a reasonable first filter across the broader landscape of AI coding tools, useful for narrowing a long list down to a handful worth testing yourself. But a filter is not a decision. The only benchmark that predicts how an agent will perform on your next ticket is one that runs on your own code.

The DIY methodology, four steps

A repo-specific benchmark doesn't need statistical rigor. It needs consistency: the same tasks, the same rubric, the same starting conditions, run against every agent you're considering.

Step 1: Pick 3 to 5 representative tasks from your own repo

Skip toy problems. Pull real tickets from your backlog, ones a competent contractor could finish in under an hour. Aim for a spread:

  • A bug fix in an unfamiliar file, something with an obscure stack trace and no obvious cause.

  • A small feature addition that touches two or three files and has to match existing conventions.

  • A refactor with no visible behavior change, the kind that's easy to break silently.

  • A task that requires reading and following your existing test suite, not just writing new code.

  • Optionally, a task that touches your build or CI config, since that's where agents often improvise badly.

Five tasks is plenty. Three is enough if you're short on time. Past five, you'll spend the afternoon running the benchmark instead of using the answer.

Step 2: Build a fixed scoring rubric before you start

Write the rubric before you see any output, not after, or you'll unconsciously score toward whichever tool you already like. A simple numeric scale per criterion beats open-ended notes because it forces a decision instead of a vibe.

Criterion

Score 0

Score 1

Score 2

Score 3

Correctness

Fails to run

Runs but wrong output

Mostly correct, minor bugs

Fully correct

Convention match

Ignores existing patterns

Follows a few conventions

Mostly matches house style

Indistinguishable from a teammate's PR

Test coverage

No tests added

Tests added but wrong or skipped

Tests added and pass, but thin

Tests added, pass, and cover edge cases

Explanation quality

None given

Vague

Clear but incomplete

Clear, and cites the actual changed files

Sum the columns for a total score per attempt, then track a separate, non-rubric number: minutes to first passing test or working build.

Step 3: Run each agent cold, on identical starting conditions

Reset the branch between agents. Same base commit, same intent in the prompt (wording can adapt to each tool's interface, but the ask should be identical), same context you'd hand a new contributor on day one. Don't coach one agent through follow-up prompts while leaving another to fail silently. That's the single most common way DIY benchmarks get contaminated.

This is also where interface matters more than people expect, how the interface changes the comparison between a terminal agent that greps its way through your repo from scratch and an IDE-embedded agent that already has your file tree and open buffers loaded. Keep it fair by giving each agent the same access, not more or less context than the others.

Step 4: Track time to working code, not just pass or fail

Pass or fail hides the real cost. An agent that produces correct code after four rounds of back-and-forth clarification isn't actually faster than one that takes longer per attempt but nails it in one pass. Start a timer when you send the task, stop it when the code passes your test suite, or when you give up, and record that as a data point too. Log four things: time to first attempt, number of prompts or corrections needed, time to final working code, and whether you had to finish it yourself.

This single number, minutes to working code, is usually more decision-relevant than the rubric score. A tool that scores a 9 out of 12 but takes six minutes beats a 12 out of 12 that takes forty.

Where this matters most: task type and interface

Not every agent behaves the same way across the different jobs you throw at it. A chat-based assistant that hands you a diff to paste in behaves differently from an editor extension that autocompletes as you type, and where pair-programming agents differ from autocomplete is exactly the gap a fixed task list exposes. Run your bug-fix task through both styles and the difference usually shows up fast: one drafts a full patch, the other nudges you toward it line by line.

If you're a team of one, weight the rubric differently. Speed and low babysitting cost matter more than perfect convention matching, which is part of our take on the best agent for solo developers versus one built for a five-person team enforcing a style guide.

Running the benchmark in an afternoon

Block three to four hours. Thirty minutes to select tasks and lock the rubric. Then roughly 20 to 30 minutes per agent per task, which is generous, since most of the signal shows up in the first ten minutes of an attempt. Score immediately after each run while the details are fresh. Scoring retroactively at the end of the day is where rubrics quietly get rewritten to match a gut feeling.

Keep a shared spreadsheet with columns for agent, task, rubric score, time to working code, and a one-line note on what went wrong. Don't average across wildly different task types. A 3 out of 3 on the bug fix and a 3 out of 3 on the CI config task aren't interchangeable data points, and hiding that behind a single blended score erases the exact information you set out to gather.

What to do with the results

A repo-specific benchmark from one afternoon won't hold up for a year. Agents update, your codebase changes, and today's winner can regress after the next model release. Re-run the same task set quarterly, or whenever you're about to make a purchasing decision that locks you in for months. Keep the task list itself as a durable asset. It's more valuable long-term than any single result, since it lets you re-test cheaply every time a new agent claims to be worth switching to.

Questions people ask

How many tasks do I need to benchmark an AI coding agent?

Three to five is enough for a decision-useful signal, provided the tasks are varied: at least one bug fix, one feature addition, and one refactor or test-writing task. More tasks add confidence slowly and cost time quickly.

How long does it take to benchmark AI coding agents properly?

Budget half a day for three to five agents against three to five tasks. Most of that time goes to scoring immediately after each run, not to the runs themselves.

Should I use the exact same prompt for every agent?

Use the same intent and the same information, not necessarily identical wording. Different agents expect different prompt styles, and forcing identical text can make the comparison less fair, not more.

Do public AI coding benchmarks matter at all?

They're a reasonable first filter for narrowing a long list of tools down to a handful worth testing yourself. They're a poor substitute for testing against your own repo, since none of them run on your dependencies, your conventions, or your test suite.

What's a good score to switch AI coding agents over?

There's no universal threshold. Compare the challenger's time-to-working-code and rubric score against your current tool's baseline on the same tasks. A meaningful, repeatable gap across most tasks is worth switching for. A one-task edge probably isn't.

How did this land?

About the author

Carlo Zuercher
Carlo Zuercher

Staff Engineer, Platform

Carlo works on the platform that turns prompts into running apps. He writes the engineering deep dives and the changelog notes worth reading.

Share

Get the next post in your inbox

One email a month. Product updates, engineering posts, and the best of Built with Swarmz.

I agree to receive emails about AI building tips and Swarmz product news. Unsubscribe any time.