| name | jj |
| description | Stage and commit changes in a Jujutsu (jj) repository. Use when the user asks to commit, save, or record changes in a repo that has a `.jj/` directory (may be colocated with `.git/`). Covers the equivalent of `git add` and `git commit`. |
Using jj (Jujutsu)
jj has no staging area. Every jj command auto-snapshots the working copy, so all tracked changes are always "staged." There is no jj add — files not matched by .gitignore are tracked automatically.
Inspect changes (≈ git status / git diff)
jj status
jj diff --git
Always pass --git (or --tool=:git) when invoking jj diff from Claude's Bash tool. The user's default diff tool is git-diff-tui, which opens /dev/tty and fails with Os { code: 6, ... "Device not configured" } in a non-interactive shell.
Commit (≈ git commit -am "msg")
Always run jj status first. Because jj auto-snapshots the working copy on every command, an unrestricted jj commit -m "..." includes every tracked change — there's no git add step to filter intent. Unrelated edits (e.g. local config files touched by tooling during the session) will silently end up in the commit unless you check and either revert them or path-restrict the commit.
Only commit changes you worked on. If there are unrelated changes in the working copy, use the path-restricted form to commit only the files you modified, leaving the rest for the user to handle.
jj commit -m "message"
This sets the description on the current working-copy change (@) and creates a new empty change on top, leaving you with a clean working copy. It is the one-shot equivalent of git add -A && git commit -m "...".
To commit only specific paths (the rest stay in a new working-copy change on top):
jj commit -m "message" path/to/file ...
Just set the description, don't start a new change
jj describe -m "message"
Use this only when you plan to keep editing the same change — e.g. correcting the description before a jj commit actually closes it. After this, the change is still at @, so the next file edit auto-snapshots into it.
⚠️ Don't use jj describe -m to "finalize" a change between independent units of work. It does not advance the working copy. If you edit anything afterwards, those edits silently pile into the change you thought was finished, and you'll have to manually split commits. After every logical chunk of work, either:
jj commit -m "msg" — describes @ and advances to a fresh empty change, or
jj describe -m "msg" followed by jj new — same effect, two steps.
Either way, new work always lands in an empty working copy. If you find yourself reaching for jj restore --from @- to peel apart a commit, you skipped this step.
Notes for committing
- Follow the same commit-message guidance as for git: explain why, not just what.
- Don't pass
--no-verify-style flags; jj has no equivalent and there are no client-side hooks to skip by default.
jj undo reverses the last operation if a commit was made in error — prefer it over destructive resets.