The paper proposes using the coding agent's own internal representations to remove irrelevant tool-output lines without a separate pruning model.
SWE-Pruner Pro reads the model's last-layer hidden states and labels every tool-output line as keep or remove.
Coding agents repeatedly read files, logs, and search results, then carry large amounts of unused text into later turns.
SWE-Pruner Pro adds a small classifier that reads hidden states, the model's internal summaries, and labels each line keep or prune.
A length-aware signal makes it gentler with short outputs, while a balanced training loss protects rare but important lines.
The team trained only this added head on 22,609 labeled tool responses, leaving the coding LLM itself unchanged.
Across 2 open models and 4 multi-turn benchmarks, it cut token use by up to 39% while mostly preserving quality.
On MiMo-V2-Flash, it also improved one coding benchmark by 3.8% and one long-context test by 2.2 points.
The result suggests coding agents already contain enough relevance information to manage context without a separate pruning model.
- arxiv. org/abs/2607.18213
Title: "SWE-Pruner Pro: The Coder LLM Already Knows What to Prune"