Skip to content
Go back

Use Jujutsu, Not Git: Why Your Next Coding Agent Should Use Jujutsu

Published: Jul 7, 2025
Punta Cana, Dominican Republic

Coding agents are here, and they’re changing how we write software. They can plan features, write code, and even fix bugs. But if you’ve ever watched one work, you know the process is rarely linear. It’s a chaotic loop of trial, error, and refinement. The agent generates a block of code, tests it, finds it’s wrong, and tries again.

This workflow breaks the mental model of our most foundational developer tool: Git. Git is a finely-tuned instrument for crafting history, a ‘sharp knife’ for experts who meticulously rebase, fixup, and squash commits. It was designed for humans. For an autonomous agent, it’s a minefield of footguns: confusing states like ‘detached HEAD,’ complex interactive prompts, and a staging area that adds another layer of complexity.

We need a version control system (VCS) built for a new kind of developer—an AI. That VCS is Jujutsu (jj).

Jujutsu isn’t just a simpler Git. It’s a fundamental reimagining of version control, prioritizing safety, automation, and a more intuitive data model. These principles make it the perfect backbone for orchestrating coding agents. Let’s explore how.

Learning Jujutsu: The Git Command Table

If you’re coming from Git, the official Jujutsu documentation provides an excellent Git command table that maps familiar Git commands to their Jujutsu equivalents. This cheatsheet covers everything from basic operations like git initjj git init to advanced workflows like interactive rebasing. It’s an invaluable resource for understanding how your Git muscle memory translates to Jujutsu’s more streamlined approach.

1. The ‘Snapshot and Revert’ Workflow: Frictionless Experimentation

In a recent discussion, engineer Mitchell Hashimoto described his workflow for guiding an agent:

‘I’ll just be like, snapshot at this point, and then continue… instead of saying undo that, I’ll undo it on the commit and say you’re back at the previous state, let’s try that again.’

This loop—snapshot, attempt, revert—is the core of agentic development. Trying to do this in Git is clumsy, involving a mix of git stash, git commit --amend, and git reset. In Jujutsu, it’s the default behavior.

Rationale: Jujutsu automatically creates commits from your working copy whenever you run most commands. There’s no staging area and no need for a commit message just to save your work. This creates low-friction, lightweight checkpoints.

How an Agent Supervisor Uses It:

# 1. The agent has written some initial code.
# The supervisor runs `jj st` to create a "snapshot" of the working copy.
# This creates a new, anonymous commit with the changes.
$ jj st
Working-copy commit:
rsvoosqŋ 2f31f9d4 (no description set)

# 2. The agent is instructed to try a risky refactoring. It modifies files.
# The code doesn't work. The supervisor needs to revert.

# 3. The supervisor simply runs `jj undo`.
$ jj undo
Working copy now at: qpvuntsm 295195b0 (no description set)

# The repository is instantly back to the state before the failed attempt.
# The agent is ready to try a new approach from a known-good checkpoint.

This simple, powerful loop lets a supervising process guide an agent through complex tasks by allowing it to experiment safely, without the operational overhead of traditional Git commands.

2. Automated History Surgery: Cleaning Up the Mess Programmatically

An agent’s raw output is often a stream-of-consciousness, not a clean history. A single coding session might mix new features, bug fixes, and random refactoring into one giant, messy change. A ‘reviewer’ agent needs a way to clean this up programmatically. In Git, this means scripting an interactive rebase (rebase -i), a notoriously difficult task.

Rationale: Jujutsu makes complex history manipulation a set of simple, non-interactive commands. An agent can be programmed to perform surgery on the commit graph with ease.

How a ‘Reviewer’ Agent Cleans Up History:

Imagine a coding agent produced one large commit with two unrelated changes: adding feature.go and fixing a typo in docs.md.

# The reviewer agent sees the messy commit.
$ jj log
@ rsvoosqŋ
 Add feature and fix docs typo
...

# 1. The agent splits the commit. `jj split` opens a diff editor, but for
# an agent, we can specify paths directly to split non-interactively.
$ jj split -r rsvoosqŋ --paths feature.go
Created rwvqtnlk: (empty) Add feature and fix docs typo
Working copy now at: yostzmxk Add feature and fix docs typo

# This automatically creates two new commits. One with feature.go,
# and the other with the remaining changes (the docs typo).

# 2. The agent gives the new commits proper descriptions.
$ jj describe rwvqtnlk -m "feat: Implement the new feature"
$ jj describe yostzmxk -m "fix(docs): Correct typo in README"

# 3. The final history is clean and logical.
$ jj log
@ yostzmxk
 fix(docs): Correct typo in README

o rwvqtnlk
 feat: Implement the new feature
...

Commands like jj split, jj edit, and jj squash allow a supervising agent to transform a chaotic development history into a professional, review-ready pull request based on simple rules, without ever touching a complex interactive prompt.

3. The Ultimate Safety Net: The Operation Log

Agents will make mistakes. They will get the repository into a state that seems hopelessly broken. Git’s reflog is the escape hatch for experts, but it’s cryptic and tracks only branch tip movements.

Rationale: Jujutsu has an operation log (oplog) that records every single action you take—every commit, edit, rebase, or undo. It’s a complete, user-friendly audit trail of your session. This makes it nearly impossible to lose work.

How an Agent Supervisor Recovers from Disaster:

Let’s say an agent accidentally abandons a critical commit.

# The agent was working on commit `rwvqtnlk` but accidentally abandoned it.
$ jj abandon rwvqtnlk
Abandoned commit rwvqtnlk

# The commit is gone!
$ jj log
@ yostzmxk
 fix(docs): Correct typo in README
...

# The supervisor can inspect the operation log to see what happened.
$ jj op log
o kmlprxqv abandon commit

@ zxsewqpw describe commit
...

# To recover, the supervisor finds the operation *before* the mistake
# and restores the entire repo state to that point.
$ jj op restore zxsewqpw
Working copy now at: rwvqtnlk feat: Implement the new feature

# The abandoned commit is back, and all work is saved.

The oplog is more than a backup; it’s a state machine for the repository. It gives a supervising system a bulletproof way to manage an agent’s session, ensuring that no matter what the agent does, there is always a simple, reliable path back to a known-good state.

Conclusion: A VCS Built for the Agentic Era

The rise of AI agents demands that we re-evaluate our tools. Git, for all its power, was built for a world of human-driven development. Its design philosophy of ‘sharp knives’ is a liability for autonomous systems that learn by doing.

Jujutsu offers a new philosophy, one built on safety, simplicity, and automation.

  • Frictionless Snapshots enable safe, rapid experimentation.
  • Declarative Commands allow for programmatic and reliable history cleanup.
  • The Operation Log provides a complete safety net, making catastrophic mistakes a thing of the past.

By removing the sharp edges and automating the tedious mechanics of version control, Jujutsu provides the ideal environment for AI agents to work. The next time you build a system to orchestrate a coding agent, don’t just reach for Git by default. Give your agent a tool that was designed for the way it thinks and works.

  Let an Agentic AI Expert Review Your Code

I hope you found this article helpful. If you want to take your agentic AI to the next level, consider booking a consultation or subscribing to premium content.