Code / Context
verifiedRepository Context
The function you are writing depends on types defined in another file, a helper three directories away, and a convention nobody wrote down but every file follows. A model shown only the current file is missing most of what it needs, and the difference between a completion that compiles and one that invents a plausible-looking method is usually somewhere else in the repository.
Nobody fits a repository into a context window, so the work is selection: which files to pull in, and in what order. Retrieval by textual similarity is the baseline and is beaten by anything that uses structure — imports, call graph, the file the cursor's symbol is defined in. Repository-level benchmarks exist because file-level ones were saturating while the tools were still visibly failing at the thing people used them for.
The share of a repository that fits in context falls as the repository grows and the window does not, and repositories grow faster. A medium project is already millions of tokens against a window of hundreds of thousands, so the fraction visible at once is a few percent and shrinking — which means selection quality, not window size, is what a completion depends on. Doubling the window moves a few percent to a few more percent.
excluded-tokens holds 38% of the budget; rest holds the remaining 62%.
Repository tokens that will not fit in the context window, against the ones that will, in tens of thousands. Drag the repository size up to watch almost all of it fall outside — which is why what gets selected matters more than how large the window is.
Reviewed by opendroid · 2026-08-18
- arXiv:2306.03091 — RepoBench: Benchmarking Repository-Level Code Auto-Completion Systems
- arXiv:2305.06161 — StarCoder: may the source be with you!