GitHarness: Git Init Your Harness Working Memory for Perpetual User Requirements

Zhibang Yang, Xinke Jiang, Yuxuan Liu, Mingyu Zhang, Zhixin Zhang, Zhengxing Song, Yue Fang, Guohong Qiu, Ruiqing Li, Xu Chu, Junfeng Zhao, Yasha WangarXiv 2026

TL;DR

GitHarness introduces a Git-inspired version-control framework for LLM agent memory, allowing agents to navigate evolving user requirements by branching from historical states. By selectively reusing valid work and discarding obsolete information, GitHarness significantly boosts task performance while reducing token usage by up to 73% in complex, long-horizon tasks.

What Problem Does This Paper Address?

LLM agents are increasingly used for "long-horizon" tasks like software engineering or deep research. However, users rarely provide a perfect, static prompt at the start. Instead, requirements evolve through:

  • Completion: Adding missing details.
  • Elicitation: Introducing new dimensions based on intermediate results.
  • Shift: Revising or withdrawing previous instructions.

Existing agents typically handle this by either appending new chat turns (risking "stale" information) or restarting from scratch (wasting time and tokens). As shown in Figure 1, a simple request to change a visual detail can lead to a global rewrite that alters parts of the work that were already correct. The authors ask: How can an agent adapt to changing requirements while preserving unaffected work?

Figure 1: When user feedback changes the umbrella color or removes a report section, reusing all prior work leaves stale content, while regenerating everything may alter unaffected parts. Selective updating limits changes to the affected work.

Methods

The authors propose GITHARNESS, a pluggable framework that organizes an agent's working memory into a branchable version history. The system consists of three main components:

  1. The Git Agent: A specialized "manager" model that interprets new user feedback. It uses a ReAct-style loop to INSPECT past versions, COMMIT a new resolved requirement, or REUSE a historical state that already satisfies the user.
  2. Unified Version Interface: This maps Git-like operations (branch, commit, restore) onto the native memory of different agent harnesses (like OpenHands or StackPlanner).
  3. Branch Execution: Once a base version is selected, the system chooses an execution mode:
  4. EXACTREUSE: No new work needed.
  5. FRESHSOLVE: Start from an empty workspace.
  6. REUSEANDPATCH: Fork the historical state and apply only the necessary updates.

The framework is illustrated in Figure 2. Notably, the Git Agent is trained using Interface-level Reinforcement Learning (GRPO). This allows the "manager" to improve its decision-making without needing to retrain the underlying, often much larger, task-execution models.

Figure 2: Framework of GITHARNESS.

Datasets

The researchers introduced MTAGENTBENCH, a verifier-preserving benchmark designed for multi-turn interactions. It extends five existing domains:

  • GSM8K (Math): Multi-step arithmetic.
  • BIRD (SQL): Database-grounded text-to-SQL.
  • BrowseComp-Plus (Search): Agentic web search.
  • SWE-bench Verified (Code): Real-world GitHub issue resolution.
  • DeepResearch Bench (Research): PhD-level research synthesis.

The benchmark is "verifier-preserving" because, while requirements change over seven turns, the final state is semantically equivalent to the original task, allowing for objective evaluation using standard metrics.

Key Insights and Ideas

  • Memory as a Versioned Graph: The core "aha moment" is that version control is the ideal abstraction for agent memory. By treating feedback as a branch update rather than just a new chat message, the agent can "roll back" to the exact moment before a now-obsolete requirement was introduced.
  • Separation of Concerns: By decoupling requirement resolution (the "what") from task execution (the "how"), the Git Agent can focus purely on intent tracking.
  • Locality via Branching: The system achieves "local updates" naturally. By resuming from a compatible prior state, the agent is physically confined to editing only what the new requirement demands, preventing the "global rewrite" problem.

Key Results

GitHarness demonstrated superior performance and efficiency across all tested domains and model backbones (Qwen3 and DeepSeek-V4).

  • Efficiency Gains: Compared to native continuation, GitHarness reduced average token usage by 35.8% on SQL, 54.5% on Search, and a staggering 73.6% on Code tasks.
  • Performance Boost: In 30 different experimental settings, GitHarness outperformed the "Native" baseline every single time. As seen in Figure 3, it consistently occupies the "lower-right" quadrant of the performance-vs-cost graph, indicating higher accuracy at a lower API cost.
  • RL Effectiveness: Training the Git Agent via RL provided massive gains, improving a Qwen3-8B model's performance by 30 points on Math tasks (see Figure 4a).
Figure 3: Performance versus token usage under StackPlanner with DeepSeek-V4-Flash. Bubble area denotes estimated API cost; lower right is better.
Figure 4a

Limitations and Future Work

  • Interpretation Errors: The system's success relies heavily on the Git Agent's ability to accurately interpret ambiguous or conflicting user feedback. If the agent misidentifies the "best base," the downstream update agent cannot recover.
  • Preservation Guarantees: While branching helps, the framework does not strictly guarantee that an update agent won't accidentally modify unaffected files within a branch.
  • Future Directions: The authors suggest exploring uncertainty-aware clarification (asking the user for help when confused) and finer-grained dependency tracking between different parts of the accumulated work.

Summary updated

BibTeX
@misc{yang2026githarness,
  author = {Zhibang Yang and Xinke Jiang and Yuxuan Liu and Mingyu Zhang and Zhixin Zhang and Zhengxing Song and Yue Fang and Guohong Qiu and Ruiqing Li and Xu Chu and Junfeng Zhao and Yasha Wang},
  title = {{GitHarness: Git Init Your Harness Working Memory for Perpetual User Requirements}},
  year = {2026},
  eprint = {2609.36789},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.36789},
}
Figure