Source-linked AI summary
Git Context Controller: Manage the Context of LLM-based Agents like Git
Junde Wu, Minhao Hu, Jiayuan Zhu, Jiazhen Pan, Yuyuan Liu, Min Xu, Yueming Jin
TL;DR
Long-horizon agents face context that becomes costly to maintain and difficult to reuse across sessions. GCC organizes agent memory as a persistent, version-controlled workspace, and GCC-equipped agents achieve state-of-the-art performance on SWE-Bench and BrowseComp, including a 13.6% improvement for Claude-4-Sonnet on SWE-Bench to 80.2%.
Problem
For long-horizon workflows, context grows costly, session resets lose prior goals and instructions, and compression can remove details needed for concrete continuation.
Source: §1 · p. 1Method
Results
GCC-equipped agents achieve state-of-the-art performance on SWE-Bench and BrowseComp; on SWE-Bench, Claude-4-Sonnet improves by 13.6%, reaching 80.2%.
Source: §1 · p. 2Takeaways & Limitations
The results suggest that structured, Git-style memory is a key ingredient for effective long-horizon reasoning in autonomous agents.
Source: §5 · p. 8
Abstract
from arXiv · showhide
Large language model (LLM) agents have demonstrated strong capabilities in long-horizon tasks by interleaving reasoning with tool use. However, as these agents scale to complex workflows such as software engineering and open-ended research, context management becomes a fundamental bottleneck: interaction histories grow unbounded, become costly to maintain, and are difficult to reuse across sessions and agents. We introduce \textbf{Git-Context-Controller (GCC)}, a structured context management framework inspired by software version control systems. GCC elevates agent context from a transient token stream to a persistent, navigable memory workspace with explicit operations -- \texttt{COMMIT}, \texttt{BRANCH}, \texttt{MERGE}, and \texttt{CONTEXT}, that enable milestone-based checkpointing, isolated exploration of alternative reasoning paths, and hierarchical retrieval of historical context. By organizing agent memory as a versioned file system, GCC allows agents to manage long-term goals, recover and transfer reasoning across sessions, and coordinate multi-trajectory problem solving in a principled manner. Empirically, agents equipped with GCC achieve state-of-the-art performance on both SWE-Bench and BrowseComp benchmarks. On SWE-Bench Verified, GCC improves task resolution by over 13\% relative to strong long-context baselines and outperforms 26 existing open and commercial systems, reaching over 80\% success rate. The project will be open-sourced for the research community. https://github.com/ImprintLab/git-context-controller
1. Introduction
Long-horizon agents face context that grows costly and is difficult to reuse; GCC organizes agent memory as a persistent, navigable workspace managed with version-control operations. The paper reports state-of-the-art results on SWE-Bench and BrowseComp.
1. Introduction
- As long-horizon workflows grow, context becomes costly, session resets lose prior goals and instructions, and compression can erase fine-grained reasoning.The introduction characterizes context as either too verbose to reuse or too abstract for concrete continuation.Source: §1 · p. 1
- GCC-equipped agents attain state-of-the-art performance on SWE-Bench and BrowseComp: Claude-4-Sonnet gains 13.6%, reaching 80.2% on SWE-Bench, while GPT-5 reaches 83.4% on BrowseComp-Plus.Figure 1 compares baseline model performance with improvements from equipping models with GCC.Source: Figure 1 · p. 2, §1 · p. 2
- Its multi-level retrieval spans project plans to fine-grained OTA traces, while isolated branches support side exploration and cross-session and cross-agent continuity.Historical reasoning can be traced and reused, and divergent work can be revisited or merged into the primary workflow.Source: §1 · p. 2
- GCC frames agent memory as a dynamic, navigable codebase with log files, branching histories, and metadata, rather than passive history.This view treats context as an evolving, queryable interface for recall and structural reasoning.Source: §1 · p. 2
- GCC brings COMMIT, BRANCH, and MERGE version-control semantics into agents’ reasoning loops and stores memory as persistent, interpretable artifacts.Source: §1 · p. 2
2. Method
GCC externalizes agent reasoning into a persistent, version-controlled workspace and provides commands for checkpointing progress, exploring branches, merging results, and retrieving historical context. Its files separate project planning, branch summaries, execution traces, and metadata.
2. Method
- GCC organizes context in a version-controlled .GCC/ workspace, with files for global planning, branch histories, execution traces, and project metadata.The design pairs this structured file system with callable commands for managing and retrieving reasoning.Source: §2 · p. 3
2.1. GCC File System
- The file system separates a shared roadmap from branch-level commit summaries and execution traces, with metadata recording project structure and configuration.The roadmap tracks goals and milestones; commit summaries capture branch progress, while log.md records observation–thought–action cycles.Source: §2.1 · pp. 3–4
2.2. GCC Commands
- COMMIT turns recent reasoning into a persistent record containing branch intent, a regenerated summary of prior and new work, and a detailed progress description.It can also update the global roadmap and consolidate memory and code changes in a versioned state.Source: §2.2 · p. 4
- BRANCH creates an isolated execution trajectory from the latest committed state so agents can explore alternative hypotheses or workflows independently.The branch records its intent and remains inspectable and reversible through the commit-based memory mechanism.Source: §2.2 · p. 4
- MERGE synthesizes branch purposes and progress into a unified summary and detailed account of the merge, while updating the global roadmap.The resulting memory state is checkpointed as a new Git commit.Source: §2.2 · p. 4
- CONTEXT retrieves project or branch information at different levels, including bounded commit-history windows and specific commits, logs, or metadata.The commit-history window uses a fixed context budget and can be traversed through scrolling operations.Source: §2.2 · pp. 4–5
3. Experiment
The experiments cover software-engineering and web-research benchmarks, with shared context budgets and tools for baseline comparisons. The section describes datasets, implementation settings, and four long-context baselines.
3.1. Datasets
- The evaluation uses SWE-Bench and its 300-problem SWE-Benchlite subset for software engineering, and all BrowseComp-Plus instances for deep research.BrowseComp-Plus uses search and page-opening tools, with retrieval performed by Qwen3-Embed-8B.Source: §3.1 · p. 5
3.2. Implementation
- All comparison models use a 32,768-token context window, with up to 100 summarized archives or branches and a CONTEXT commit window of K = 1.For SWE-Bench, GCC is integrated with SWE-Agent.Source: §3.2 · p. 5
3.3. Baselines
- GCC is compared with ReAct, SWE-Agent, Summary Agent, and Folding Agent under matched models, data, tools, and evaluation settings where applicable.The baselines retain full history, summarize when context fills, or periodically fold reasoning into structured summaries; SWE-Agent is evaluated on SWE-Bench Verified only.Source: §3.3 · p. 5
4. Experimental Results
GCC outperforms controlled baselines on BrowseComp-Plus and SWE-Bench Verified, leads 26 systems on SWE-Bench-Lite, and combines component gains with structured inference behaviors. Its performance remains cost-efficient relative to the cited coding agents.
4. Experimental Results
- GCC achieves the best Pass@1 across model backbones on BrowseComp-Plus and SWE-Bench Verified; on BrowseComp-Plus with GPT-5, it scores 0.834 versus Folding Agent’s 0.815.Comparisons used identical model backends and tool APIs.Source: §4 · p. 5
4.1. GCC Performance-Efficiency on Coding
- 48.00% resolution on SWE-Bench-Lite ranks GCC first among 26 systems, ahead of CodeStory Aide at 43.00%.The comparison spans open-source, commercial, hybrid, and retrieval-only systems.Source: §4.1 · p. 7, Table 2 · p. 7
- GCC surpasses commercial systems while remaining protocol-driven, suggesting structured versioned memory can rival architecture-level tuning and proprietary engineering.The cited commercial systems draw on heavy engineering, test-harness integration, and custom model routing.Source: §4.1 · pp. 7–8
- $1.21 average task cost with Claude 3.5 Sonnet is comparable to or below SWE-Agent's up to $2.53 and CodeR's up to $3.34.The paper attributes the gains to structured tool use rather than brute-force trial-and-error or excessive tool use.Source: §4.1 · p. 8
4.2. Ablation and Analysis
- 80.2% on SWE-Bench Verified is the full system's best result; adding logs and CONTEXT retrieval raises performance from 69.1% to 75.3%.The sequence starts at 67.2% without structured memory, reaches 69.1% with RoadMap and COMMIT, then 77.8% after adding metadata; BRANCH and MERGE complete the 80.2% system.Source: §4.2 · p. 8, Table 3 · p. 8
- CONTEXT retrieval and RoadMap updates rise with inference steps and difficulty; branches increase then decline, while context length varies non-monotonically.The paper attributes context-length variation to periodic summarization and retrieval, and branch decline to convergence after exploration.Source: §4.2 · p. 8, Figure 3 · p. 8
5. Conclusion
The conclusion presents GCC as structured, version-control-inspired agent memory. It reports consistent performance gains and state-of-the-art results, suggesting Git-style memory is a key ingredient for effective long-horizon reasoning.
- GCC organizes agent memory through a structured framework inspired by version control.Source: §5 · p. 8
- GCC lets agents persist, retrieve, and explore reasoning trajectories through committing, branching, and merging.Source: §5 · p. 8
- Experiments show consistent performance gains and state-of-the-art results, suggesting Git-style memory is a key ingredient for effective long-horizon reasoning.Source: §5 · p. 8