# Compressing Code Context for LLM-based Issue Resolution

arXiv: https://arxiv.org/abs/2603.28119 · HTML: https://mlsanity.com/paper/2603.28119/

## Key facts

- Cited by 12 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 30 Mar 2026.

## Built on by (most cited first, 12 of 12)

- [Code as Agent Harness](https://mlsanity.com/paper/2605.18747/) (2026)
- [From Question Answering to Task Completion: A Survey on Agent System and Harness Design](https://mlsanity.com/paper/2606.20683/) (2026)
- [CoACT: Action-Preserving Observation Compression for Coding Agents](https://mlsanity.com/paper/2607.02911/) (2026)
- [Token Optimization Strategies for LLM-Based Oracle-to-PostgreSQL Migration](https://mlsanity.com/paper/2605.28557/) (2026)
- [TokenPilot: Cache-Efficient Context Management for LLM Agents](https://mlsanity.com/paper/2606.17016/) (2026)
- [What Context Does a Coding Agent Actually Need to Act?](https://mlsanity.com/paper/2607.09691/) (2026)
- [SkillForge: Self-Distilling Agents for Project-Specific Issue Resolution](https://mlsanity.com/paper/2608.18933/) (2026)
- [MemoSight: Unifying Context Compression and Multi Token Prediction for Reasoning Acceleration](https://mlsanity.com/paper/2604.14889/) (2026)
- [Cross-Lingual Token Arbitrage: Optimizing Code Agent Context Windows via Local LLM Preprocessing](https://mlsanity.com/paper/2606.03618/) (2026)
- [TRIM: Reducing AI-Generated CodeSlop via Agent Trajectory Minimization](https://mlsanity.com/paper/2607.18161/) (2026)
- [The Recall Trap: A Recall-Maximizing Retriever Configuration Reduces Issue Resolution in Fixed-Budget Code Context](https://mlsanity.com/paper/2608.14838/) (2026)
- [Analyzing and Mitigating Cost-Inefficient Behaviors in Coding Agents](https://mlsanity.com/paper/2609.30725/) (2026)

## Abstract (arXiv)

Large Language Models (LLMs) are now capable of resolving real-world GitHub issues. However, current approaches overapproximate the code context and suffer from two compounding problems: the prohibitive cost of processing massive inputs, and low effectiveness as noise floods the context window and distracts the model from the bug-fixing signal. Existing compression techniques fail to resolve this tension: generic compressors compromise the semantic integrity of code, while code-specific tools lack awareness of code structure and task context to preserve essential patch ingredients. To address this, we propose a novel framework consisting of two components. First, Oracle-guided Code Distillation (OCD), a context distillation algorithm that combines genetic search and delta debugging to systematically reduce code contexts to their minimal sufficient subsequence - retaining only the ingredients required for a successful fix. We use this distilled data to fine-tune SWEzze, a lightweight model that learns to compress code context at inference time, filtering noise and combating distraction while preserving fix ingredients. Evaluated on SWE-bench Verified across three frontier LLMs, SWEzze maintains a stable compression rate of about 6 times across models, reduces the total token budget by 51.8%-71.3% relative to the uncompressed setting, improves issue resolution rates by 5.0%-9.2%, and delivers the best overall balance among effectiveness, compression ratio, and latency compared with state-of-the-art context compression baselines.
