/skills:jj-vcsfrom skills
This skill should be used when working in a Jujutsu (jj) repository or when the user asks about jj commands, workflows, or idioms. It encodes the "jj way" of doing things - working copy as commit, moving changes between commits with squash, splitting with split, first-class conflicts, and undo via the operation log. Use this skill instead of git habits whenever a `.jj/` directory is present, when the user says "jj" or "jujutsu", or when translating a git workflow into jj.
Ships in skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Jujutsu is a Git-compatible VCS with a different model: the working copy is a commit, every command auto-snapshots, history is freely rewritable, and conflicts are first-class. Most git habits (staging, amend, stash, rebase --continue) translate to simpler jj primitives. Follow this skill's idioms rather than porting git workflows verbatim.
Detailed references in references/ should be loaded when a workflow requires them. jj help <command> and jj <command> --help remain the authoritative reference for flags.
Read these before running any jj command. They are the mental model that makes every other command make sense.
There is no staging area and no "dirty working tree". The files on disk ARE a commit, referenced as @. Its parent is @-. Editing a file is equivalent to amending @ — jj snapshots the working copy automatically before (almost) every command.
Practical consequences:
git add. Just edit files.jj status / jj diff show what's in @ vs @-.jj new @- — your current @ stays as a commit, and you get a fresh empty commit to work in.jj restore pulls @-'s content back into @.The idiomatic flow is describe a change, then make it — opposite of git's "edit then write a commit message". This keeps intent clear in jj log even while work is in progress.
jj describe -m "add foo feature" # label current @
# ... edit files, snapshot is automatic ...
jj new -m "next thing" # finish current, start new @
# or equivalently:
jj commit -m "add foo feature" # = describe + new, labels current @ and starts fresh
Do NOT describe-after-the-fact unless recovering from a mistake; the habit of describing upfront is what makes stacked work legible.
Every commit has two IDs:
olurzuwu): the identity of a change, stable across rewrites. Use this when referring to commits in commands.a3373947): the specific content hash, changes on every rewrite.Rewriting a commit (squash, rebase, describe, edit-and-snapshot) produces a new commit ID but the same change ID. All descendants auto-rebase. Refer to commits by change ID prefix.
The killer feature. You rarely need to "check out" an older commit to modify it. Instead, make the fix in @ (or anywhere), then move it into the target change:
jj squash --into <change> # move @'s diff into <change>
jj squash -f <src> -t <dst> # move content from src to dst
jj squash -i --into <change> # interactively pick hunks to move
jj squash --from <src> <filepath> # move only a path
Defaults: jj squash with no flags moves @ → @- (the git-amend equivalent). --use-destination-message (-u) keeps the destination's description when squashing.
Conflicts don't block operations. A rebase / abandon / squash that creates a conflict succeeds; the conflicted commit is just marked (conflict) in jj log and descendants continue to rebase on top. You resolve them when convenient.
To resolve:
jj resolve for an interactive merge tool.--continue step.jj squash moves the resolution into the conflicted commit.Every operation (snapshots, rebases, pushes, abandons) is recorded in the operation log. Reach for undo liberally rather than trying to reason your way out.
jj undo # reverse last op
jj op log # list operations
jj op restore <op-id> # jump repo state back to any op
jj op revert <op-id> # revert a specific non-recent op
jj log --at-op <op-id> # inspect past state without changing current
immutable_heads()Unlike git, rewriting published commits is normal and safe locally. jj auto-rebases descendants. The only commits protected by default are ancestors of trunk() and tags (the immutable_heads() revset). Override with --ignore-immutable only if deliberate.
jj has no "current branch". Bookmarks are named pointers that don't auto-advance with new commits. To push work:
jj bookmark create my-feature -r @- # or @ — point at a commit
jj bookmark move my-feature --to @- # update pointer
jj git push --bookmark my-feature # push it
jj git push --change @ # auto-create bookmark named after change ID
Bookmarks need explicit maintenance. A fresh commit doesn't advance any bookmark.
Invoke this skill when ANY of:
.jj/ directory exists in the repo (run ls .jj or jj root to confirm).If the repo is colocated (both .jj/ and .git/ present), prefer jj commands over git ones to avoid creating divergent refs.
jj new trunk() -m "add new widget" # new @ off trunk, with description
# edit files...
jj commit -m "add new widget" # labels @ and starts fresh @
# or keep going and let auto-snapshot amend @ until you're done
Just edit — snapshot is automatic. To change the description: jj describe.
Edit whatever files need changing in @, then:
jj squash --into <change-id>
Or the legacy shortcuts: jj squash -B @ (before @), jj squash -A @- (after @-), but --into is usually clearer.
jj split # interactive: pick which hunks go to new commit
jj split <paths> # by path
jj split -r <change> # split a non-@ commit
The result is two commits with the same parent; the original change ID stays on the first.
jj rebase -r <change> --after <target> # move change after another
jj rebase -r <change> --before <target> # move change before
jj parallelize <range> # siblings instead of a line
jj git fetch
jj rebase -b @ -d trunk() # rebase branch containing @
jj bookmark create feat -r @ # or point at @-
jj git push --bookmark feat # safe by default: aborts if remote diverged
jj git push --change @ # auto-bookmark shortcut for quick pushes
jj undo # first try — works for most cases
jj op log # find the op you want to go back to
jj op restore <op> # jump there
git and jj commands in a colocated repo without reason — this can cause bookmark conflicts. If you must, jj git import / jj git export to sync.jj edit a commit just to amend it — jj squash --into from @ is usually cleaner.jj git push already does the right safety check (--force-with-lease semantics).jj abandon trying to "reset hard" if the change has descendants you care about — they'll rebase onto the parent, possibly with conflicts. Use jj restore or jj undo instead.Load these when a workflow needs more detail. Grep or read directly — they are short.
references/workflows.md — detailed workflows (stacked PRs, interactive squash, split by hunks, resolving divergent bookmarks, cleaning up @).references/git-equivalents.md — cheat sheet mapping common git commands to jj.references/revsets.md — revset syntax used by -r flags (@, @-, trunk(), ::, |, etc.).references/recovery.md — operation log recipes for fixing mistakes.For authoritative CLI details, always consult jj help <command> or jj <command> --help. Online: https://jj-vcs.github.io/jj/ and https://github.com/jj-vcs/jj/tree/main/docs.
If jj --version fails, jj is not installed. Install via:
cargo install --locked jj-clibrew install jjAfter install, set identity once:
jj config set --user user.name "Your Name"
jj config set --user user.email "[email protected]"
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub werdnum/claude-code-plugins --plugin skills2 skills in this plugin