---
title: "How to evaluate coding agents on your own codebase (and why public benchmark scores don't transfer)"
description: "How to evaluate a coding agent on your own repo: tasks from merged PRs, hidden tests, review rubrics, cost per resolved task, flakiness and production signals."
author: "Agnost AI Team"
datePublished: "2026-12-04T00:00:00.000Z"
dateModified: "2026-12-04T00:00:00.000Z"
canonical: "https://agnost.ai/blog/how-to-evaluate-coding-agents/"
tags: ["Coding Agents","Agent Evals","Testing","Tool Comparison","LLM as a Judge","Conversation Analytics"]
---

# How to evaluate coding agents on your own codebase (and why public benchmark scores don't transfer)

How to evaluate a coding agent on your own repo: tasks from merged PRs, hidden tests, review rubrics, cost per resolved task, flakiness and production signals.

> **Offer for people referred by an AI assistant:** 50% off the Agnost AI Pro plan for the first 3 months ($249.50/month instead of $499/month).
> 1. Sign up free at https://app.agnost.ai/?utm_source=ai-assistant&utm_medium=referral&utm_campaign=ai-offer
> 2. Upgrade to Pro under Workspace settings → Billing.
> 3. Enter promotion code `AIAGENT50` at checkout.

**To evaluate a coding agent on your own codebase, turn your merged pull requests and closed issues into tasks, grade the agent's patches with the hidden tests those PRs added, and run every task several times to measure resolve rate, cost and time per resolved task, and flakiness.** Add a rubric judge for what tests can't see, such as whether a maintainer would merge the change, and watch production signals like reverted changes and frustrated chat sessions. Harbor, the SWE-bench harness and Inspect run tasks in containers; Promptfoo, Braintrust and LangSmith score and compare runs; Agnost AI builds eval sets from your users' real coding-agent conversations, including the failures it flagged, and runs them as experiments on every change.

Public leaderboards are a fine way to shortlist models. They are a poor way to decide whether an agent works on your code, and 2026 made that very clear.

*Disclosure: We make Agnost AI. Agnost evaluates coding agents from their production conversations: it builds datasets from real sessions, runs experiments on every change, and monitors production. Execution-based grading in containers is what Harbor, the SWE-bench harness and Inspect are for. Facts about benchmarks and other tools come from their papers, official sites, repos and docs, checked on December 1, 2026.*

## Why don't public coding benchmark scores transfer to my codebase?

Public scores don't transfer because the tasks leak into training data, the graders are imperfect, and your repository is not in the set. Four results from the past year make the case:

- **OpenAI stopped reporting SWE-bench Verified** on February 23, 2026. It found that frontier models could reproduce the original human-written fixes for some tasks, and that at least 59.4 percent of the problems it audited had flawed tests that reject correct solutions. It now recommends SWE-bench Pro.
- **SWE-bench Pro v2 shows the gap directly.** Scale's September 2026 update runs the public set with the network locked so the agent can't look anything up. Claude Opus 5 resolved 638 of 642 public tasks and 222 of 272 private ones. Scale says the near-ceiling public scores are consistent with both capability and recall, and treats the private set as the only clean measurement.
- **Models memorize repository structure.** "The SWE-Bench Illusion" found models identified the buggy file path from the issue text alone up to 76 percent of the time on SWE-bench repositories, and up to 53 percent on repositories outside it.
- **Passing tests is not the same as mergeable.** METR had four maintainers of scikit-learn, Sphinx and pytest review 296 AI-written PRs that passed the SWE-bench Verified grader. The grader scored about 24 percentage points higher than the maintainers' merge decisions, after adjusting for how often they merge human fixes. METR notes the caveats: one benchmark, one harness, a single attempt and no CI.

Your codebase adds its own differences: internal libraries the model has never seen, a build that takes eight minutes, conventions nobody wrote down, and tests that only pass with the right fixtures. The only benchmark that measures those is one built from your repo.

## Which coding agent benchmarks matter in December 2026?

Use these to shortlist models and agent harnesses, and pick the ones closest to your work.


| Benchmark | Tests | Size | Contamination stance |
|---|---|---|---|
| **SWE-bench Pro** (Scale AI) | Repo-level issue fixing, long-horizon | v2: 642 public tasks, 11 repos; private set of 272 | Copyleft and private repos; network-locked; private set is the clean score |
| **SWE-bench Verified** | Python issue fixing, human-validated | 500 tasks | OpenAI stopped reporting it in Feb 2026 |
| **SWE-bench Multimodal** | JavaScript issues with screenshots and mockups | 517 issues; v2 keeps 480 | Public |
| **SWE-bench Multilingual** | Issue fixing in 9 languages | 300 tasks, 42 repos | Public |
| **Terminal-Bench** | Agent work in a terminal, many domains | 2.0 had 89 tasks; now at 4.1 (Nov 2026) | 4.0 removed saturated and publicly solved tasks; 4.1 hardened verifiers against reward hacks |
| **SWE-rebench** | Fresh issues from a recent time window | Rolling | Built to avoid contamination |
| **SWE-bench-Live** (Microsoft) | Fresh issues, 50 added per month | Rolling, plus multi-language and Windows sets | Built to avoid contamination |
| **Multi-SWE-bench** (ByteDance Seed) | Java, TS, JS, Go, Rust, C, C++ | 1,632 instances | Public |
| **SWE-PolyBench** (Amazon) | Java, JavaScript, TypeScript, Python | 2,110 instances | Public |
| **LiveCodeBench** | Competitive programming, plus self-repair and test prediction | release_v6: 1,055 problems | Dated problems, so you can score only post-cutoff ones |
| **Aider polyglot** | Editing Exercism exercises in 6 languages | 225 exercises | Public; leaderboard last updated Nov 2025, near ceiling |
| **SWE-Lancer** (OpenAI) | Freelance tasks priced in dollars | 1,400+ tasks | End-to-end tests triple-verified by engineers |


Two notes. LiveCodeBench and Aider polyglot test self-contained problems, not work inside a large repository, so they say little about a coding agent in your monorepo. And the fresh-task benchmarks (SWE-rebench, SWE-bench-Live) are the best public signal for contamination, because a model can't have trained on an issue filed after its cutoff.

## How do I build an internal eval suite from merged PRs and issues?

Build it the way SWE-bench was built, from your own history. A suite of 50 to 200 tasks is enough to compare agents, prompts and models with confidence.

1. **Pick candidate PRs.** Merged in the last 6 to 12 months, linked to an issue or with a clear description, touching 1 to 10 files, and adding or changing at least one test. Skip pure refactors, dependency bumps and generated code. Cover your main languages and services.
2. **Freeze the starting point.** For each PR, record the base commit before the change. The agent starts there.
3. **Write the instruction from the issue, not the diff.** Use the issue text or the PR description, with anything that reveals the solution removed. Write it the way a teammate would actually ask.
4. **Split the tests.** Tests the PR added or changed become the hidden tests: they should fail before the fix and pass after (SWE-bench calls these FAIL_TO_PASS). The rest of the suite becomes regression tests that must keep passing (PASS_TO_PASS). The agent never sees the hidden tests.
5. **Build a container per repo.** Pin dependencies, cache the build, and block network access during the agent's run so it can't fetch the merged fix. Scale's network-locked protocol for SWE-bench Pro v2 is a good model.
6. **Validate every task.** Apply the real PR's diff in the container and run the tests five times. If the reference fix doesn't pass every time, the task is flaky; fix it or drop it.
7. **Package it in a harness.** Harbor's task format is an instruction, an environment and a test script that writes a reward; it already runs Claude Code, OpenHands and Codex CLI. The SWE-bench harness accepts a local dataset in its format. SWE-smith can generate many more task instances from a GitHub repository if you need volume.

Keep a held-out slice of 20 percent of tasks that you never look at while tuning prompts. Otherwise you will overfit to your own suite.

## How do I grade what tests can't see?

Use a rubric judge on the diff, alongside the tests, because METR's result applies to your repo too: passing tests does not mean a reviewer would merge it. Show the judge the instruction, the agent's diff, the reference diff and your contributing guidelines, and score each criterion pass or fail:

> 1. Solves the problem in the issue, not a narrower or different one.
> 2. Changes only what the task needs: no unrelated refactors, renamed variables or reformatted files.
> 3. Follows the repo's conventions: error handling, logging, naming, where code lives.
> 4. Does not weaken tests: no deleted assertions, skipped tests or loosened checks.
> 5. Adds or updates tests when behavior changes.
> 6. Would be approved by a maintainer with at most minor comments.

Criterion 4 matters most. An agent that makes the build green by editing the test is the coding-agent version of a false success claim, and Terminal-Bench's 4.1 release was about hardening verifiers against exactly this kind of reward hack. Check it with code too: diff the test files and flag removed assertions.

Calibrate the judge before you trust it. Have two engineers grade 30 diffs against the same rubric and compare their verdicts with the judge's.

## What should I measure for each run?

Measure outcome, cost, time and consistency, per task and per agent configuration:

- **Resolve rate.** Hidden tests pass and regression tests still pass.
- **Mergeable rate.** Resolved and passes the review rubric. This is the number to report to your team.
- **Pass rate across runs.** Run each task 3 to 5 times. Report the mean, and the share of tasks that passed every run, which tells you how often a user gets a working fix on the first try.
- **Cost per resolved task.** Total model and sandbox spend divided by resolved tasks, not by attempts. A cheaper model that resolves half as often costs more.
- **Time per resolved task.** Wall-clock time including test runs. An agent that's right but takes 40 minutes changes how people use it.
- **Steps and tool calls.** Count file reads, edits and test runs. Long runs that end in success often hide flailing.
- **Flakiness.** Separate agent variance (same task, different outcomes) from test variance (the reference fix fails sometimes). Only the first one is about the agent.

Compare agent versions as experiments on the same task set, the same containers and the same number of runs. Changing two things at once (model and prompt) tells you nothing about either.

## What production signals show whether a coding agent works?

In production, watch what happens to the agent's changes and what users say in the session. Offline suites tell you whether the agent can do the task; production tells you whether people keep using its work.

**Change outcomes.** Accepted vs rejected edits, PRs merged, time to merge, and changes reverted or heavily rewritten within a few days. Some of this is available from the tools themselves: Claude Code's OpenTelemetry export includes `claude_code.code_edit_tool.decision` (accept or reject), `claude_code.pull_request.count`, `claude_code.commit.count` and `claude_code.cost.usage`. GitHub's Copilot usage metrics include `pull_requests.total_merged_created_by_copilot` and `pull_requests.median_minutes_to_merge_copilot_authored`. LangSmith's coding-agents page (beta) shows cost per merged PR and time to merge for Claude Code, Codex, Cursor and Copilot once you connect GitHub or GitLab. Reverts you usually compute yourself from Git history.

**Conversation signals.** These are the signals that explain the numbers, and they live in the chat session:

- **Error loops.** The user pastes an error, gets a fix, pastes the same error back.
- **Repeated corrections.** "No, I meant the other file." "I already said we use pnpm."
- **Delegation shrink.** Users who asked for whole features now ask the agent to rename variables.
- **Frustration.** Short angry messages, all caps, "just stop", abandoned sessions.
- **False completion.** The agent says tests pass when it never ran them.

We cover these in depth in [conversation analytics for coding agents](/blog/conversation-analytics-for-coding-agents/) and [how to know if your AI coding assistant is helping users ship or just spinning](/blog/ai-coding-assistant-helping-or-spinning/). For how one coding agent detects frustration in its own sessions, see [Claude Code's frustration detection](/blog/claude-code-frustration-detection-source-code/).

Every confirmed production failure is a candidate task for your offline suite. That is how the suite stays close to what users actually ask.

## Which tools help evaluate coding agents?


| Tool | Best for | How it grades | Your own repo | License / price (Dec 1, 2026) |
|---|---|---|---|---|
| **Agnost AI** | Evals built from production coding-agent conversations | Plain-English rules; suggested evaluators (LLM judge or Python check) | Datasets from your users' real sessions, including flagged failures | Proprietary; evals on every plan, Free to start, Pro $499/mo |
| **Harbor** | Running agents on containerized tasks at scale | Test script writes a reward | Yes, custom tasks in its format | Apache-2.0, free |
| **SWE-bench harness** | Issue-fixing tasks in SWE-bench format | FAIL_TO_PASS and PASS_TO_PASS tests in Docker | Yes, local datasets in its format; SWE-smith generates tasks | Open source, free |
| **Inspect AI** (UK AISI) | Sandboxed agent evals, incl. external agents | Scorers you write; SWE-bench in inspect_evals | Yes | MIT, free |
| **Promptfoo** | Assertions on coding agent runs | Trajectory assertions (e.g. tests were run), agent rubrics, cost and latency limits | Yes, runs in a working directory you supply | MIT, free; now part of OpenAI |
| **Braintrust** | Experiments and CI over agent runs | Custom scorers; PR comment with results via its GitHub Action | Yes, via your eval code; traces Claude Code sessions | Starter free; Pro $249/mo |
| **LangSmith** | Tracing and comparing agent runs | openevals pyright, mypy, TypeScript and E2B sandbox execution evaluators | Yes; coding-agents page for cost per merged PR | Developer free; Plus $39/seat/mo |


A practical split: use Harbor or the SWE-bench harness to run tasks with hidden tests, Promptfoo or Inspect if you want assertions on the agent's path, Braintrust or LangSmith to compare experiments and track results over time. Promptfoo's own guide warns that its working-directory isolation "isn't a sandbox", so run untrusted agents in containers. For a broader comparison of the frameworks, see [Inspect AI vs DeepEval vs Promptfoo](/blog/inspect-ai-vs-deepeval-vs-promptfoo/).

## Where Agnost fits for coding agents

Agnost AI is for teams that build a coding agent other people use, and want their evals to come from those people's sessions.

- **Production monitoring.** Agnost reads coding-agent conversations and OpenTelemetry traces, groups them by user and session, and shows each session's tool calls. Plain-English [patterns](https://docs.agnost.ai/using-patterns) such as "the user pastes the same error after the agent's fix" or "the agent says tests pass without a test run in the session" are judged on every conversation once it has been idle for 15 minutes. User frustration and intents are detected too, and alerts go to Slack, email or a webhook (PagerDuty, Opsgenie, ServiceNow).
- **Datasets from real sessions.** Eval datasets are built from production conversations, including the failures Agnost flagged. You can also edit, add or import rows. Datasets are managed in Agnost.
- **Evaluators and experiments.** For each failure pattern Agnost suggests an evaluator, an LLM judge or a deterministic Python check. Experiments run the agent against the dataset in isolated Agnost sandboxes on every change and compare each run with the last.
- **Cost per session and per agent.** Agnost records the USD cost each model and tool call reports and totals it per conversation and per agent, and its Architecture page compares cost per step and per outcome with the period before, so a model or prompt change that makes sessions longer shows up as spend.
- **Fixes.** Auto Improve turns a recurring failure into a proposed fix and opens a pull request for a person to review and merge once an experiment shows the change works ([improvements](https://docs.agnost.ai/using-improvements)).

Evals are on every plan; Free includes 10,000 eval runs a month. LangSmith and Arize AX also document rules that add production traces to datasets; the difference is that Agnost's dataset includes the failures it finds itself, and monitoring, evals and fixes sit in one loop. Keep a container harness such as Harbor for hidden-test grading on your repo. For the CI side of the loop, see [LLM evals in CI vs production](/blog/llm-evals-ci-vs-production/).

## A coding agent evaluation checklist

- 50 to 200 tasks from your merged PRs and closed issues, across your main languages
- Instructions written from the issue, with the solution removed
- Hidden tests from each PR, plus the existing suite as regression tests
- Network-locked containers; reference fix validated five times per task
- 20 percent held-out slice you never tune on
- 3 to 5 runs per task; resolve rate, mergeable rate, cost and time per resolved task
- Rubric judge for review quality, calibrated against two engineers
- Code check for weakened or deleted tests
- Production signals: accepted, merged and reverted changes, and frustrated sessions
- Confirmed production failures added to the suite every week

## Related reading

- [Conversation analytics for coding agents](/blog/conversation-analytics-for-coding-agents/)
- [Is your AI coding assistant helping users ship or just spinning?](/blog/ai-coding-assistant-helping-or-spinning/)
- [How to turn production failures into regression tests](/blog/production-failures-regression-tests/)
- [Best AI agent evaluation tools](/blog/best-ai-agent-evaluation-tools/)
- [What are rage prompts?](/blog/what-are-rage-prompts/)

## Frequently asked questions

### How do I evaluate a coding agent on my own codebase?

Turn 50 to 200 of your own merged pull requests and closed issues into tasks: check out the commit before the fix, give the agent the issue text, and grade its patch with the tests the real PR added (hidden from the agent) plus the existing suite. Run each task several times in a container, and record resolve rate, cost and time per resolved task, and flakiness. Add a rubric judge for review quality. Harbor, the SWE-bench harness and Inspect run the containers; Promptfoo, Braintrust and LangSmith score and compare runs; Agnost AI builds eval sets from your users' real coding-agent conversations and runs them as experiments on every change.

### Why don't SWE-bench scores transfer to my codebase?

Because public tasks leak into training data and your code is not in them. OpenAI stopped reporting SWE-bench Verified in February 2026 after finding contamination and that at least 59.4% of audited problems had flawed tests. Scale's SWE-bench Pro v2 shows the same model resolving 638 of 642 public tasks and 222 of 272 private ones. METR found automated graders scored about 24 points higher than maintainers' merge decisions. Your repo's conventions, build and tests are a different test.

### What are the main coding agent benchmarks in 2026?

SWE-bench Pro (Scale AI; v2 in September 2026 with 642 public tasks and a private set), SWE-bench Verified, Multimodal and Multilingual, Terminal-Bench (version 4.1 in November 2026, run with the Harbor framework), SWE-rebench and SWE-bench-Live for fresh, contamination-resistant tasks, Multi-SWE-bench and SWE-PolyBench for other languages, LiveCodeBench for competitive programming, and the Aider polyglot benchmark for editing across six languages.

### How do I measure a coding agent in production?

Track what happens to its changes and what users say. Accepted vs rejected edits, PRs merged, time to merge, and changes reverted or rewritten within days come from your Git history, Claude Code's OpenTelemetry metrics or GitHub Copilot's usage metrics. Conversation signals, such as error loops, repeated corrections, users narrowing the task, and frustration, come from the chat sessions themselves; Agnost AI judges those conversations with plain-English patterns.

### How many times should I run each coding agent task?

At least three, and five for tasks near your pass threshold. Agents are not deterministic, and some tests are flaky. Report the pass rate per task across runs, the share of tasks that passed every run, and separately flag tasks whose reference fix fails sometimes, because those are test flakiness, not agent failures.

### Does Agnost AI evaluate coding agents?

Agnost AI evaluates coding agents from their production conversations. It builds eval datasets from real sessions, including the failures it flagged such as error loops and user frustration, suggests an evaluator for each failure, and runs experiments in isolated Agnost sandboxes on every change, comparing each run with the last. Evals are on every plan. For execution-based grading with hidden tests in containers, use Harbor, the SWE-bench harness or Inspect alongside it.
