Context as a Tool: Context Management for Long-Horizon SWE-Agents
On the map: LLM agents and tool use → Software engineering coding agents
Abstract (arXiv)
Agents based on large language models have recently shown strong potential on real-world software engineering (SWE) tasks that require long-horizon interaction with repository-scale codebases. However, most existing agents rely on append-only context maintenance or passively triggered compression heuristics, which often lead to context explosion, semantic drift, and degraded reasoning in long-running interactions. We propose CAT, a new context management paradigm that elevates context maintenance to a callable tool integrated into the decision-making process of agents. CAT formalizes a structured context workspace consisting of stable task semantics, condensed long-term memory, and high-fidelity short-term interactions, and enables agents to proactively compress historical trajectories into actionable summaries at appropriate milestones. To support context management for SWE-agents, we propose a trajectory-level supervision framework, CAT-GENERATOR, based on an offline data construction pipeline that injects context-management actions into complete interaction trajectories. Using this framework, we train a context-aware model, SWE-Compressor. Experiments on SWE-Bench-Verified demonstrate that SWE-Compressor reaches a 57.6% solved rate and significantly outperforms ReAct-based agents and static compression baselines, while maintaining stable and scalable long-horizon reasoning under a bounded context budget.
Key facts. Cited by 38 papers in the map (data through 7 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 30 of its 48 references that are in the map. First posted on arXiv 26 Dec 2025.
Builds on
30 of 48 references.
Closest ancestors · 9
Same direction, newest first
- 2025Smarter Together: Creating Agentic Communities of Practice through Shared Experiential Learning11 Nov
- 2025Reducing Cost of LLM Agents with Trajectory Reduction28 Sep
- 2025Trae Agent: An LLM-based Agent for Software Engineering with Test-time Scaling31 Jul
- 2025SWE-rebench: An Automated Pipeline for Task Collection and Decontaminated Evaluation of Software Engineering Agents26 May
- 2025SWE-smith: Scaling Data for Software Engineering Agents30 Apr
- 2025R2E-Gym: Procedural Environments and Hybrid Verifiers for Scaling Open-Weights SWE Agents9 Apr
- 2024Training Software Engineering Agents and Verifiers with SWE-Gym30 Dec
- 2024Lingma SWE-GPT: An Open Development-Process-Centric Language Model for Automated Software Improvement1 Nov
- 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agents23 Jul
Other references · 21
- 2023GPT-4 Technical Reportcited by 18,132
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
- 2024Qwen2.5-Coder Technical Reportcited by 1,151
- 2024LLMLingua-2: Data Distillation for Efficient and Faithful Task-Agnostic Prompt Compressioncited by 343
- 2025SWE-RL: Advancing LLM Reasoning via Reinforcement Learning on Open Software Evolutioncited by 246
- 2024InfLLM: Training-Free Long-Context Extrapolation for LLMs with an Efficient Context Memorycited by 192
- 2025Multi-SWE-bench: A Multilingual Benchmark for Issue Resolvingcited by 165
- 2025Scaling Long-Horizon LLM Agent via Context-Foldingcited by 136
9 more
- 2025ACON: Optimizing Context Compression for Long-horizon LLM Agentscited by 126
- 2023SCM: Enhancing Large Language Model with Self-Controlled Memory Frameworkcited by 98
- 2025AgentFold: Long-Horizon Web Agents with Proactive Context Managementcited by 95
- 2025SWE-Fixer: Training Open-Source LLMs for Effective and Efficient GitHub Issue Resolutioncited by 87
- 2025SE-Agent: Self-Evolution Trajectory Optimization in Multi-Step Reasoning with LLM-Based Agentscited by 66
- 2023Unlocking Context Constraints of LLMs: Enhancing Context Efficiency of LLMs with Self-Information-Based Content Filteringcited by 62
- 2025SWE-Mirror: Scaling Issue-Resolving Datasets by Mirroring Issues Across Repositoriescited by 30
- 2025RCR-Router: Efficient Role-Aware Context Routing for Multi-Agent LLM Systems with Structured Memorycited by 24
- 2025Scaling Graph Chain-of-Thought Reasoning: A Multi-Agent Framework with Efficient LLM Servingcited by 10
Built on by
Citing papers per year: 2026: 38.
38 papers.
Sort:
By area:
- 2026SWE-World: Building Software Engineering Agents in Docker-Free Environmentscited by 21
- 2026From Storage to Experience: A Survey on the Evolution of LLM Agent Memory Mechanismscited by 19
- 2026SWE-Master: Unleashing the Potential of Software Engineering Agents via Post-Trainingcited by 18
- 2026daVinci-Env: Open SWE Environment Synthesis at Scalecited by 13
- 2026A Self-Evolving Framework for Efficient Terminal Agents via Observational Context Compressioncited by 12
- 2026SWE-MeM: Learning Adaptive Memory Management for Long-Horizon Coding Agentscited by 12
- 2026GenericAgent: A Token-Efficient Self-Evolving LLM Agent via Contextual Information Density Maximization (V1.0)cited by 10
- 2026SAM: State-Adaptive Memory for Long-Horizon Reasoning Agentcited by 10
- 2026From Question Answering to Task Completion: A Survey on Agent System and Harness Designcited by 9
- 2026Scaling Coding Agents via Atomic Skillscited by 8
- 2026Orchard: An Open-Source Agentic Modeling Frameworkcited by 7
- 2026Agent-Omit: Adaptive Context Omission for Efficient LLM Agentscited by 5
26 more
- 2026On Training Large Language Models for Long-Horizon Tasks: An Empirical Study of Horizon Lengthcited by 5
- 2026KLong: Training LLM Agent for Extremely Long-horizon Taskscited by 4
- 2026CoACT: Action-Preserving Observation Compression for Coding Agentscited by 4
- 2026SWE-Edit: Rethinking Code Editing for Efficient SWE-Agentcited by 3
- 2026TokenPilot: Cache-Efficient Context Management for LLM Agentscited by 3
- 2026LLM Agents Are Latent Context Managers: Eliciting Self-Managed Context via State Proprioceptioncited by 3
- 2026Less Context, Better Agents: Efficient Context Engineering for Long-Horizon Tool-Using LLM Agentscited by 2
- 2026SoL-Pi: Recursively Scaling Auto-Research Loops for Efficient Agent Harnesscited by 2
- 2026LEAD: Breaking the No-Recovery Bottleneck in Long-Horizon Reasoningcited by 1
- 2026Remember Your Trace: Memory-Guided Long-Horizon Agentic Framework for Consistent and Hierarchical Repository-Level Code Documentationcited by 1
- 2026Track, Rank, Crack: Epistemic Working Memory Scales Multi-Hop Reasoning in Language Agentscited by 1
- 2026Screenshots or Tools? Eliciting Tool Use and Managing Multimodal Context in Hybrid GUI-MCP Computer-Use Agentscited by 1
- 2026Graph Engineering in the Era of LLM Agents: From Individual Intelligence to System Intelligencecited by 1
- 2026Conversation Tree Architecture: A Structured Framework for Context-Aware Multi-Branch LLM Conversationscited by 0
- 2026The Time is Here for Just-in-Time Systems: Challenges and Opportunitiescited by 0
- 2026CodeNib: A Multi-View Data System for Serving Repository Context to Coding Agentscited by 0
- 2026From Agent Behaviour to Agent-Friendly Documentation: An Empirical Study of How Coding Agents Discover, Read, and Write Technical Documentationcited by 0
- 2026CyberFactory: Scaling Cyber Security Capabilities with Instances from the Wildcited by 0
- 2026AutoFyn Technical Report: Non-Parametric Expert Iteration for Long-Horizon Agentscited by 0
- 2026Memory Control Signals Emerge Before Action in Long Horizon Agentscited by 0
- 2026Coding Agent Memory Post-training: Unlocking the Memory Potential of Pre-trained File Operations for Long-Horizon Tasks via Reinforcement Learningcited by 0
- 2026StateTape: Action-Conditioned Evidence Lifecycle Modeling for Long-Horizon Coding Agentscited by 0
- 2026Context Language Modelscited by 0
- 2026LongHarness Bench: Stress-Testing Language Model Harnesses for Long-Context Reasoningcited by 0
- 2026Beyond Memory: Harnessing Long-Horizon Agents with Explicit Belief Statescited by 0
- 2026AutoCompact: Learning When to Compact Context in Long-Horizon Coding Agentscited by 0
- 2026AutoCompact: Learning When to Compact Context in Long-Horizon Coding Agents1 Oct 2026
- 2026Beyond Memory: Harnessing Long-Horizon Agents with Explicit Belief States1 Oct 2026
- 2026LongHarness Bench: Stress-Testing Language Model Harnesses for Long-Context Reasoning29 Sep 2026
- 2026Context Language Models29 Sep 2026
- 2026StateTape: Action-Conditioned Evidence Lifecycle Modeling for Long-Horizon Coding Agents28 Sep 2026
- 2026Coding Agent Memory Post-training: Unlocking the Memory Potential of Pre-trained File Operations for Long-Horizon Tasks via Reinforcement Learning28 Sep 2026
- 2026Memory Control Signals Emerge Before Action in Long Horizon Agents23 Sep 2026
- 2026SoL-Pi: Recursively Scaling Auto-Research Loops for Efficient Agent Harness17 Sep 2026
- 2026CyberFactory: Scaling Cyber Security Capabilities with Instances from the Wild24 Aug 2026
- 2026Graph Engineering in the Era of LLM Agents: From Individual Intelligence to System Intelligence21 Aug 2026
- 2026From Agent Behaviour to Agent-Friendly Documentation: An Empirical Study of How Coding Agents Discover, Read, and Write Technical Documentation20 Aug 2026
- 2026Screenshots or Tools? Eliciting Tool Use and Managing Multimodal Context in Hybrid GUI-MCP Computer-Use Agents4 Aug 2026
26 more
- 2026AutoFyn Technical Report: Non-Parametric Expert Iteration for Long-Horizon Agents31 Jul 2026
- 2026CodeNib: A Multi-View Data System for Serving Repository Context to Coding Agents28 Jul 2026
- 2026Track, Rank, Crack: Epistemic Working Memory Scales Multi-Hop Reasoning in Language Agents14 Jul 2026
- 2026CoACT: Action-Preserving Observation Compression for Coding Agents3 Jul 2026
- 2026LLM Agents Are Latent Context Managers: Eliciting Self-Managed Context via State Proprioception29 Jun 2026
- 2026SWE-MeM: Learning Adaptive Memory Management for Long-Horizon Coding Agents26 Jun 2026
- 2026TokenPilot: Cache-Efficient Context Management for LLM Agents15 Jun 2026
- 2026From Question Answering to Task Completion: A Survey on Agent System and Harness Design14 Jun 2026
- 2026Less Context, Better Agents: Efficient Context Engineering for Long-Horizon Tool-Using LLM Agents8 Jun 2026
- 2026SAM: State-Adaptive Memory for Long-Horizon Reasoning Agent23 May 2026
- 2026The Time is Here for Just-in-Time Systems: Challenges and Opportunities22 May 2026
- 2026Orchard: An Open-Source Agentic Modeling Framework14 May 2026
- 2026Remember Your Trace: Memory-Guided Long-Horizon Agentic Framework for Consistent and Hierarchical Repository-Level Code Documentation14 May 2026
- 2026From Storage to Experience: A Survey on the Evolution of LLM Agent Memory Mechanisms7 May 2026
- 2026On Training Large Language Models for Long-Horizon Tasks: An Empirical Study of Horizon Length4 May 2026
- 2026SWE-Edit: Rethinking Code Editing for Efficient SWE-Agent28 Apr 2026
- 2026A Self-Evolving Framework for Efficient Terminal Agents via Observational Context Compression21 Apr 2026
- 2026GenericAgent: A Token-Efficient Self-Evolving LLM Agent via Contextual Information Density Maximization (V1.0)18 Apr 2026
- 2026Scaling Coding Agents via Atomic Skills6 Apr 2026
- 2026Conversation Tree Architecture: A Structured Framework for Context-Aware Multi-Branch LLM Conversations22 Mar 2026
- 2026daVinci-Env: Open SWE Environment Synthesis at Scale13 Mar 2026
- 2026LEAD: Breaking the No-Recovery Bottleneck in Long-Horizon Reasoning6 Mar 2026
- 2026KLong: Training LLM Agent for Extremely Long-horizon Tasks19 Feb 2026
- 2026Agent-Omit: Adaptive Context Omission for Efficient LLM Agents4 Feb 2026
- 2026SWE-World: Building Software Engineering Agents in Docker-Free Environments3 Feb 2026
- 2026SWE-Master: Unleashing the Potential of Software Engineering Agents via Post-Training3 Feb 2026
- 2026SWE-World: Building Software Engineering Agents in Docker-Free Environmentscited by 21
- 2026From Storage to Experience: A Survey on the Evolution of LLM Agent Memory Mechanismscited by 19
- 2026SWE-Master: Unleashing the Potential of Software Engineering Agents via Post-Trainingcited by 18
- 2026SWE-MeM: Learning Adaptive Memory Management for Long-Horizon Coding Agentscited by 12
- 2026GenericAgent: A Token-Efficient Self-Evolving LLM Agent via Contextual Information Density Maximization (V1.0)cited by 10
- 2026From Question Answering to Task Completion: A Survey on Agent System and Harness Designcited by 9
- 2026Scaling Coding Agents via Atomic Skillscited by 8
- 2026Orchard: An Open-Source Agentic Modeling Frameworkcited by 7
- 2026Agent-Omit: Adaptive Context Omission for Efficient LLM Agentscited by 5
- 2026KLong: Training LLM Agent for Extremely Long-horizon Taskscited by 4
- 2026CoACT: Action-Preserving Observation Compression for Coding Agentscited by 4
- 2026TokenPilot: Cache-Efficient Context Management for LLM Agentscited by 3
12 most cited of 26 All 26 (JSON)
- 2026AutoCompact: Learning When to Compact Context in Long-Horizon Coding Agents1 Oct 2026
- 2026Beyond Memory: Harnessing Long-Horizon Agents with Explicit Belief States1 Oct 2026
- 2026StateTape: Action-Conditioned Evidence Lifecycle Modeling for Long-Horizon Coding Agents28 Sep 2026
- 2026Coding Agent Memory Post-training: Unlocking the Memory Potential of Pre-trained File Operations for Long-Horizon Tasks via Reinforcement Learning28 Sep 2026
- 2026Memory Control Signals Emerge Before Action in Long Horizon Agents23 Sep 2026
- 2026SoL-Pi: Recursively Scaling Auto-Research Loops for Efficient Agent Harness17 Sep 2026
- 2026CyberFactory: Scaling Cyber Security Capabilities with Instances from the Wild24 Aug 2026
- 2026Graph Engineering in the Era of LLM Agents: From Individual Intelligence to System Intelligence21 Aug 2026
- 2026From Agent Behaviour to Agent-Friendly Documentation: An Empirical Study of How Coding Agents Discover, Read, and Write Technical Documentation20 Aug 2026
- 2026Screenshots or Tools? Eliciting Tool Use and Managing Multimodal Context in Hybrid GUI-MCP Computer-Use Agents4 Aug 2026
- 2026CodeNib: A Multi-View Data System for Serving Repository Context to Coding Agents28 Jul 2026
- 2026CoACT: Action-Preserving Observation Compression for Coding Agents3 Jul 2026
12 newest of 26 All 26 (JSON)
- 2026SAM: State-Adaptive Memory for Long-Horizon Reasoning Agentcited by 10
- 2026SWE-Edit: Rethinking Code Editing for Efficient SWE-Agentcited by 3
- 2026LEAD: Breaking the No-Recovery Bottleneck in Long-Horizon Reasoningcited by 1
- 2026Track, Rank, Crack: Epistemic Working Memory Scales Multi-Hop Reasoning in Language Agentscited by 1
- 2026LongHarness Bench: Stress-Testing Language Model Harnesses for Long-Context Reasoningcited by 0
- 2026LongHarness Bench: Stress-Testing Language Model Harnesses for Long-Context Reasoning29 Sep 2026
- 2026Track, Rank, Crack: Epistemic Working Memory Scales Multi-Hop Reasoning in Language Agents14 Jul 2026
- 2026SAM: State-Adaptive Memory for Long-Horizon Reasoning Agent23 May 2026
- 2026SWE-Edit: Rethinking Code Editing for Efficient SWE-Agent28 Apr 2026
- 2026LEAD: Breaking the No-Recovery Bottleneck in Long-Horizon Reasoning6 Mar 2026
- 2026daVinci-Env: Open SWE Environment Synthesis at Scalecited by 13
- 2026On Training Large Language Models for Long-Horizon Tasks: An Empirical Study of Horizon Lengthcited by 5
- 2026Conversation Tree Architecture: A Structured Framework for Context-Aware Multi-Branch LLM Conversationscited by 0
- 2026The Time is Here for Just-in-Time Systems: Challenges and Opportunitiescited by 0
- 2026AutoFyn Technical Report: Non-Parametric Expert Iteration for Long-Horizon Agentscited by 0
- 2026Context Language Modelscited by 0
- 2026Context Language Models29 Sep 2026
- 2026AutoFyn Technical Report: Non-Parametric Expert Iteration for Long-Horizon Agents31 Jul 2026
- 2026The Time is Here for Just-in-Time Systems: Challenges and Opportunities22 May 2026
- 2026On Training Large Language Models for Long-Horizon Tasks: An Empirical Study of Horizon Length4 May 2026
- 2026Conversation Tree Architecture: A Structured Framework for Context-Aware Multi-Branch LLM Conversations22 Mar 2026
- 2026daVinci-Env: Open SWE Environment Synthesis at Scale13 Mar 2026
Similar, not cited
Close in wording, no citation either way
- 2026SWE Context Bench: A Benchmark for Context Learning in Coding
- 2026Context as an Environment: Programmatic Context Management for Long-Horizon Agents
- 2026ContextWeaver: Selective and Dependency-Structured Memory Construction for LLM Agents
- 2026ContextPilot: Teaching Agents for Proactive Context Management via Fine-grained RL
- 2025Prometheus: Towards Long-Horizon Codebase Navigation for Repository-Level Problem Solving
- 2025LoCoBench-Agent: An Interactive Benchmark for LLM Agents in Long-Context Software Engineering
- 2026The Limits of Long-Context Reasoning in Automated Bug Fixing
- 2025AgentProg: Empowering Long-Horizon GUI Agents with Program-Guided Context Management