The development of SWE-Pruner Pro introduces a novel approach for coding agents to efficiently manage context by utilizing their own internal representations to prune irrelevant tool-output lines. Instead of relying on a separate pruning model, SWE-Pruner Pro employs a small classifier that reads the last-layer hidden states of the coding agent, allowing it to label each line as either keep or remove. This method effectively reduces token usage by up to 39% while largely maintaining output quality across multiple benchmarks. The innovation addresses the common issue of coding agents retaining unnecessary text from past interactions, demonstrating that they possess sufficient relevance information to perform context management independently.

arxiv: arXiv is the primary online repository where researchers upload and share scientific preprints across computer science, mathematics, and related disciplines before formal publication. It enables rapid dissemination of new methods and findings to the research community. The paper detailing SWE-Pruner Pro is available there under the identifier abs/2607.18213.
SWE-Pruner Pro: SWE-Pruner Pro is a proposed pruning system for coding agents that uses the underlying model’s internal hidden states and summaries to automatically label and remove irrelevant lines from tool outputs such as files, logs, and search results. It adds a lightweight classifier head trained on labeled responses while leaving the base coding LLM unchanged and incorporates signals to handle varying output lengths and protect important content. The system is introduced in the arXiv paper as a way for coding agents to manage context more effectively during multi-turn tasks.

Model Internals: Large language models contain internal representations that can directly indicate the relevance of input lines for pruning decisions.
Context Management: Coding agents frequently carry over large volumes of unused text from previous tool calls into subsequent reasoning steps.