Manuscript Offprint

arXiv:2610.21073

Skip the Compressor: Coding Agents Fix More Issues When They Pick Whole Files

Xiaocong Yang, Rishit Chatterjee, Himanshu Udupi, Vikram Ramavarapu, ChengXiang Zhai

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

A coding agent works on repositories that can be far larger than its context window can hold. Prompt compressors and retrievers offer solutions to this problem, but patching an issue needs two things at once: the files that must change, and their code exactly as written, since the model must reproduce the lines it edits. Retrievers rank code by its similarity to the issue rather than by whether it must change, and compressors delete text to fit the budget. We show that at an equal token budget, an agent resolves more issues when the budget goes to choosing which files to show verbatim, as our simple selector CQ2-CARE does, than when it goes to pruning tokens or retrieving chunks. We fit every context to the same per-issue budget on 300 recent SWE-rebench issues and grade each patch with the benchmark's tests. With GPT-5.6 and Claude Opus 5, CQ2-CARE resolves 43.7% and 46.7% of the issues, 6.3 points more than the best of three compressors with either model, and 9.3 and 12.7 points more than the best of three retrievers. CQ2-CARE even resolves more issues than two methods trained for issue resolution, SweRank (by 0.7 and 1.7 points) and SWE-Pruner (by 2.0 and 7.3). Our analysis shows the defects of the baseline methods: retrievers often miss the files to edit, and compressors keep them but alter their text, so fewer patches apply. Exact-file selection needs no compression model and shows every line as the repository has it, so the model can quote the code it edits.

1 Introduction

Agents based on Large Language Models (LLMs) now resolve real software issues end to end: they read an issue, explore a repository and write a patch that the project's tests accept (Jimenez et al., 2024; Yang et al., 2024; Wang et al., 2025; Xia et al., 2025). Managing what enters their context already makes them cheaper: it can halve an agent's cost (Lindenbauer et al., 2025) or cut it by a fifth to a third (Xiao et al., 2026). Every prompt token is paid for on every call, and models use information in the middle of a long input less reliably than at its ends (Liu et al., 2024).

Yet every step still needs code in the prompt, and a coding agent’s context window is small next to the repositories it works on: SWE-bench code-bases average 3,010 non-test files and 438K lines (Jimenez et al., 2024). We therefore treat the repository as the agent’s memory and the prompt as a compressed view of it, one that leaves most of the code out. To resolve an issue, the view still has to keep two things: the files the fix must edit, and their text exactly as it is. For anyone building a coding agent, this raises a practical question: at a fixed token budget, which compression of the repository lets the model resolve the most issues?

Three lines of work each study part of this question: prompt compression for long natural-language prompts (Jiang et al., 2023; Pan et al., 2024), retrieval of repository code for code completion and issue resolution (Zhang et al., 2023; Jimenez et al., 2024), and issue-resolution systems that prune what an agent reads (Wang et al., 2026) or compress the context around known fault locations (Jia et al., 2026). Figure 1 shows how the first two can fail on one issue from our study, a report that some error messages lack the f of an f-string. A chunk retriever fills the budget with the repository's issue templates, which share the report's wording, and never shows the file to edit. A token pruner keeps that file but deletes f prefixes and quotation marks, so the model's patch rewrites a line that does not exist and fails to apply. Shown the file whole and verbatim, the same model writes the fix. None of these lines of work compares retrieval, token pruning and file selection at a matched budget per issue, with each method free to decide which files enter the context.

∗^{*}Equal contribution.

Input

Context m(∣m∣≤Bi)m(|m| \leq B_i) and the patch ρ\rho written from it

Issue q

Some f-strings

are missing

the f

Repository R

twine, 83 files

File to edit

twine/sdist.py

Budget BiB_{i}

1,229 tokens

Chunk retrieval: BM25

ρ=0.0%\rho = 0.0\% ε=100.0%\varepsilon = 100.0\%

X does not apply

m .github/ISSUE_TEMPLATE/02_bug.yml lines 61-120

.github/ISSUE_TEMPLATE/01_upload_failed.yml lines 1-60

p @ -70,3 +70,3 @@ class SDist:

Token pruning: LLMLingua-2

ρ=100.0%\rho = 100.0\% ε=0.5%\varepsilon = 0.5\%

X does not apply

m 23 ...InvalidDistribution(f"Unsupported sdist format: {filename}")

43 "Too many top-level members in sdist archive: {self.filename}"

p - ...InvalidDistribution("Unknown sdist format: {filename}")

Exact-file selection: CQ2-CARE (ours)

ρ=100.0%\rho = 100.0\% ε=100.0%\varepsilon = 100.0\%

✓ resolved

m 23 ...InvalidDistribution(f"Unsupported sdist format: {filename}")

43 "Too many top-level members in sdist archive: {self.filename}"

p + f"Too many top-level members in sdist archive: {self.filename}"

Resolved (%), 300 issues

Figure

Figure 1: An issue sample under different compression methods. The issue (pypa__twine-1225) reports error messages that lack the f of an f-string; the gold patch edits twine/sdist.py. ρ\rho: gold-file recall, the share of the gold-patch files in the context mm; ε\varepsilon: the share of mm's lines that are verbatim. BM25 fills BiB_i with issue templates (two of three spans shown), so its patch guesses lines it never saw; LLMLingua-2 deletes tokens (struck out), among them the f of line 23, so its patch rewrites a line that does not exist; ours shows the file verbatim. Indentation is trimmed; an ellipsis marks an elided prefix. Chosen for illustration as the smallest of the 4 such issues out of 300 (a random one is in Appendix A). Right: resolution with GPT-5.6 (solid) and Claude Opus 5 (light), every context fitted to BiB_i. SWE-Pruner, a line pruner trained for coding agents, is the last bar of the pruning group, and SweRank, a trained retriever of whole functions, the last bar of the retrieval group.

Both failures follow from how these tools work. Retrievers rank chunks or files by their similarity to the issue (Robertson and Zaragoza, 2009; Jimenez et al., 2024; Suresh et al., 2025), so text that echoes the report can outrank the file to edit. Prompt compressors delete the tokens or code blocks that a small model scores as least useful (Jiang et al., 2023, 2024; Pan et al., 2024; Shi et al., 2025); this costs little when the output is an answer or a summary, but an edit must quote the code it changes exactly (Xia et al., 2025; Anthropic, 2024; Gauthier, 2026).

The remedy follows: spend the budget on choosing which files to show, and show them whole and verbatim, so that edits quote text that exists and no compression model runs in the loop. Since each chosen file is shown whole, the selector must name few files, and the right ones. We therefore build a simple selector, CQ2-CARE, that asks the model under test twice, independently, which files must change and keeps the files both answers name, taking agreement between samples as a sign of reliability (Wang et al., 2023); it then adds the short spans that grep finds for definitions, callers or strings the model requests, so code the fix depends on is shown verbatim even outside the chosen files. Its strength is its choice of unit, not its sampling scheme: a single answer cut to the same number of files does about as well, so what matters is choosing few files well ( §4.4§4.4).

We test this remedy in a controlled comparison on 300 issues from the SWE-rebench leaderboard (Badertdinov et al., 2025), one per repository: a fixed model receives the issue and one context fitted to the size of the CQ2-CARE context for that issue, writes one patch, and the benchmark's harness grades it with the issue's tests. We describe each context by its gold-file recall, the share of the files to edit that it contains, and by the share of its lines that are verbatim, and we run controlled tests that change one of the two at a time.

With each of two model families, the selector resolves more issues than each of three compressors and three retrievers, among them SWE-bench's file-level BM25; with Claude, its lead over one compressor, LLMLingua-2, is narrow. The losses separate cleanly: retrievers keep the text verbatim but often miss the files to edit, and token pruners keep those files but alter their text, so fewer patches apply. Controlled tests show that each loss costs on its own: deleting tokens from the selector's own contexts, with the files unchanged, costs about as much as the compressors lose in the main comparison, while a compressor that keeps whole lines matches the selector when it starts from the same files.

The selector even resolves more issues than two methods trained for issue resolution: SWE-Pruner, a line pruner, and SweRank, a retriever that shows whole functions verbatim and comes within two points.

Our contributions are as follows:

• CQ2-CARE, a simple selector that spends the context budget on the files the model names and shows them verbatim, with no compression model ( §2§2).

• A budget-matched, test-graded comparison of CQ2-CARE with three prompt compressors, three retrievers, among them SWE-bench’s file-level BM25, and two methods trained for issue resolution, on 300 issues and two model families ( §3.3§3.3).

• A decomposition of the losses into gold-file recall and verbatim lines, with controlled tests that change one at a time ( §4.1–4.2§4.1–4.2).

References (43)