ContextBench

A benchmark for context retrieval in coding agents.

Tasks
1,136
Repos
66
Languages
8

Leaderboard

Results updated

Submit result

Agent–model combinations, including mini SWE-agent baselines. Agents use ContextBench-specific adaptations.

Systems
15
Best Pass@1
60.4%
Best context F1
0.376
Sort by

Sorted by Recall, high to low. 15 matching results.

Agent + modelRecall ↓

Showing 15 of 15 systems · Higher Recall is better.

— Not reported · Equal scores share a rank

Evaluation notes & result history

Dataset totals above describe ContextBench as a whole. Run-specific task coverage, dataset revisions, and configurations are available with submission artifacts when provided; historical entries may not include them.

Rank numbers reflect performance on the selected metric. Reversing the display order or searching does not change those ranks. Recall and Context F1 use line-level retrieval scores on a 0–1 scale; Pass@1 is shown as a percentage and costs are in USD.

Key Findings

01

Echoing "The Bitter Lesson": More scaffolding does not mean better context retrieval.

02

Even frontier LLMs struggle to retrieve precise code context.

03

LLMs favor recall over precision, introducing substantial noise.

04

Balanced retrieval achieves higher accuracy at lower cost.

05

Retrieved context is often not used in final solutions.

Abstract

LLM-based coding agents have shown strong performance on automated issue resolution benchmarks, yet existing evaluations largely focus on final task success, providing limited insight into how agents retrieve and use code context during problem solving.

We introduce ContextBench, a process-oriented evaluation of context retrieval in coding agents. ContextBench consists of 1,136 issue-resolution tasks from 66 repositories across eight programming languages, each augmented with human-annotated gold contexts. We further implement an automated evaluation framework that tracks agent trajectories and measures context recall, precision, and efficiency throughout issue resolution.

Using ContextBench, we evaluate four frontier LLMs and five coding agents. Our results show that sophisticated agent scaffolding yields only marginal gains in context retrieval ("The Bitter Lesson" of coding agents), LLMs consistently favor recall over precision, and substantial gaps exist between explored and utilized context. ContextBench augments existing end-to-end benchmarks with intermediate gold-context metrics that unbox the issue-resolution process, offering valuable signals for guiding LLM reasoning in software tasks.

Construction Pipeline

An overview of the ContextBench construction pipeline. ContextBench is curated through three key steps: Task Deduplication, Task Selection, and Expert Annotation.

Construction Pipeline

1Task Deduplication

Removes exact and near-duplicate tasks from multiple issue resolution benchmarks using rule-based and embedding-based detection.

2Task Selection

Identifies challenging tasks based on agent solvability and the scope and dispersion of edits in ground-truth patches.

3Expert Annotation

Employs expert developers to trace code dependencies to construct gold contexts, validated through LLM-based patch generation.

Dataset Statistics

A repository-level benchmark spanning 8 programming languages and introducing human-verified gold contexts to expose intermediate context retrieval signals missing from final task resolution rate evaluation.

Language#Repo#Task#File#Block#Line
Python205121,5206,714115,122
Java6572623,03049,057
JavaScript91538193,94987,907
TypeScript81195371,10640,621
Go71046793,00071,596
Rust9632721,84250,402
C3682501,59162,300
C++4602091,88445,110
Total661,1364,54823,116522,115