Skip to content

The Jujutsu Guide for Agentic CodingLet your AI agents run wild. Undo anything, rewrite everything.

Jujutsu ( jj ) is a Git-compatible version control system with automatic snapshots, universal undo, and history rewriting that is both safe and intuitive. This practical guide shows Git users how to experiment fearlessly, recover from anything, and turn AI-generated changes into clean, reviewable history.

Why This Book Exists

Two decades with Git. Then AI coding agents led me to Jujutsu.

For years I never questioned Git. It was simply what you used. There was no real alternative and I never went looking for one. Then AI coding agents moved into my daily work and the rhythm changed.

Agents generate, rewrite, and discard large amounts of code in minutes. Git can’t keep up with that. I lost work I never meant to lose and couldn’t get it back. I ended up with histories too tangled to reorganize into anything a reviewer would want to read. A few times I broke the history myself, reaching for a Git command I only half understood.

Then I found Jujutsu, built on a different model. There’s no staging area: an edit is part of the history as soon as you make it. Any operation can be undone. Moving back through the history to edit an earlier change is as ordinary as editing the file in front of you. For the first time in years, version control felt calm.

But Jujutsu has a learning problem. I kept seeing people try it, only to slip back to Git within days. Its mental model isn’t Git’s, so a command translation table won’t save you. If all you do is replace each Git command with its Jujutsu equivalent, you’ll never understand what makes Jujutsu better. To really learn Jujutsu, you need a guide that starts with its concepts and follows them into a real development workflow with AI agents. Nobody had written one, so I did.

jj log output showing a change graph with change IDs, authors, timestamps and descriptions

What You’ll Learn

  • Think in changes and their revisions, not in commits. The model isn’t Git’s, and it makes more sense than Git’s once it lands.
  • Handle history with the evolution log for a change’s past states and the operation log for every command you ran. Say goodbye to reflog archaeology.
  • Turn piles of AI-generated code into clean, reviewable history.
  • Work in parallel with tasks and AI agents using workspaces.
  • Fearless history integration: resolve conflicts safely and intelligently with jj.
  • Ship your work to GitHub and collaborate with Git-based teams as usual.
About The Style Of This Book

The dialogue isn’t decoration. It’s how the book teaches.

Juju-chu! is written from beginning to end as a dialogue between two engineers. A senior who knows Jujutsu inside out, and a junior who keeps asking why.

When a question forms in your head, chances are the junior asks it too. “If you don’t control when commits happen, doesn’t your history end up chaotic?” “If I edit an earlier change, don’t I have to rebase everything after it?” Misconceptions get corrected as they arise, and edge cases get discussed in the conversation instead of being buried in footnotes.

Teaching through dialogue is about as old as teaching gets. Plato wrote The Republic this way, Confucius’s students recorded the Analects this way, and The Little Schemer still does it today. In Japan it’s how my Riakuto! series sold more than 40,000 copies. Read the sample and see whether it reads easily for you.

Dialogue between the senpai and the kōhai, as it appears in the book

Chapter Overview

Chapter 1

What Kind of Tool Is Jujutsu?

Git was designed for human teams: write carefully, then stage, organize, and merge. This chapter digs into which parts of that model start producing friction once an agent writes the code and you loop at machine speed.

Then comes Jujutsu’s answer: automatic snapshots, universal undo, first-class conflicts, and a command set that is intuitive and easy to remember. Jujutsu was built for starting loosely and tightening up afterward, which turns out to be exactly what the AI era needs.

Chapter 2

Let’s Try Jujutsu

After installation and setup, you’ll walk through a complete Jujutsu development workflow on a small project: creating changes, reading and rewriting history, and pushing your work. You’ll also meet Jujutsu’s three logs: the revision log, the evolution log that traces the history of a change, and the operation log that records repository operations.

Then comes the mental model that makes everything else click: what changes and bookmarks really are, and why working on anonymous branches is the norm in Jujutsu.

Chapter 3

Jujutsu × AI Workflow in Practice

This chapter shows how to configure Claude Code and Codex CLI to use Jujutsu instead of Git, and more importantly, to work according to Jujutsu’s mental model rather than simply translating Git commands.

Then you’ll put that setup into practice with Claude Code. The agent works in sensible change units, pushes its work, and opens a PR. You’ll also deliberately give it mixed tasks and learn how to reorganize the result into clean history yourself. Finally, you’ll run multiple agent sessions in parallel workspaces and merge their results back together.

Chapter 4

Advanced Jujutsu Techniques

Start with revsets and filesets, the query languages for selecting exactly the revisions and files you mean, then meet three power-user commands: jj absorb, which sends fixes back to the changes they belong to, and the newer jj arrange and jj bookmark advance.

From there you’ll learn how to run your own pre-push tasks at push time, cut down manual conflict resolution with Mergiraf and Weave, and get a look at two UI tools: jjui and JJ View.

Chapter 5

The Jujutsu Problem-Solving Guide

The FAQ answers the questions Git users keep asking: why there’s no merge or pull command, how to do the equivalent of cherry-pick, how to keep temporary files out of your history, and whether Jujutsu is really just a wrapper around Git.

Then come the problems that stop you cold. A plain push that silently becomes a force push. A working copy is stale error. A change that picked up a divergent annotation. And your working-copy commit wandering off after you merge a PR and fetch the result.

Free config files: make your AI agent use Jujutsu instead of Git

Who This Book Is For (And Who It Isn’t)

You’ll get the most out of Juju-chu! if:

  • Your AI agent writes most of your code, and stopping to stage and manage each wave of changes in Git feels like unnecessary friction.
  • You’ve lost work and couldn’t get it back, whether from an accidental git reset --hard, a stash you lost track of, or a Git command your agent ran on its own.
  • Cleaning up huge AI-generated diffs is a chore, and when something goes wrong, Git has too many commands and edge cases to keep in your head.
  • You still hold your breath during a Git rebase, worried that a conflict will turn into a mess or that one wrong move will break the history.
  • You’re curious about Jujutsu, but want to understand how it really works and how to fit it into daily AI-assisted development, not just memorize a list of commands.

This book is probably not for you if:

  • You are completely new to Git and GitHub. This book assumes you can already use Git, and picks up from there.
  • You wield reflog and interactive rebase with absolute confidence, and feel your Git workflow has zero friction.
  • You don’t use AI coding agents at all. The book focuses on where Jujutsu shines most: development alongside AI agents, so some parts may not resonate with you.
Yuka Ooka
About The Author

Written by Yuka Ooka

Yuka Ooka is a Japanese web engineer and technical author. Her React + TypeScript series Riakuto! (りあクト!) has sold more than 40,000 copies.

She worked at Rakuten and other Japanese companies as her focus moved from PHP to Ruby on Rails to React, with a detour as a product manager on a job-listings product. She went freelance in 2016, one of the earlier React adopters in Japan, and took on client work as a React specialist. Training new engineers on those teams is where Riakuto! came from.

Her latest book, Juju-chu!, is the world’s first book dedicated to the Jujutsu version control system, and to pairing it with AI coding agents like Claude Code.

The full story

Get the Book

  • Recommended

    PDF + EPUB

    From$12USD
    • DRM-free PDF and EPUB, both included
    • Copyable, searchable command listings
    • Free updates to this edition
    • The best way to support the author
    Buy on Leanpub
  • Kindle

    $12USD
    • Read across Kindle devices and apps
    • Reflowable text with syncing and notes
    • Instant delivery to your Kindle library
    Buy on Amazon
  • Paperback

    $18.50USD
    • The only way to get a physical copy
    • 160 pages, 6 × 9 in—easy to keep beside your keyboard
    • Printed and shipped by Amazon in your region
    Buy on Amazon

Frequently Asked Questions

Do I need any prior experience with Jujutsu?

No. The book starts with installation and builds up from there—no prior familiarity assumed. Kanae, the junior engineer in the dialogue, has never touched Jujutsu either, so you learn alongside her.

That said, it’s not only for complete newcomers to Jujutsu. If you’ve tried it before and bounced off the gap between Git’s mental model and Jujutsu’s, the book spends real time closing that gap: what a change really is, why commit IDs change while change IDs stay put, and where your Git instincts will mislead you.

Do I need to know Git?

Yes—this is the one prerequisite. Juju-chu! assumes you’ve used Git day to day: cloning, branching, committing, pushing, and opening pull requests. Much of the book explains Jujutsu by contrasting it with Git, so those comparisons only land if Git already feels familiar.

What you don’t need is Git mastery. If reflog is a mystery to you and interactive rebase makes you nervous, you’re exactly who this book was written for.

Do I have to make my whole team switch from Git?

No. Jujutsu works directly with an existing Git repository, so you can adopt it on an existing project without touching anyone else’s setup. What you push to GitHub is ordinary Git commits: your teammates keep using Git, review your pull requests as usual, and never need to know you switched.

That makes Jujutsu unusually low-risk to try. The decision is yours alone, and it’s reversible. The Git repository stays exactly where it is while you work in Jujutsu, so you can drop down to a git command any time you need one.

Do I need Claude Code or Codex?

No. The book uses Claude Code and Codex CLI as its worked examples, but nothing about the Jujutsu side is specific to either one.

The Codex setup is built on AGENTS.md and skills—open conventions that Cursor, OpenCode, and other agents also read. So the rules and instructions in the book carry over with little more than a change of filename. What you’re really learning is how to teach an agent to use Jujutsu instead of Git, and that carries over from tool to tool.

Which version of Jujutsu does the book cover?

Jujutsu v0.45.1, released in September 2026. Every feature and limitation described in the book is as of that version.

Jujutsu is still pre-1.0 and moves quickly, so some details will inevitably shift. But the book goes past command usage into Jujutsu’s design philosophy, its mental model, and how to apply both to AI coding. Those are the parts that are hardest to pick up from release notes, and they should stay useful well past the next few releases.

Will the book be updated?

Yes, within limits. If a change in Jujutsu leaves the book’s instructions no longer accurate, I’ll revise the affected sections. I’ll also fix errors and rewrite anything that could be explained better.

This is a finished book, not a continuously expanding reference. Updates keep the existing material accurate; they won’t chase every new Jujutsu feature or reorganize the book.

Leanpub readers get these updates at no extra charge, and Leanpub emails you by default when a new version is out. Amazon won’t notify you, and there’s no way to tell from your Kindle library whether a newer file exists, so the only reliable move is to remove the book and download it again. The paperback is printed on demand, so revisions reach copies printed after the update.

Which edition is right for me?

PDF and EPUB (Leanpub)—carefully typeset with embedded fonts and completely DRM-free. The PDF preserves the full page design, while the EPUB reflows for smaller screens without sacrificing the book’s typography. If you care about how a technical book looks and reads, or you want to keep the files somewhere Amazon can’t reach, this is the one.

Kindle (Amazon)—the right pick if your reading life already lives in the Kindle app and device. The text reflows to fit your device, though some of the original typography is inevitably lost.

Paperback (Amazon)—6 × 9 inches, 160 pages, and the only way to get Juju-chu! in print.

If you’d rather see the book before deciding, there’s a free 43-page sample. The button at the top of this page opens it right here, no download needed.

And if you’re wondering which purchase supports me more directly: I keep a slightly larger share of a Leanpub sale than a Kindle sale. Buy wherever suits you, but if it’s a coin flip, that’s the tiebreaker.