Track Claude Code sessions as jujutsu changes
This plugin is not yet in any themed marketplace. To install it, you'll need to add it from GitHub directly.
Choose your preferred installation method below
A marketplace is a collection of plugins. Every plugin gets an auto-generated marketplace JSON for individual installation, plus inclusion in category and themed collections. Add a marketplace once (step 1), then install any plugin from it (step 2).
One-time setup for access to all plugins
When to use: If you plan to install multiple plugins now or later
Step 1: Add the marketplace (one-time)
/plugin marketplace add https://claudepluginhub.com/marketplaces/all.json
Run this once to access all plugins
Step 2: Install this plugin
/plugin install jjagent@all
Use this plugin's auto-generated marketplace JSON for individual installation
When to use: If you only want to try this specific plugin
Step 1: Add this plugin's marketplace
/plugin marketplace add https://claudepluginhub.com/marketplaces/plugins/jjagent.json
Step 2: Install the plugin
/plugin install jjagent@jjagent
tracks claude code sessions as jj changes. allowing you and coding agents to work together at the same time while keeping an organized set of changes to review.
when you start, @
is at the head. lets call @
'users working copy' given its where you, the user works. you can change things while claude works away in the background and your changes will be here.
when a claude session is started and PreToolUse
fires, jjagent will make a new change – a descendant of the users working copy. this is a fresh change for claude's changes to live in. after claude is done changing files, the PostToolUse
fires and jjagent will squash those changes into a new direct ancestor of the users working copy. jj automatically rebases the descendants during the squash, and @
is back to the users working copy. subsequent claude edit tool calls will find the session's change based on a Claude-session-id trailer in the change description.
multiple claude sessions can be going at one, a lock file is used to have them wait their turn before editing files.
it's attribution is not perfect: you might write a file while we're on a claude change, and claude might use bash to change stuff. room for improvement here! but it works well for me.
@
as a descendent of claude's changes, the assumed workflow is that you will be working at the head or tip of descendants. if you move @
backwards while claude is doing its thing you are in for a bad time: claude will branch or otherwise do things on wrong assumptions--ignore-wroking-copy
to prevent thatjj describe
interactively: if claude code edits a file while you have your describe editor open you'll run into 'Error: The "@" expression resolved to more than one operation'Edit|MultiEdit|Write
claude code tools, claude often changes files with bash and jjagent doesn't try to track thatbrew install schpet/tap/jjagent
# clone jj agent locally
cargo install --path .
/plugin marketplace add schpet/jjagent
/plugin install jjagent@jjagent
[!NOTE] if you don't have the
/plugin
command you are likely running an old version of claude code. ensure you're on version 2.0.19 or later
jjagent claude settings
the jjagent plugin provides additional commands and agents for working with session changes:
prerequisites: you must have jjagent installed (see installation) before installing the plugin. the plugin just sets up hooks and provides convenience commands - the actual jjagent binary does the heavy lifting.
/jjagent:describe
- generate an llm-written commit description for the current session's change
/jjagent:split
- split the current session into a new change part. useful when you want to logically separate work within a single claude session into distinct jj changes.
jjagent:describe
- background agent that generates commit descriptions without losing context in the main conversation. automatically called by the slash command.the plugin automatically configures these hooks:
SessionStart
- injects session ID into claude's context at the start of each session to support slash commandsUserPromptSubmit
- re-injects session ID if it's been lost from recent context (i.e. compact)PreToolUse
/ PostToolUse
- manages session changes around file edits (edit, write tools)Stop
- cleanup when claude session endsRun tests:
cargo test
You see, jj was designed around a single feature requirement. That requirement led to a very simple design addition to Git's DVCS model, that naturally enabled all of the features:
jj was designed to support concurrency.
inspired directly by gitbutler's claude code hooks
0.1.2