← Back to all posts

Jujutsu Is the Version Control Agents Actually Need

Git was designed around a human who decides when to stage, commit, and babysit a conflicted rebase. Coding agents do none of those things — they edit dozens of files, commit when the prompt says so or never, and run in parallel. Jujutsu's automatic working-copy commits, stable change IDs, operation log, first-class conflicts, and shared workspaces map directly onto the failure modes agents produce. Git is not the wrong tool; it is the wrong shape, and the cost of trying jj is one colocated init.

jujutsujjversion-controlgitai-agentscoding-agentsclaude-codeoperation-logfirst-class-conflictsworkspaceschange-idsrevsetsreversibilitysoftware-craftessay

An agent fixes a failing test. The fix is wrong, or right for the wrong reason, but before you can tell, it keeps going — forty files across six packages, a migration, a leftover debug print, and a git commit -m "fix tests" that sweeps all of it into one blob. Then it says it's done.

You now have four questions, and git answers each of them badly. What exactly did it change, step by step? Which of those steps was the mistake? Can I remove that one step and keep the rest? Where did the working state from two minutes ago go?

The usual answers are git reflog, git stash, git diff HEAD~1, and asking the agent to try again. Those are archaeology and re-runs. They are workarounds for a version control model that assumes something you are no longer doing: deciding, by hand, when a unit of work begins and ends.

That is the argument for Jujutsu. Not that git is a bad tool — it is a remarkable one — but that the assumptions built into it were shaped by human habits, and the habits changed.

The grid git was built for

Git's model has vertices that only make sense if a person is standing in front of the terminal. The index exists so you can choose a moment to freeze a subset of your files. HEAD is a mutable pointer to a branch, and a branch is a name that can be checked out in exactly one worktree — the docs are explicit about it, which is why parallel work means parallel clones or a rebase that can only happen in one directory at a time. Conflicts abort commands and leave the repository parked in a half-finished operation (rebase in progress, merge in progress) that someone has to supervise.

None of these are defects. They are a design around a human's attention span. Git makes committing a decision, which is a fine thing to tax when the alternative is a free-for-all.

Then the committer stopped being the person running the commands. An agent edits in bursts, commits when its instructions mention committing or not at all, and creates N parallel streams of work because the cheapest way to get throughput is to run several at once. In that world the three questions that matter are not "how do I stage this?" but these:

  • Is every intermediate state of an agent's work recoverable, without the agent having cooperated?
  • Can I undo one step of a long chain without surgery?
  • Can several agents share one history without stepping on each other's branches?

Git can be made to answer all three with discipline: commit often, rebase carefully, one worktree per agent. The discipline is real work, and it is exactly the work the model was supposed to remove.

What jj changes, and why it matters more now

Jujutsu keeps the same storage underneath — its Git backend is production-ready, and a "colocated" repo holds .jj/ and .git/ side by side. What it changes is the model on top. Four pieces of that model line up with agent failure modes with a precision that is hard to call a coincidence.

There is no staging area, and the working copy is always a commit. Every jj command snapshots the files in the working copy into the current change, @. An agent does not have to commit for its work to have an identity: it only has to run any jj command, and its in-progress state is diffable and recoverable. Compare that to a git worktree, where an agent's uncommitted edits are invisible to every log outside that directory. The gap between the agent's last jj command and now is the only window you can lose.

Change IDs survive rewrites. A Git commit hash changes when you rebase or amend. A jj change ID does not — the commit hash moves, the logical change stays addressable. jj evolog shows every state a change has been in. When an agent has taken an hour of wrong turns, this is the difference between "show me the history of this one change" and "read the reflog and hope."

The operation log makes undo a repository-wide verb. jj undo reverts the last operation — any operation, not just a ref update. jj op restore returns the whole repo to an earlier state, and --at-op lets you inspect how it looked at any point. The project is proud of this in a way that is telling: version control has "finally entered the 1960s." Git's reflog is per-ref, so recovering from a mistake spread across branches and working copies is a puzzle. jj records the puzzle's solution as it happens.

Conflicts are data, not interruptions. A conflicting rebase in jj succeeds and records the conflict inside the commit, to be resolved later. You can rebase a conflicted commit, move it, and resolve it after the fact. This is the single most useful property when agents run in parallel: one agent's change can be rebased onto another's without the rebase halting on a file both touched, because the conflict can wait for whoever is available to see it — including the agent on the next turn.

And the parallelism story composes. jj workspace add creates extra working copies backed by the same repo, and since 0.46 each one is a real Git worktree, so IDEs and build tools still see a git repo. The difference is where the work lives: each agent's directory is a change in one shared graph, and the main checkout can jj rebase every agent's stack and jj diff -r any of them while they keep running. With git worktrees, that bookkeeping is yours — branch per worktree, rebase inside each one, recover whatever the agent did not commit.

This is not a theory. People running several coding agents at once have started writing down the same conclusion independently — see One History, Many Agents for a careful version with the failure modes shown. The convergence is the interesting part: practitioners arrive at jj from a productivity problem, not from an ideology about version control.

The part I would not skip

Jujutsu's README calls itself experimental, and it means it. Git compatibility is stable; the rest is a moving target. There are no submodules, no hooks, no LFS or .gitattributes support, and no partial clone. Interleaving mutating git and jj commands in a colocated repo can produce divergent changes — confusing, not corrupting, but confusing. And the sharpest risk: agents know git far better than jj, and will reach for git commit and git checkout out of habit. Rules in a prompt get skipped, so the ones that matter need enforcing — a JJ_EDITOR=false so a missing -m fails instead of hanging on an invisible editor, a hook that blocks pushes, a convention that writes go through jj and reads can stay git.

There is also a subtler cost: jj asks you to unlearn things. No staging area, no git switch -, a different mental model of what "where am I" means. If you have spent a decade building muscle memory around git, the first week is friction, not progress.

So the honest claim is narrower than "jj is better." It is that the cheapest safety property you can buy when agents write your code is cheap reversibility, and jj is built around reverse-engineering it as a first-class operation instead of an archeological one. Git made committing a decision made by a person about to do a careful thing. jj makes the working state an observation: it is already recorded, and undoing it is a command, not a recovery.

That is worth trying precisely because it is cheap to try. jj git init in an existing checkout makes a colocated repo; your remotes, bookmark names, and Git tooling keep working, and your teammates never have to know. The experiment costs ten minutes and is reversible for the same reason the post exists.

The agents already changed how you write code. It is not obvious that your version control should be the one part of the stack that did not change with them.