SWE-Pruner: Self-Adaptive Context Pruning for Coding Agents
On the map: LLM agents and tool use → Software engineering coding agents
Abstract (arXiv)
LLM agents have demonstrated remarkable capabilities in software development, but their performance is hampered by long interaction contexts, which incur high API costs and latency. While various context compression approaches such as LongLLMLingua have emerged to tackle this challenge, they typically rely on fixed metrics such as PPL, ignoring the task-specific nature of code understanding. As a result, they frequently disrupt syntactic and logical structure and fail to retain critical implementation details. In this paper, we propose SWE-Pruner, a self-adaptive context pruning framework tailored for coding agents. Drawing inspiration from how human programmers "selectively skim" source code during development and debugging, SWE-Pruner performs task-aware adaptive pruning for long contexts. Given the current task, the agent formulates an explicit goal (e.g., "focus on error handling") as a hint to guide the pruning targets. A lightweight neural skimmer (0.6B parameters) is trained to dynamically select relevant lines from the surrounding context given the goal. Evaluations across four benchmarks and multiple models validate SWE-Pruner's effectiveness in various scenarios, achieving 23-54% token reduction on agent tasks like SWE-Bench Verified while even improving success rates, and up to 14.84x compression on single-turn tasks like LongCodeQA with minimal performance impact.
Key facts. Cited by 44 papers in the map (data through 14 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 64 of its 79 references that are in the map. First posted on arXiv 23 Jan 2026.
Builds on
64 of 79 references.
Closest ancestors · 10
Same direction, newest first
- 2025Live-SWE-agent: Can Software Engineering Agents Self-Evolve on the Fly?17 Nov
- 2025Understanding Code Agent Behaviour: An Empirical Study of Success and Failure Trajectories31 Oct
- 2025Reducing Cost of LLM Agents with Trajectory Reduction28 Sep
- 2025Trae Agent: An LLM-based Agent for Software Engineering with Test-time Scaling31 Jul
- 2025SWE-Debate: Competitive Multi-Agent Debate for Software Issue Resolution31 Jul
- 2024Large Language Model-Based Agents for Software Engineering: A Survey4 Sep
- 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agents23 Jul
- 2024Agentless: Demystifying LLM-based Software Engineering Agents1 Jul
- 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering6 May
- 2024RepairAgent: An Autonomous, LLM-Based Agent for Program Repair25 Mar
Other references · 54
- 2023GPT-4 Technical Reportcited by 18,396
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,455
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
- 2023Qwen Technical Reportcited by 3,344
- 2024Gemini 1.5: Unlocking multimodal understanding across millions of tokens of contextcited by 3,224
- 2023G-Eval: NLG Evaluation using GPT-4 with Better Human Alignmentcited by 2,276
- 2025Qwen3 Embedding: Advancing Text Embedding and Reranking Through Foundation Modelscited by 1,261
- 2024Qwen2.5-Coder Technical Reportcited by 1,203
38 more
- 2023StarCoder: may the source be with you!cited by 799
- 2023LongLLMLingua: Accelerating and Enhancing LLMs in Long Context Scenarios via Prompt Compressioncited by 453
- 2025LLMs Get Lost In Multi-Turn Conversationcited by 429
- 2023Learning to Compress Prompts with Gist Tokenscited by 390
- 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 367
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 361
- 2024LLMLingua-2: Data Distillation for Efficient and Faithful Task-Agnostic Prompt Compressioncited by 348
- 2023LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Modelscited by 287
- 2015Conditional Random Fields as Recurrent Neural Networkscited by 214
- 2023LooGLE: Can Long-Context Language Models Understand Long Contexts?cited by 202
- 2023Compressing Context to Enhance Inference Efficiency of Large Language Modelscited by 189
- 2025Scaling Long-Horizon LLM Agent via Context-Foldingcited by 148
- 2025ACON: Optimizing Context Compression for Long-horizon LLM Agentscited by 136
- 2024xRAG: Extreme Context Compression for Retrieval-augmented Generation with One Tokencited by 125
- 2023LongCoder: A Long-Range Pre-trained Language Model for Code Completioncited by 112
- 2025AgentFold: Long-Horizon Web Agents with Proactive Context Managementcited by 103
- 2024CodeR: Issue Resolving with Multi-Agent and Task Graphscited by 91
- 2025Can LLMs Replace Human Evaluators? An Empirical Study of LLM-as-a-Judge in Software Engineeringcited by 67
- 2025SWE-Exp: Experience-Driven Software Issue Resolutioncited by 65
- 2025Scaling LLM Multi-turn RL with End-to-end Summarization-based Context Managementcited by 51
- 2025Seed-Coder: Let the Code Model Curate Data for Itselfcited by 49
- 2025The Complexity Trap: Simple Observation Masking Is as Efficient as LLM Summarization for Agent Context Managementcited by 48
- 2024AgentFL: Scaling LLM-based Fault Localization to Project-Level Contextcited by 47
- 2024From Code to Correctness: Closing the Last Mile of Code Generation with Hierarchical Debuggingcited by 46
- 2025LongCodeZip: Compress Long Context for Code Language Modelscited by 39
- 2025SWE-QA: Can Language Models Answer Repository-level Code Questions?cited by 38
- 2025LongCodeBench: Evaluating Coding LLMs at 1M Context Windowscited by 37
- 2025Pruning the Unsurprising: Efficient LLM Reasoning via First-Token Surprisalcited by 32
- 2022Diet Code Is Healthy: Simplifying Programs for Pre-trained Models of Codecited by 24
- 2025COMPASS: Enhancing Agent Long-Horizon Reasoning with Evolving Contextcited by 20
- 2025AttentionRAG: Attention-Guided Context Pruning in Retrieval-Augmented Generationcited by 19
- 2026In Line with Context: Repository-Level Code Generation via Context Inliningcited by 18
- 2025From Code to Courtroom: LLMs as the New Software Judgescited by 16
- 2025ELABORATION: A Comprehensive Benchmark on Human-LLM Competitive Programmingcited by 16
- 2025LastingBench: Defend Benchmarks Against Knowledge Leakagecited by 14
- 2026Reasoning in Trees: Improving Retrieval-Augmented Generation for Multi-Hop Question Answeringcited by 14
- 2024Hierarchical Context Pruning: Optimizing Real-World Code Completion with Repository-Level Pretrained Code LLMscited by 13
- 2024Natural Is The Best: Model-Agnostic Code Simplification for Pre-trained Large Language Modelscited by 10
50 most cited of 54 All 54 (JSON)
Built on by
Citing papers per year: 2026: 44.
44 papers.
Sort:
By area:
- 2026Code as Agent Harnesscited by 47
- 2026SWE-Master: Unleashing the Potential of Software Engineering Agents via Post-Trainingcited by 22
- 2026SWE-Explore: Benchmarking How Coding Agents Explore Repositoriescited by 21
- 2026SWE-TRACE: Optimizing Long-Horizon SWE Agents Through Rubric Process Reward Models and Heuristic Test-Time Scalingcited by 16
- 2026A Self-Evolving Framework for Efficient Terminal Agents via Observational Context Compressioncited by 15
- 2026SWE-MeM: Learning Adaptive Memory Management for Long-Horizon Coding Agentscited by 15
- 2026Seeing is Coding: On the Effectiveness of Vision Language Models in Code Understandingcited by 13
- 2026Self-GC: Self-Governing Context for Long-Horizon LLM Agentscited by 11
- 2026FASA: Frequency-aware Sparse Attentioncited by 8
- 2026The Missing Memory Hierarchy: Demand Paging for LLM Context Windowscited by 8
- 2026Test vs Mutant: Adversarial LLM Agents for Robust Unit Test Generationcited by 7
- 2026SWE-Bench ProMax: Benchmarking Agents on Large-Scale Multilingual Code Refactoringcited by 6
32 more
- 2026FastContext: Training Efficient Repository Explorer for Coding Agentscited by 5
- 2026Steer, Don't Solve: Training Small Critic Models for Large Code Agentscited by 5
- 2026CoACT: Action-Preserving Observation Compression for Coding Agentscited by 4
- 2026Turning Interaction History into Execution State: A Runtime Layer for Long-Horizon Coding Agentscited by 4
- 2026What Context Does a Coding Agent Actually Need to Act?cited by 3
- 2026EarlyEval: Cheaper Agent Evaluation via Early Outcome Predictioncited by 3
- 2026SEA-TS: Self-Evolving Agent for Autonomous Code Generation of Time Series Forecasting Algorithmscited by 2
- 2026ClassEval-Pro: A Cross-Domain Benchmark for Class-Level Code Generationcited by 2
- 2026Context Pruning for Coding Agents via Multi-Rubric Latent Reasoningcited by 2
- 2026SWE-Pruner Pro: The Coder LLM Already Knows What to Prunecited by 2
- 2026SkillForge: Self-Distilling Agents for Project-Specific Issue Resolutioncited by 2
- 2026Deep Agentic Search for Repository-Level Code Question Answering: An Empirical Studycited by 1
- 2026Memory Control Signals Emerge Before Action in Long Horizon Agentscited by 1
- 2026StateComp: Learning When to Compress History in Long Horizon Agentscited by 1
- 2026Beyond Textual Repository Exploration: Dual-Modal Structural Reasoning for Agentic Issue Resolutioncited by 0
- 2026Shapley Context Pruning: A Cooperative Game Perspective for Context Reranking and Pruningcited by 0
- 2026Do Large Language Models Perform Well on Comprehending Poetic Logic in Modern Chinese Poetry?cited by 0
- 2026Read Less, Solve More: Token-Efficient Sparse Reading for AI Agentscited by 0
- 2026openJiuwen: Beyond Static Harnesses for Long-Horizon Coding Agentscited by 0
- 2026DRSR: Learning Set-Level Deletion Risk for Efficient Long-Horizon Agentscited by 0
- 2026Stable Geometry with Divergent Task Evidence for Efficient Long-Horizon Agent Compressioncited by 0
- 2026Schr"odinger's Code Repository: Have LLMs Learned SWE-bench or Memorized It?cited by 0
- 2026When Can Agents Forget Their Reasoning? ICLR for Long-Horizon Agent Context Compressioncited by 0
- 2026Analyzing and Mitigating Cost-Inefficient Behaviors in Coding Agentscited by 0
- 2026Compress What You See, Not What You Say: Anchored Context Distillation for Latent-Observation Software Engineering Agentscited by 0
- 2026ARSM: Auto-Regressive State Machine for Agentic Reasoning Compressioncited by 0
- 2026EfficientAgent: What Makes KV Cache Offloading Work for Concurrent Agents?cited by 0
- 2026StateTape: Action-Conditioned Evidence Lifecycle Modeling for Long-Horizon Coding Agentscited by 0
- 2026MemTrace: State-Consistent Memory for Long-Horizon Coding Agentscited by 0
- 2026ReFold: Training-Free Reversible Inter-Turn Context Folding for Long-Horizon Agentscited by 0
- 2026TAP: Efficient Long-Horizon Agent Pruning via Trajectory-Anchored Recoverycited by 0
- 2026StateHarness: Maintaining Evolving Project State for Long-Horizon Coding Agentscited by 0
- 2026StateHarness: Maintaining Evolving Project State for Long-Horizon Coding Agents13 Oct 2026
- 2026TAP: Efficient Long-Horizon Agent Pruning via Trajectory-Anchored Recovery6 Oct 2026
- 2026ReFold: Training-Free Reversible Inter-Turn Context Folding for Long-Horizon Agents6 Oct 2026
- 2026MemTrace: State-Consistent Memory for Long-Horizon Coding Agents4 Oct 2026
- 2026StateTape: Action-Conditioned Evidence Lifecycle Modeling for Long-Horizon Coding Agents28 Sep 2026
- 2026EfficientAgent: What Makes KV Cache Offloading Work for Concurrent Agents?27 Sep 2026
- 2026ARSM: Auto-Regressive State Machine for Agentic Reasoning Compression26 Sep 2026
- 2026Compress What You See, Not What You Say: Anchored Context Distillation for Latent-Observation Software Engineering Agents25 Sep 2026
- 2026Analyzing and Mitigating Cost-Inefficient Behaviors in Coding Agents25 Sep 2026
- 2026When Can Agents Forget Their Reasoning? ICLR for Long-Horizon Agent Context Compression24 Sep 2026
- 2026Stable Geometry with Divergent Task Evidence for Efficient Long-Horizon Agent Compression23 Sep 2026
- 2026StateComp: Learning When to Compress History in Long Horizon Agents23 Sep 2026
32 more
- 2026Memory Control Signals Emerge Before Action in Long Horizon Agents23 Sep 2026
- 2026DRSR: Learning Set-Level Deletion Risk for Efficient Long-Horizon Agents23 Sep 2026
- 2026EarlyEval: Cheaper Agent Evaluation via Early Outcome Prediction2 Sep 2026
- 2026openJiuwen: Beyond Static Harnesses for Long-Horizon Coding Agents28 Aug 2026
- 2026Read Less, Solve More: Token-Efficient Sparse Reading for AI Agents23 Aug 2026
- 2026Do Large Language Models Perform Well on Comprehending Poetic Logic in Modern Chinese Poetry?22 Aug 2026
- 2026Schr"odinger's Code Repository: Have LLMs Learned SWE-bench or Memorized It?21 Aug 2026
- 2026SkillForge: Self-Distilling Agents for Project-Specific Issue Resolution19 Aug 2026
- 2026SWE-Bench ProMax: Benchmarking Agents on Large-Scale Multilingual Code Refactoring10 Aug 2026
- 2026Deep Agentic Search for Repository-Level Code Question Answering: An Empirical Study2 Aug 2026
- 2026Turning Interaction History into Execution State: A Runtime Layer for Long-Horizon Coding Agents1 Aug 2026
- 2026SWE-Pruner Pro: The Coder LLM Already Knows What to Prune20 Jul 2026
- 2026CoACT: Action-Preserving Observation Compression for Coding Agents3 Jul 2026
- 2026Beyond Textual Repository Exploration: Dual-Modal Structural Reasoning for Agentic Issue Resolution2 Jul 2026
- 2026Self-GC: Self-Governing Context for Long-Horizon LLM Agents1 Jul 2026
- 2026SWE-MeM: Learning Adaptive Memory Management for Long-Horizon Coding Agents26 Jun 2026
- 2026Steer, Don't Solve: Training Small Critic Models for Large Code Agents20 Jun 2026
- 2026What Context Does a Coding Agent Actually Need to Act?19 Jun 2026
- 2026FastContext: Training Efficient Repository Explorer for Coding Agents12 Jun 2026
- 2026SWE-Explore: Benchmarking How Coding Agents Explore Repositories5 Jun 2026
- 2026Code as Agent Harness18 May 2026
- 2026Context Pruning for Coding Agents via Multi-Rubric Latent Reasoning14 May 2026
- 2026Shapley Context Pruning: A Cooperative Game Perspective for Context Reranking and Pruning10 May 2026
- 2026ClassEval-Pro: A Cross-Domain Benchmark for Class-Level Code Generation29 Apr 2026
- 2026A Self-Evolving Framework for Efficient Terminal Agents via Observational Context Compression21 Apr 2026
- 2026SWE-TRACE: Optimizing Long-Horizon SWE Agents Through Rubric Process Reward Models and Heuristic Test-Time Scaling16 Apr 2026
- 2026The Missing Memory Hierarchy: Demand Paging for LLM Context Windows9 Mar 2026
- 2026SEA-TS: Self-Evolving Agent for Autonomous Code Generation of Time Series Forecasting Algorithms5 Mar 2026
- 2026Test vs Mutant: Adversarial LLM Agents for Robust Unit Test Generation8 Feb 2026
- 2026SWE-Master: Unleashing the Potential of Software Engineering Agents via Post-Training3 Feb 2026
- 2026FASA: Frequency-aware Sparse Attention3 Feb 2026
- 2026Seeing is Coding: On the Effectiveness of Vision Language Models in Code Understanding2 Feb 2026
- 2026Code as Agent Harnesscited by 47
- 2026SWE-Master: Unleashing the Potential of Software Engineering Agents via Post-Trainingcited by 22
- 2026SWE-Explore: Benchmarking How Coding Agents Explore Repositoriescited by 21
- 2026SWE-MeM: Learning Adaptive Memory Management for Long-Horizon Coding Agentscited by 15
- 2026Self-GC: Self-Governing Context for Long-Horizon LLM Agentscited by 11
- 2026Test vs Mutant: Adversarial LLM Agents for Robust Unit Test Generationcited by 7
- 2026SWE-Bench ProMax: Benchmarking Agents on Large-Scale Multilingual Code Refactoringcited by 6
- 2026FastContext: Training Efficient Repository Explorer for Coding Agentscited by 5
- 2026Steer, Don't Solve: Training Small Critic Models for Large Code Agentscited by 5
- 2026CoACT: Action-Preserving Observation Compression for Coding Agentscited by 4
- 2026Turning Interaction History into Execution State: A Runtime Layer for Long-Horizon Coding Agentscited by 4
- 2026What Context Does a Coding Agent Actually Need to Act?cited by 3
12 most cited of 29 All 29 (JSON)
- 2026StateHarness: Maintaining Evolving Project State for Long-Horizon Coding Agents13 Oct 2026
- 2026TAP: Efficient Long-Horizon Agent Pruning via Trajectory-Anchored Recovery6 Oct 2026
- 2026ReFold: Training-Free Reversible Inter-Turn Context Folding for Long-Horizon Agents6 Oct 2026
- 2026MemTrace: State-Consistent Memory for Long-Horizon Coding Agents4 Oct 2026
- 2026StateTape: Action-Conditioned Evidence Lifecycle Modeling for Long-Horizon Coding Agents28 Sep 2026
- 2026EfficientAgent: What Makes KV Cache Offloading Work for Concurrent Agents?27 Sep 2026
- 2026Compress What You See, Not What You Say: Anchored Context Distillation for Latent-Observation Software Engineering Agents25 Sep 2026
- 2026Analyzing and Mitigating Cost-Inefficient Behaviors in Coding Agents25 Sep 2026
- 2026StateComp: Learning When to Compress History in Long Horizon Agents23 Sep 2026
- 2026Memory Control Signals Emerge Before Action in Long Horizon Agents23 Sep 2026
- 2026EarlyEval: Cheaper Agent Evaluation via Early Outcome Prediction2 Sep 2026
- 2026openJiuwen: Beyond Static Harnesses for Long-Horizon Coding Agents28 Aug 2026
12 newest of 29 All 29 (JSON)
- 2026SWE-TRACE: Optimizing Long-Horizon SWE Agents Through Rubric Process Reward Models and Heuristic Test-Time Scalingcited by 16
- 2026Context Pruning for Coding Agents via Multi-Rubric Latent Reasoningcited by 2
- 2026DRSR: Learning Set-Level Deletion Risk for Efficient Long-Horizon Agentscited by 0
- 2026When Can Agents Forget Their Reasoning? ICLR for Long-Horizon Agent Context Compressioncited by 0
- 2026ARSM: Auto-Regressive State Machine for Agentic Reasoning Compressioncited by 0
- 2026ARSM: Auto-Regressive State Machine for Agentic Reasoning Compression26 Sep 2026
- 2026When Can Agents Forget Their Reasoning? ICLR for Long-Horizon Agent Context Compression24 Sep 2026
- 2026DRSR: Learning Set-Level Deletion Risk for Efficient Long-Horizon Agents23 Sep 2026
- 2026Context Pruning for Coding Agents via Multi-Rubric Latent Reasoning14 May 2026
- 2026SWE-TRACE: Optimizing Long-Horizon SWE Agents Through Rubric Process Reward Models and Heuristic Test-Time Scaling16 Apr 2026
- 2026The Missing Memory Hierarchy: Demand Paging for LLM Context Windowscited by 8
- 2026SEA-TS: Self-Evolving Agent for Autonomous Code Generation of Time Series Forecasting Algorithmscited by 2
- 2026ClassEval-Pro: A Cross-Domain Benchmark for Class-Level Code Generationcited by 2
- 2026Do Large Language Models Perform Well on Comprehending Poetic Logic in Modern Chinese Poetry?cited by 0
- 2026Read Less, Solve More: Token-Efficient Sparse Reading for AI Agentscited by 0
- 2026Stable Geometry with Divergent Task Evidence for Efficient Long-Horizon Agent Compressioncited by 0
- 2026Stable Geometry with Divergent Task Evidence for Efficient Long-Horizon Agent Compression23 Sep 2026
- 2026Read Less, Solve More: Token-Efficient Sparse Reading for AI Agents23 Aug 2026
- 2026Do Large Language Models Perform Well on Comprehending Poetic Logic in Modern Chinese Poetry?22 Aug 2026
- 2026ClassEval-Pro: A Cross-Domain Benchmark for Class-Level Code Generation29 Apr 2026
- 2026The Missing Memory Hierarchy: Demand Paging for LLM Context Windows9 Mar 2026
- 2026SEA-TS: Self-Evolving Agent for Autonomous Code Generation of Time Series Forecasting Algorithms5 Mar 2026
Similar, not cited
Close in wording, no citation either way
- 2026SWE Context Bench: A Benchmark for Context Learning in Coding
- 2026Squeez: Task-Conditioned Tool-Output Pruning for Coding Agents
- 2026SWE-Duel: Towards a Self-Scaling Arena for Coding Agents
- 2025Kimi-Dev: Agentless Training as Skill Prior for SWE-Agents
- 2026On Problems of Implicit Context Compression for Software Engineering Agents
- 2025Training Versatile Coding Agents in Synthetic Environments
- 2026Latent Programming Horizons in Coding Agents
- 2026SWE-Edit: Rethinking Code Editing for Efficient SWE-Agent