Context as a Tool: Context Management for Long-Horizon SWE-Agents
Shukai Liu, Jian Yang, Bo Jiang, Yizhi Li, Jinyang Guo, Xianglong Liu, Bryan Dai

TL;DR
This paper introduces CAT, a new context management system for long-horizon software engineering agents, which improves reasoning stability and scalability by proactive context compression and structured memory, outperforming existing methods.
Contribution
The paper presents a novel context management paradigm called CAT, including a formal structure and a training framework, significantly enhancing long-term reasoning in SWE-agents.
Findings
SWE-Compressor achieves a 57.6% success rate on SWE-Bench-Verified.
Outperforms ReAct-based agents and static compression baselines.
Maintains stable, scalable reasoning under bounded context budgets.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
- 🤗IQuestLab/IQuest-Coder-V1-7B-Instructmodel· 2.2k dl· ♡ 172.2k dl♡ 17
- 🤗IQuestLab/IQuest-Coder-V1-7B-Thinkingmodel· 423 dl· ♡ 9423 dl♡ 9
- 🤗IQuestLab/IQuest-Coder-V1-40B-Instructmodel· 12k dl· ♡ 28912k dl♡ 289
- 🤗IQuestLab/IQuest-Coder-V1-40B-Loop-Instructmodel· 12k dl· ♡ 32412k dl♡ 324
- 🤗IQuestLab/IQuest-Coder-V1-40B-Thinkingmodel· 330 dl· ♡ 16330 dl♡ 16
- 🤗IQuestLab/IQuest-Coder-V1-40B-Loop-Thinkingmodel· 162 dl· ♡ 12162 dl♡ 12
- 🤗IQuestLab/IQuest-Coder-V1-7B-Basemodel· 113 dl· ♡ 10113 dl♡ 10
- 🤗IQuestLab/IQuest-Coder-V1-40B-Base-Stage1model· 23 dl· ♡ 2823 dl♡ 28
- 🤗IQuestLab/IQuest-Coder-V1-40B-Basemodel· 114 dl· ♡ 46114 dl♡ 46
- 🤗cyankiwi/IQuest-Coder-V1-40B-Instruct-AWQ-4bitmodel· 26 dl· ♡ 326 dl♡ 3
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAdvanced Software Engineering Methodologies · Multi-Agent Systems and Negotiation · Context-Aware Activity Recognition Systems
