The paper addresses agents based on large language models working on real-world software engineering tasks that require long-horizon interaction with repository-scale codebases. It argues that 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.

In response it proposes Context as a Tool (CAT) (CAT), a context-management paradigm that elevates context maintenance to a callable tool integrated into the agent’s decision-making. To support context management for software engineering agents, the authors also propose a trajectory-level supervision framework, CAT-GENERATOR, and use it to train a context-aware model, SWE-Compressor, which they evaluate on SWE-Bench Verified.

Key Points

  • CAT formalizes a structured context workspace made up of stable task semantics, condensed long-term memory, and high-fidelity short-term interactions.
  • Under CAT, agents proactively compress historical trajectories into actionable summaries at appropriate milestones, rather than relying on passively triggered compression.
  • CAT-GENERATOR is based on an offline data-construction pipeline that injects context-management actions into complete interaction trajectories.
  • On SWE-Bench-Verified, SWE-Compressor reaches a 57.6% solved rate and, according to the authors, significantly outperforms ReAct-based agents and static compression baselines while maintaining stable long-horizon reasoning under a bounded context budget.

Notes

The paper was submitted to arXiv on 26 December 2025 and is listed under Computation and Language (cs.CL).