git-harness:把会话、快照、记忆全部变成 Git 提交的编程 Agent 框架
Everything Is a Commit: git-harness, a Git-Native Coding Agent Harness
开源的 Git 原生 Agent 框架,回滚对话和代码就是一次 git checkout,还能导出 bundle 完整复现一次运行。跟 Pi 在 Terminal-Bench 上打平但成本便宜 16%,做 Agent harness 的开发者可以直接抄它的设计。
git-harness 是一个开源、零依赖的 coding agent harness,直接构建在 Git 的对象模型和 plumbing 之上,代码发布在 GitHub(HJSang/git-harness)。它把每一轮对话、工作区快照、卸载的工具输出和子 Agent 分支都变成隔离命名空间中的不可变 Git 对象,宿主仓库不受影响。
现有 harness 通常用独立日志和可变目录分别实现会话树、文件快照、上下文压缩、子 Agent worktree 和记忆文件夹,导致回滚文件时对话历史失同步、重写前缀使 KV-cache 失效。git-harness 用单一存储实现原子化的对话与代码回滚、只增不改的 prompt 前缀、被压缩历史的精确召回,以及单文件 Git bundle 级别的可复现性。
基准方面,在 Terminal-Bench v2.1 的 89 个任务上,git-harness 与 Pi 打平(79/89 对 76/89,p=0.549),中位耗时 68.5s 对 72.9s,平均 API 成本降低 16%($0.238 对 $0.282),Git 开销仅 0.55%,89 次运行全部导出有效取证 bundle。跨 240 次、四款前沿模型的测试中,Opus 5.5 上最高拿到 14/15,且零 Anthropic 超时。
Everything Is a Commit: git-harness, a Git-Native Coding Agent Harness
Production coding agent harnesses routinely reinvent five subsets of version control: session trees, file snapshots, context compaction, subagent worktrees, and memory folders. Because these subsystems live in separate logs and mutable directories, rewinding files desynchronizes conversation history and rewriting prefixes invalidates KV-caches. We present git-harness, an open-source, zero-dependency coding agent harness that builds directly on Git's object model and plumbing. Every turn, workspace snapshot, offloaded tool output, and subagent branch becomes an immutable Git object in an isolated namespace, so the host repository stays untouched. This single store provides atomic conversation-and-code rewind, append-only prompt prefixes, exact recall of compacted history, and single-file Git bundle reproducibility. On the 89-task Terminal-Bench v2.1 sweep, git-harness matches Pi ($79/89$ vs.\ $76/89$, $p = 0.549$), runs at $68.5\,\mathrm{s}$ vs.\ $72.9\,\mathrm{s}$ median duration, and lowers mean API cost by $16\%$ (\$0.238 vs.\ \$0.282; median \$0.150 vs.\ \$0.141). It adds only $0.55\%$ median Git overhead and exports valid forensic bundles on all 89 runs. Across 240 cross-harness trials spanning four frontier models, git-harness remains competitive (up to $14/15$ on Opus 5.5 with the updated runtime) with zero Anthropic timeouts and shows where harness designs differ in cost, latency, and failure modes. Code is available at https://github.com/HJSang/git-harness.
This report is categorized under AITOP's "Papers" desk. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows. Key entities and technical topics under continuous tracking include git-harness, Terminal-Bench, Git, coding assistants.
Primary source verification: published directly by arXiv: Anthropic with first-party authority. Cross-source corroboration: 11 independent sources have covered this development (including IT之家, Lxfater, Blognone), confirming industry-wide signal strength.