Everything Is a Commit: git-harness, a Git-Native Coding Agent Harness: what it means for business leaders
A coding agent harness that stores every conversation turn, file snapshot, subagent and memory update as Git objects matches an established harness on Terminal-Bench while making each run rewindable and auditable from a single file.
1. What the method is
git-harness is an open-source coding agent harness, written in TypeScript with zero npm dependencies, that keeps all agent state in Git's own object database instead of in custom logs and folders. Each turn becomes one immutable commit holding the conversation events, the exact working tree after the step, and token and cache metadata. These commits sit on refs in an isolated namespace and are written through a private shadow index, so the user's branches, staging area and git status are untouched. Oversized tool outputs are stored as blobs and replaced in the prompt by a short preview and a pointer. Subagents run on their own branches and worktrees and are merged back as second parents. Memory and skills live on dedicated branches behind deterministic pre-commit gates. Every run also exports a single-file Git bundle.
2. Why the method was developed
Production harnesses such as Claude Code, Codex and Pi each rebuild five pieces of version control: session trees, file snapshots, context compaction, subagent worktrees and memory folders. They keep them in separate logs and mutable directories, and the paper traces recurring failures to that split. Rewinding files without rewinding the conversation leads the model to hallucinate edits. Rewriting earlier parts of the prompt invalidates the provider's cache on long runs. Dropping a failed subagent destroys the trace needed to diagnose it. Unvalidated notes written into mutable memory folders allow one session to poison the next. Earlier Git-flavoured work, Git Context Controller, used Git only as a metaphor over markdown directories inside the workspace, and Prime Agent relies on custom disk persistence with unvalidated skill updates. The author argues all five subsystems are special cases of Git's content-addressed model.
3. Who should care
Engineering leaders who run coding agents against our repositories should care most, because the design answers whether an agent run can be undone cleanly and reconstructed afterwards. Platform teams that build or customise internal agent tooling get a reference architecture that depends only on system Git and built-in SQLite. Security and compliance functions get a commit-level audit trail of what an agent read, wrote and delegated, plus gates that reject leaked keys before they reach persistent memory. Finance and whoever owns our model API budget should note the cost findings: output and thinking tokens, not prompt size, drove nearly all spend in the Anthropic trials. Teams that evaluate models or vendors should note that the paper found provider safeguards and harness wire-protocol bugs moving benchmark scores independently of model capability.
4. How the method works
The storage layer passes Git a private index file, runs add and write-tree into it, and commits the resulting tree with the turn's events; non-Git workspaces get a detached Git directory, and read-only steps reuse the parent's tree instead of rehashing. The prompt is built by walking only first-parent links back to the nearest compaction anchor. Because commits are immutable and subagent merges attach as second parents, each step's prompt is a byte-identical prefix of the next, which is what provider caches need. The runtime exposes four tools (read, write, edit, bash) with parallel execution of read-only calls, plus an optional persistent Python session. Subagents communicate with the parent only at spawn and merge, which gives up mid-flight steering in exchange for no ref races and full provenance. A disposable full-text index, rebuilt from Git objects, recalls compacted or abandoned history verbatim.
5. How it was evaluated
The evaluation has four parts. Microbenchmarks measure commit latency as repository size grows, and four deterministic synthetic scenarios isolate context reduction, cache retention, recall after compaction and subagent handoff. The main comparison runs git-harness against Pi on all 89 Terminal-Bench v2.1 tasks with the same reasoning endpoint, timeouts and sandboxes. A single-seed ablation on the 15 most feature-active tasks switches off blob offloading, stuck-loop guardrails and always-on subagents one at a time. A cross-harness matrix of 240 trials covers four models (Claude Opus 5.5, Claude Fable 5.2, DeepSeek v4.1, GLM 5.3) and five harnesses (git-harness, Pi, Prime Agent, Claude Code, Codex), four per model, on the same 15 tasks. The author reports exact McNemar and Wilcoxon tests and costs parsed from raw logs. The arXiv rendering we read dropped most numeric values, so we quote few.
6. How it performed
On the 89-task sweep git-harness matched Pi's pass rate with no significant difference, zero crashes and one timeout, finished faster at median and mean, and lowered mean API cost while median per-task cost was slightly higher. Cache hit rates were statistically indistinguishable from Pi's, so the append-only prefix is a structural guarantee, not a measured saving. All 89 runs exported valid bundles. Removing blob offloading nearly doubled mean wall time and coincided with three timeouts; turning off always-on subagents raised the pass rate and cut cost. On Fable 5.2 git-harness had the highest cost per pass of the four harnesses. The limits are material: one seed throughout, headline results from a second tuned pass on the same benchmark, inferred Anthropic prices, and memory gates covered only by unit tests. Our call: pilot the atomic rewind and bundle export on internal agent runs, but do not switch harnesses on this evidence. (Source: arXiv 2611.40368, 2026)
← Back to dossier index