AI SummaryA directory at the root of the checkout you work in means jj is in use: run all version-control operations through jj and keep GitHub operations on . Git is read-only; CLAUDE.md gives the rule, including what to do when is missing. A directory under a bare repository without its own is
Install
Copy this and paste it into Claude Code, Cursor, or any AI assistant:
I want to install the "jujutsu" skill in my project. Please run this command in my terminal: # Install skill into your project mkdir -p .claude/skills/jujutsu && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/jujutsu/SKILL.md "https://raw.githubusercontent.com/takeokunn/nixos-configuration/main/home-manager/ai-tools/agent-skills/skills/jujutsu/SKILL.md" Then restart Claude Code (or reload the window in Cursor) so the skill is picked up.
Description
Use when planning or running version-control operations: jj for every write and history edit, git for reads only. Covers non-interactive use, side-effect-free reads (templates, filesets, past operations), precise history edits (split, squash, absorb, rebase, inserting without moving @), recovering earlier versions without undo, conflicts recorded in commits, revset checks, the operation log, shared working copies, stale workspaces, bisect, bookmarks and stacks, and pre-push checks.
Jujutsu (jj)
A .jj/ directory at the root of the checkout you work in means jj is in use: run all version-control operations through jj and keep GitHub operations on gh. Git is read-only; CLAUDE.md gives the rule, including what to do when .jj/ is missing. A .worktrees/ directory under a bare repository without its own .jj/ is not a jj workspace: jj root succeeds there but names the bare root, whose jj sees none of the directory's files, and jj status shows no changes. Two layouts carry .jj/: • A non-bare clone is colocated: .jj/ and .git/ share one Git object store, jj exports its changes to Git refs, and Git's HEAD is left detached. Write through jj; read-only git subcommands also work. • A bare <repo>.git/ holds jj's store at its root in an empty-sparse default workspace that tracks no files. Work happens in jj workspaces under .worktrees/, which have no .git of their own. A gate that enumerates files through git (git ls-files, treefmt's default walker) there checks nothing and exits 0. Confirm its input count, or run it with a filesystem walk (treefmt --walk filesystem). Local jj writes on a non-default change (commit, describe, split, squash, absorb, rebase of your own changes, bookmark create, fetch, workspace add) need no separate authorization when the task calls for them. Push, and any write to the default branch, need the user's confirmation; so does moving or discarding a shared working copy (CLAUDE.md hard_rules). Before the first commit in a repository, run jj config get user.email there and confirm the value. Jujutsu does not read Git's conditional includeIf identity configuration.
The working copy is a commit
jj has no staging area. Repository commands normally snapshot files on disk into the working-copy revision @, so jj status records edits as well as reporting them. In a checkout shared with other sessions, that snapshot absorbs their edits into @ too: before describing, squashing, or pushing @, read jj diff --git and confirm every hunk is yours. Pass --ignore-working-copy to read-only commands to avoid snapshotting shared edits, but their view may be stale. To read on-disk state, run jj status or jj diff --git without the flag: before committing, to separate your changes from existing ones, or at completion to confirm the changed files, not as a routine first step. Confirm a remote ref before relying on a fetched one: compare `jj log --ignore-working-copy -r '<b>@<remote>' --no-graph -T 'commit_id' with gh api repos/<owner>/<repo>/git/ref/heads/<branch> --jq .object.sha` (tags: git/ref/tags/<tag>). A remote-tracking ref left by a fetch without explicit --remote and --branch is not freshness evidence. A change has a stable change ID (letters k-z) and a commit ID that changes on every rewrite. Refer to changes by change ID across rewrites.
Command map
Run only the jj column. | Git habit | jj | |---|---| | git status | jj status | | git log --oneline --graph | jj log | | git diff / git diff --cached | jj diff --git (no staging, one diff) | | git show <rev> | jj show --git <rev> | | git add + git commit -m | jj commit -m "<msg>" (describes @, starts a new empty @) | | git commit --amend -m | jj describe -m "<msg>" | | git commit --amend --no-edit (fold in edits) | jj squash (moves @ into its parent) | | git add -p + commit (some files) | jj split -m "<msg>" <paths> | | git commit --fixup + autosquash | jj absorb [<paths>] | | git checkout -b <b> | jj bookmark create <b> -r @ | | git branch -f <b> <rev> | jj bookmark set <b> -r <rev> (-B to move it backwards or sideways) | | git fetch | jj git fetch --remote <r> --branch <b> (always name both) | | git push origin <b> | jj git push -b <b> (see Pushing) | | git rebase <onto> | jj rebase -b @ -o <onto> (-o is --onto) | | git cherry-pick <sha> | jj duplicate <rev> -o <dest> | | git revert <sha> | jj revert -r <rev> -o @ | | git checkout -- <path> | jj restore <path> | | git blame <file> | jj file annotate <file> | | git reflog | jj op log |
Non-interactive use
• Always pass -m to jj commit, jj describe, and jj split; without it they open an editor. For jj squash, pass -m or -u (keep the destination's message) when both sides carry descriptions. • jj split with paths selects those files without a diff editor; without paths it opens one. Never run jj split without paths, jj diffedit, jj resolve without --list, or any -i/--interactive form. The guardrail hook does not catch these; an editor waiting for input hangs the call. • Add --no-pager to output-producing commands, and --git to diff commands whose output will be parsed: the default diff formatter here is difftastic. • For machine-readable output, pass --no-ext-diff to git diff so configured external diff drivers cannot alter its output. • For scripted reads, jj log --no-graph -r <revset> -T '<template>' gives stable output.
Discussion
Health Signals
My Fox Den
Community Rating
Sign in to rate this booster