RepoNav: From Snippet Retrieval to File-Centered Repository Navigation for Code Agents

Hongzheng Chai, Jiakun Li, Hongyue Yu, Yuan Yuan


Abstract
Solving repository-level code tasks requires LLM-based agents to use code search tools to navigate large codebases and identify a small set of relevant files and functions. However, current retrieval tools typically return flat lists of isolated code snippets: such lists can surface relevant files, but provide insufficient structure for agents to distinguish the target function from semantically similar alternatives in the same file. We introduce RepoNav, a lightweight post-retrieval interface that reorganizes retrieved snippets into a file-centered navigation scaffold. By presenting compact structural cues and candidate targets, this scaffold guides on-demand file-structure browsing, helping agents compare sibling symbols before selecting a target function. Across diverse models on LocBench, RepoNav improves function-level localization and narrows the file-to-function gap. Controlled ablations demonstrate that these gains come from structured evidence organization rather than simply exposing additional file structure, and the approach also improves performance on a repository-level question-answering benchmark.
Anthology ID:
2026.emnlp-main.1474
Volume:
Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
EMNLP
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
33711–33726
Language:
URL:
https://aclanthology.org/2026.emnlp-main.1474/
DOI:
Bibkey:
Cite (ACL):
Hongzheng Chai, Jiakun Li, Hongyue Yu, and Yuan Yuan. 2026. RepoNav: From Snippet Retrieval to File-Centered Repository Navigation for Code Agents. In Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing, pages 33711–33726, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
RepoNav: From Snippet Retrieval to File-Centered Repository Navigation for Code Agents (Chai et al., EMNLP 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.emnlp-main.1474.pdf