arrow_back Back to AIFC
H
pending Claude

Shepherd: Stanford and Northeastern's Git-Like Runtime for Rewinding AI Agents Mid-Run

Grounded / Real Inflated / Uruttu
90% real
10% uruttu
article Original Content
Stanford researchers did it again.
They built the agent-native version of Git.
When an agent works on a longer task, the run builds up a lot of state, like files it edited, a dev server, a database, installed packages, and the KV cache.
Say the agent is at step 10 and misreads a traceback, then rewrites a file that was actually fine.
Tests start failing and the run goes off track, even though everything through step eight was correct.
By default the agent just tries to fix it, which creates more edits and tool calls, burning tokens and growing the context.
The other option is restarting from step one, which pays for every model and tool call again and re-prefills the context. And since a run is non-deterministic, it doesn't reproduce the same early steps anyway.
Jumping back to step eight is hard because the trajectory is only a message log. It records what the agent said and which tools it called, but not the live state underneath.
Git can version the files, but not the running process or the cache. Checking out step eight moves the files back while the process still sits in step-ten memory with a cold cache.
Shepherd is a runtime layer by Stanford that records the run as a trace of typed events instead of a flat log.
Each agent-environment interaction becomes a commit, similar to Git, except the commit covers the agent process and the filesystem together, copy-on-write.
So a branch carries the actual state and not just the files, and going back is a single call that forks from that commit and continues from there.
The fork is roughly five times faster than docker commit, and because the prompt prefix through step eight is unchanged, over 95% of the KV cache is reused on replay.
Once the run can be forked, a meta-agent can sit on top, watch the trace, and revert as soon as it looks wrong, before the bad write is committed.
Not everything is reversible though.
Files and sandbox changes undo themselves, but a database write needs a matching undo step set up in advance, and something external like a sent email or a real charge can't be undone at all.
On CooperBench, where two agents work on the same codebase, adding a live supervisor took the pair-coding pass rate from 28.8% to 54.7%.
The project is still labeled alpha, and the benefit mostly shows up when a run gets branched a lot over a heavy sandbox state.
If Git made file changes reversible, Shepherd is trying to do the same for a live agent run.
verified Validated Content
  • Shepherd is real — released August 8, 2026, by researchers from Stanford and Northeastern (the post attributes it to Stanford alone, which is a minor omission — Northeastern is an equal co-affiliation on the paper, not a footnote).
  • "5x faster than Docker commit/fork" — confirmed, this is the paper's own reported number.
  • ">95% KV-cache reuse on replay" — confirmed, matches the paper directly.
  • CooperBench pair-coding pass rate 28.8% → 54.7% with a live supervisor — confirmed, exact match to the paper's headline result.
  • Copy-on-write commits covering process + filesystem together, fork-and-continue instead of restart — accurately describes Shepherd's design (a Git-like trace of typed events, forkable, restoring "byte-identical" state).
  • "Not everything is reversible" (external side effects like emails/charges can't be undone) — consistent with the paper, which notes Shepherd enforces syscall-level refusal for irreversible real-world actions rather than claiming to roll them back.
  • "Still labeled alpha" — confirmed by third-party coverage (early alpha, MIT license, pip install shepherd-ai).
  • One omission worth flagging: the post doesn't mention Shepherd's other two showcased use cases (counterfactual meta-optimization beating baselines by up to 11 points/58% faster, and Tree-RL training lifting TerminalBench-2 from 34.2% to 39.4%) — not wrong, just a narrower slice of the paper's actual results, focused on the one number.