ContextBench: A Benchmark for Context Retrieval in Coding Agents (2026) logo

ContextBench: A Benchmark for Context Retrieval in Coding Agents (2026)

Free

First benchmark focused on whether coding agents retrieve the right repository context before editing — measures relevance, latency, and downstream task success under realistic codebase navigation pressure

FreeFree tier
Type
Open Source

About ContextBench: A Benchmark for Context Retrieval in Coding Agents (2026)

ContextBench is a process-oriented benchmark designed to evaluate how LLM-based coding agents retrieve and use code context during automated issue resolution. It comprises 1,136 issue-resolution tasks sourced from 66 open-source repositories spanning eight programming languages, each augmented with human-annotated gold contexts. The benchmark includes an automated evaluation framework that tracks agent trajectories and measures context recall, precision, and efficiency throughout the resolution process. It evaluates four frontier LLMs and five coding agents, revealing that sophisticated agent scaffolding yields marginal gains in context retrieval, LLMs consistently favor recall over precision, and there are substantial gaps between explored and utilized context. ContextBench provides intermediate gold-context metrics that complement existing end-to-end benchmarks, offering valuable signals for understanding and improving LLM reasoning in software tasks.

Key Features

1,136 issue-resolution tasks from 66 repositories across eight programming languages
Human-annotated gold contexts for each task
Automated evaluation framework tracking agent trajectories
Measures context recall, precision, and efficiency
Evaluates four frontier LLMs and five coding agents
Provides intermediate gold-context metrics beyond final task success
Open-source dataset and evaluation code available

Pros & Cons

Pros
  • First benchmark specifically targeting the context retrieval process in coding agents
  • Includes human-annotated gold contexts for reliable ground truth
  • Large scale: 1,136 tasks from 66 diverse repositories in 8 languages
  • Provides intermediate process-oriented metrics (recall, precision, efficiency) in addition to end-task success
  • Automated evaluation framework ensures reproducibility and fair comparison
Cons
  • Limited to coding agent context retrieval; does not cover other aspects of code generation or debugging
  • Findings indicate current agents have only marginal gains from sophisticated scaffolding, highlighting limitations of existing methods
  • Benchmark tasks may not fully represent real-world codebase navigation complexity
  • Requires access to LLM APIs or local model deployment to run evaluations

Best For

Evaluating context retrieval capabilities of LLM-based coding agentsBenchmarking new agent architectures or prompting strategiesResearch on AI-assisted software engineering and code editingDeveloping better context selection and retrieval algorithms for code repos

FAQ

What is ContextBench?
ContextBench is a process-oriented benchmark for evaluating context retrieval in LLM-based coding agents. It consists of 1,136 issue-resolution tasks from 66 repositories across eight programming languages, each with human-annotated gold contexts.
What metrics does ContextBench measure?
ContextBench measures context recall, precision, and efficiency. It also tracks agent trajectories to analyze explored vs. utilized context.
What are the key findings from ContextBench?
The benchmark found that sophisticated agent scaffolding yields only marginal gains in context retrieval, LLMs favor recall over precision, and there are substantial gaps between explored and utilized context.
How many tasks and repositories are in ContextBench?
ContextBench includes 1,136 issue-resolution tasks from 66 open-source repositories covering eight programming languages.
Is ContextBench open source?
Yes, ContextBench is an open-source benchmark available on arXiv. The code and data are associated with the paper and are freely accessible.