TL;DR
SWE-Explore is a new benchmark that isolates and evaluates how effectively AI coding agents navigate and locate relevant code within large repositories. By shifting from a binary pass/fail end-to-end metric to a line-level, budget-constrained retrieval task, it reveals that line-level recall—finding the exact lines of code needed for a fix rather than just the right file—remains the primary bottleneck for state-of-the-art agents.
What Problem Does This Paper Address?
Traditional repository-level benchmarks like SWE-bench evaluate coding agents on a purely binary outcome: did they successfully generate a patch that passes the test suite? While useful, this holistic approach conflates several distinct capabilities: repository exploration, bug localization, patch synthesis, and validation. If an agent fails, it is impossible to tell whether it couldn't find the right code or simply couldn't write the correct fix.
Real-world repositories contain thousands of files, making precise code localization a daunting task. Existing localization benchmarks often evaluate performance at the coarse file or function level, which hides whether an agent actually found the specific lines carrying the evidence for a bug. SWE-Explore addresses this gap by isolating repository exploration as a standalone, line-level evaluation target.
Methods
The authors formalize repository exploration as a ranked, line-level context selection task. Given an issue description and a repository snapshot, an explorer must output a ranked list of code regions (file paths and line ranges) under a strict line budget (e.g., 500 lines).
To build a reliable ground truth without massive manual annotation costs, the authors introduce trajectory-grounded supervision. They collect the actual file-reading actions from multiple independent, successful agent runs that solved the issue. They intersect these trajectories to find the "core" code regions consistently relied upon, refine them using an LLM to catch model-specific but critical reads, and perform a final manual audit.
To evaluate explorers, SWE-Explore uses a comprehensive suite of metrics:
- Coverage & Accuracy: Line-level Precision, Recall, and F1, alongside file-level and region-level hit rates.
- Ranking under Budget: An adaptation of normalized Discounted Cumulative Gain (nDCG@B) tailored to a line budget rather than a rank cutoff, and First Useful Hit (FUH).
- Context Efficiency: The fraction of predicted lines that fall within the ground-truth core or optional context.
Crucially, the authors validate these metrics via a "downstream repair bridge": they feed the explorer's output context into a fixed, standard patching agent to verify that higher exploration scores directly translate to higher issue resolution rates.
Datasets
SWE-Explore is constructed from three major public repository-level benchmarks: SWE-bench Verified, SWE-bench-Pro, and SWE-bench Multilingual. After filtering for instances with at least two successful agent trajectories, the final dataset contains 848 instances spanning 10 programming languages and 203 open-source repositories.
Key Insights and Ideas
- The Line-Level Recall Bottleneck: While modern coding agents are excellent at finding the right file (often achieving >60% file hit rates), their line-level recall is surprisingly low (typically 14–19%). They get to the right neighborhood but miss the exact lines needed for the fix.
- Agentic Search Beats Classical Retrieval: Interactive, multi-step agentic explorers form a clear tier above classical retrieval methods like BM25, TF-IDF, or standard RAG pipelines, proving that repository exploration requires dynamic interaction rather than single-shot search.
- Context Efficiency is King: The metric that correlates most strongly with downstream patch success is Context Efficiency ($r = 0.950$). Providing a compact, highly relevant context is far more effective than dumping massive amounts of semi-relevant code into the LLM's window.
- The Threshold Effect: Patcher agents exhibit a threshold-like behavior. They don't smoothly improve with every line of code added; instead, they need a critical mass of core evidence to successfully synthesize a fix. Once that threshold is met, they are highly tolerant of redundant or noisy context.
Key Results
- Oracle vs. Baselines: An Oracle explorer achieves a 59.7% downstream resolve rate, whereas random sampling yields only 4.7%. Classical retrievers like TF-IDF (26.0%) and BM25 (12.7%) lag far behind.
- Agent Performance: General-purpose agents like Claude Code (48.0%), Mini-SWE-Agent (50.0%), and OpenHands (47.7%) achieve highly competitive downstream resolve rates and show remarkably similar exploration profiles (high file hit, high early ranking, but low line recall).
- Specialized Localizers: CoSIL, an academic agent utilizing iterative code-graph search, achieved the highest line-level recall (0.788) and F1 score (0.602) among non-oracle methods, highlighting the value of structured repository graph exploration.
Limitations and Future Work
- Selection Bias: Because SWE-Explore requires at least two successful agent trajectories to establish ground truth, it only covers issues that current state-of-the-art models can already solve. It does not reflect the distribution of entirely unsolved, ultra-hard repository issues.
- Empirical Ground Truth: Trajectory-derived context is an empirical approximation of what worked, not a mathematical proof that no other valid solution path exists.
- Future Directions: The authors suggest that future work should focus on developing better exploration mechanisms that improve line-level recall without sacrificing precision, potentially leveraging iterative graph- or structure-aware search strategies.
Summary updated