SWE-bench Verified & Terminal-Bench v2: A Realistic Benchmark Field Guide

By Meng Guoying (mengg) · Review method · Corrections

Benchmarking · 6 min read · Updated November 2026

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.

TL;DR Verdict & Boundary: Use SWE-bench Verified as a coarse capability filter, not a deployment guarantee. In our 5-task Python repo micro-run, Gemini 3.8 Flash solved 4/5 tasks for $0.22 while Claude Fable 5.1 solved 5/5 for $1.80—a two-stage cascade captures both cost efficiency and ceiling accuracy.

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:

2. SWE-bench Verified Architecture & Methodology

How SWE-bench Verified Grades Autonomous Coding Patches 1. Issue + Repo Snapshot Frozen Docker Container 2. Agent Harness Loop Bash + File Edit + Search 3. Hidden Test Patch FAIL_TO_PASS + PASS_TO_PASS 4. Binary Verdict Resolved vs Unresolved Critical Note: Scores depend heavily on the scaffold (retry limits, bash timeout, grep tools), not just raw model weights.
Figure 1: SWE-bench Verified execution sandbox showing why harness configuration affects final pass rates.

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
ModelWhich immutable snapshot was used?Quoting a moving aliasProvider, ID, date
HarnessWhich tools, prompt, retries, and budget?Attributing system score to model aloneCode, config, traces
DatasetWhich revision and exclusions?Mixing Verified, Lite, and other variantsDataset hash
ScorePass@1, best-of-N, or selected run?Ignoring variance and failed setupRuns 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:

5. Common Failures & Mitigation Strategies

When running agents on SWE-bench, common failure patterns include:

  1. Context Overflow / Infinite Loops: Agent reads hundreds of files without producing edits. Fixed via AST chunking and search indexing.
  2. Regression Bugs: Agent fixes the target bug but breaks existing functionality. Fixed by enforcing a pre-commit pytest verification run before submitting patches.
  3. Environment Pollution: Modifying global Python packages inside Docker. Fixed via isolated virtualenvs or ephemeral container resets.

6. Build an Internal Coding-Agent Evaluation

  1. Select representative historical tasks you are permitted to use and pin each repository state.
  2. Write executable acceptance tests plus explicit forbidden changes.
  3. Run every candidate in a fresh isolated environment with fixed network and resource policy.
  4. Record tool trajectory, patch, test output, model and harness versions, tokens, cost, latency, and stop reason.
  5. Repeat enough runs to expose variance and inspect every safety or regression failure.
  6. 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:

ModelTasks Passed (of 5)Total Input / CachedTotal OutputFailed RetriesTotal Suite Bill
Claude Fable 5.15 / 5310K (74% cached)18.4K2$1.80
GPT-6 Astra5 / 5342K (68% cached)21.1K3$2.31
Claude Sonnet 54 / 5295K (72% cached)16.9K4$0.36
Gemini 3.8 Flash4 / 5380K (61% cached)24.5K6$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

8. Interactive Tools & Benchmarking Resources

To compare live model costs and benchmark scores, explore our interactive utilities:

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.

Written & Verified by Meng Guoying

Independent AI systems engineer building production agent loops, local vLLM/Ollama clusters, and cost-controlled LLM pipelines. Every token rate and benchmark on this page is cross-checked against provider documentation.

Report Error / Feedback → Discuss on GitHub ↗