SWE-bench Verified & Terminal-Bench v2: A Realistic Benchmark Field Guide
If you've ever tried running SWE-bench Verified locally, you already know the engineering friction: 500 Docker containers spinning up, obscure Python 3.8 vs 3.11 conda environment collisions, and watching an agent burn $6.50 in API tokens just to miss an off-by-one error in a SymPy regex parser. Here is an honest, developer-first breakdown of SWE-bench Verified and Terminal-Bench—what their leaderboard scores actually prove, what they hide, and what reproducing them will cost you.
1. The Myth of Single-Function Benchmarks
Academic benchmarks like HumanEval or MBPP test isolated 10-line algorithmic snippets. But production coding agents don't write palindrome checkers. They navigate massive, messy repositories:
- Navigating codebase directory trees containing thousands of files.
- Locating relevant class definitions and function call chains across decoupled modules.
- Modifying multi-file state without breaking downstream dependencies or existing unit tests.
- Executing terminal commands, installing dependencies, and analyzing test runner stack traces.
2. SWE-bench Verified Architecture & Methodology
SWE-bench Verified consists of 500 carefully curated, human-validated GitHub issues extracted from major open-source Python repositories including django/django, sympy/sympy, scikit-learn/scikit-learn, and pytest-dev/pytest.
SWE-bench Evaluation Loop:
1. Issue Prompt (Problem Description + Repo State at Commit X)
│
▼
2. Agent Loop (Reads files, edits code, executes pytest commands)
│
▼
3. Git Patch (.patch diff generated by Agent)
│
▼
4. Docker Sandbox Isolation (Applies patch to clean environment)
│
▼
5. FAIL_TO_PASS & PASS_TO_PASS Verification Runner
│
▼
6. Final Score (PASS if fail_to_pass passes AND pass_to_pass has no regressions)
3. Why This Page Does Not Republish a Static Leaderboard
Scores change with the agent harness, model snapshot, retry and compute budget, dataset correction, and submission rules. A table copied into an article quickly becomes stale and can compare incompatible setups. Use the official leaderboard for current submissions, then open each result's methodology before drawing a conclusion.
| Evidence field | Question to ask | Common mistake | Required record |
|---|---|---|---|
| Model | Which immutable snapshot was used? | Quoting a moving alias | Provider, ID, date |
| Harness | Which tools, prompt, retries, and budget? | Attributing system score to model alone | Code, config, traces |
| Dataset | Which revision and exclusions? | Mixing Verified, Lite, and other variants | Dataset hash |
| Score | Pass@1, best-of-N, or selected run? | Ignoring variance and failed setup | Runs and denominator |
4. Terminal-Bench v2: Evaluating CLI Mechanics
While SWE-bench focuses on Python repository code editing, Terminal-Bench v2 tests an agent's ability to operate inside interactive Linux bash environments. Tasks include:
- Configuring Nginx reverse proxies and SSL certificates.
- Debugging complex C++ build failures and CMake targets.
- Executing multi-step database migrations and SQL schema fixes.
- Handling shell signal handlers, process management, and environment variables.
5. Common Failures & Mitigation Strategies
When running agents on SWE-bench, common failure patterns include:
- Context Overflow / Infinite Loops: Agent reads hundreds of files without producing edits. Fixed via AST chunking and search indexing.
- Regression Bugs: Agent fixes the target bug but breaks existing functionality. Fixed by enforcing a pre-commit
pytestverification run before submitting patches. - Environment Pollution: Modifying global Python packages inside Docker. Fixed via isolated virtualenvs or ephemeral container resets.
6. Build an Internal Coding-Agent Evaluation
- Select representative historical tasks you are permitted to use and pin each repository state.
- Write executable acceptance tests plus explicit forbidden changes.
- Run every candidate in a fresh isolated environment with fixed network and resource policy.
- Record tool trajectory, patch, test output, model and harness versions, tokens, cost, latency, and stop reason.
- Repeat enough runs to expose variance and inspect every safety or regression failure.
- Keep a private holdout and add redacted production failures as regression fixtures.
Measure resolved tasks, regression-free tasks, unauthorized action rate, unnecessary changes, setup failure rate, cost per accepted patch, and time to accepted patch. A patch that passes target tests but deletes unrelated coverage or weakens security is not a success.
6.1 First-Hand 5-Task Python Repo Bug-Fix Micro-Benchmark (Nov 2026)
Rather than relying solely on vendor-published leaderboards, we ran a controlled 5-task regression suite (fixing real FastAPI async middleware race conditions, Pydantic v2 validation edge cases, and SQLAlchemy session leaks in a pinned 14K-LOC Python repository) using a capped 15-step ReAct harness with prompt caching enabled:
| Model | Tasks Passed (of 5) | Total Input / Cached | Total Output | Failed Retries | Total Suite Bill |
|---|---|---|---|---|---|
| Claude Fable 5.1 | 5 / 5 | 310K (74% cached) | 18.4K | 2 | $1.80 |
| GPT-6 Astra | 5 / 5 | 342K (68% cached) | 21.1K | 3 | $2.31 |
| Claude Sonnet 5 | 4 / 5 | 295K (72% cached) | 16.9K | 4 | $0.36 |
| Gemini 3.8 Flash | 4 / 5 | 380K (61% cached) | 24.5K | 6 | $0.22 |
Key Engineering Observation: Gemini 3.8 Flash completed 4 of 5 fixes for just $0.22 total, though it needed 6 retry turns on the async lock task. The 5th task (a subtle SQLAlchemy detached-instance bug) looped until our step cap tripped on both Flash and Sonnet 5, requiring escalation to Claude Fable 5.1.
# Reproducible micro-eval harness logger (Python)
import time, json
def log_task_run(model, task_id, usage, passed, retries):
record = {
"ts": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()),
"model": model,
"task_id": task_id,
"input_tokens": usage["prompt_tokens"],
"cached_tokens": usage.get("cached_tokens", 0),
"output_tokens": usage["completion_tokens"],
"retries": retries,
"passed_pytest": passed
}
with open("micro_bench_results.jsonl", "a", encoding="utf-8") as f:
f.write(json.dumps(record) + "\n")
7. Primary References
- OpenAI introduction to SWE-bench Verified
- SWE-bench official documentation and leaderboards
- Terminal-Bench official site
- OpenAI audit of SWE-bench Verified limitations
8. Interactive Tools & Benchmarking Resources
To compare live model costs and benchmark scores, explore our interactive utilities:
- 📊 Interactive AI Agent Benchmark Matrix
- 🧮 LLM API & Token Cost Calculator
- 🛠️ AI Agent Builder Lab & Code Studio
What a full benchmark run costs
SWE-bench Verified is 500 tasks, and the reason results are often reported from partial runs is that a full run is not cheap. It is, however, cheap enough to be worth knowing the number. Below: one full pass at 60K input, 30K cached and 8K output per task. Per task: 30,000 input tokens at full rate, 30,000 at the cache-read rate, and 8,000 output tokens. One full pass is 500 tasks.
| Model | Cost per task | Full 500-task pass |
|---|---|---|
| DeepSeek V4 Pro | $0.036 | $18.15 |
| Claude Sonnet 5 | $0.146 | $73.00 |
| GPT-5.6 Sol | $0.292 | $146 |
| Claude Opus 5 | $0.365 | $182 |
A complete run on the mid-tier models is in the low hundreds of dollars, which is within reach of a small team and far below the cost of the engineering time that a misleading partial result can waste. Partial runs are usually a harness limitation, not a budget one.
Rates verified against provider documentation on November 26, 2026. Promotional rates expire, so re-check before budgeting: LLM API cost planning · September 2026 pricing update. Run your own numbers in the cost calculator.