Skip the Compressor: Coding Agents Fix More Issues When They Pick Whole Files
- Source
- arxiv.org
- Author
- Xiaocong Yang, Rishit Chatterjee, Himanshu Udupi, Vikram Ramavarapu, ChengXiang Zhai
- Date
Repositories are often far larger than a coding agent's context window, and the common fixes are prompt compressors that delete text or retrievers that rank chunks by similarity to the issue. A new arXiv paper argues both miss what patching needs: the files that must change, shown exactly as written, because the model has to reproduce the lines it edits. The authors fit every context to the same per-issue budget on 300 recent SWE-rebench issues and graded patches with the benchmark's tests. Their selector, CQ2-CARE, spends the budget on choosing whole files to show verbatim. It resolved 43.7% of issues with GPT-5.6 and 46.7% with Claude Opus 5, ahead of every compressor and retriever tested and ahead of two methods trained for issue resolution, SweRank and SWE-Pruner. The failure analysis explains the gap. Retrievers often never surface the file that needs editing, while compressors keep the right files but change their text, so the resulting patches fail to apply. Exact-file selection also needs no separate compression model.

Context
Repositories are usually far bigger than a coding model's , so something has to decide what code the model sees. This paper argues that the common shortcuts both fail in a specific way when the job is writing a patch (arxiv.org). Retrievers rank code by how similar it looks to the issue text, so they can fill the with look-alike files and miss the one that needs editing. Prompt compressors keep the right but delete tokens they judge unimportant, and a patch has to quote the exact lines it changes. In one example from the paper, a compressor stripped the f prefix from an f-string, so the model's patch tried to rewrite a line that did not exist in the repository and failed to apply.
The authors' alternative, CQ2-CARE, spends the same on choosing a few whole files and showing them verbatim. It asks the model twice, independently, which files must change, keeps the files both answers name, and adds short grep matches for definitions or callers the model asks about (arxiv.org). On 300 recent SWE-rebench issues, with every method held to the same per-issue budget and each patch graded by the benchmark's tests, it resolved 43.7% of issues with GPT-5.6 and 46.7% with Claude Opus 5. That is 6.3 points above the best of three compressors with either model, 9.3 and 12.7 points above the best of three retrievers, and also ahead of two methods trained specifically for issue resolution: SweRank by 0.7 and 1.7 points and SWE-Pruner by 2.0 and 7.3.
The comparison is narrower than a full agent run: each context gets one patch attempt on Python issues from one benchmark, with no chance to open more files or run tests. The authors also report that a second sample flips between 8.7% and 18.9% of outcomes, so small gaps, such as CQ2-CARE's margin over the LLMLingua-2 compressor when Claude Opus 5 writes the patch, are fragile.
- The authors argue a patch needs both the files that must change and their exact text, because the model has to reproduce the lines it edits. Retrievers rank code by similarity to the issue, not by whether it must change.
- The whole-file selector, CQ2-CARE, also beat two methods trained for issue resolution: SweRank by 0.7 and 1.7 points and SWE-Pruner by 2.0 and 7.3 points, with GPT-5.6 and Claude Opus 5 respectively.
- In the authors' analysis, retrievers often miss the files that need editing, while compressors keep those files but alter their text, so fewer of the resulting patches apply.
- Every method's context was fit to the same per-issue token budget and each patch was graded with the benchmark's own tests. Exact-file selection also needs no separate compression model.
- Context and context window — Context is the information available for a generation; the context window is the capacity available to hold it.
- Prompt — Information or instructions supplied to a model; in a chat, the request you type is often called your prompt.
- File — A named unit of stored data that keeps its contents while no program is using it.
- token budget — A cap on how many tokens a task, session, or agent run may consume — the practical control on both cost and how long an agent will grind.
articleCompact-Bench: Measuring What Context Compaction Costs Long-Horizon Coding AgentsRuopei Sun, Jianfeng Cai, Kangwen Zhao, Wengang Zhou, Houqiang Li
articleNot All Agents Are Equal: Code Quality and Post-Merge Maintenance Across Five Autonomous Coding Agents in the WildObada Kraishan
articleHow Much Do Coding Agents Over-Edit, and Why? An Empirical Study of Unneeded Edits in Repository-Level Agent PatchesAakash Goel, Benjamin Steenhoek, Yu Hu