Skip to content

jacksodj/jj-agents

v1.0.0MIT

Jujutsu (jj) version control for teams of coding agents: one workspace per agent, safe integration, and recovery through the operation log. Bundles a skill, a jj MCP server, and git-write guard hooks.

jj-agents

Jujutsu (jj) version control for teams of AI coding agents, packaged once for Claude Code, OpenAI Codex, and Kiro.

ComponentWhat it doesClaude CodeCodexKiro
Skill jj-multi-agentTeaches the agent the jj workflow, one-workspace-per-agent, integration, and recoveryyesyesyes
MCP server jj13 workspace-aware jj tools with JSON output; no push/undo/abandonyes (.mcp.json)yes (mcp.json)yes (mcp.json)
Hook: git-write guardBlocks git commit, git push, git add, … in jj repositories and names the jj equivalentyesyes—
Hook: session startRepairs a stale workspace and tells the agent which workspace it is inyesyes—
Hooks: WorktreeCreate / WorktreeRemoveMake claude --worktree, isolation: worktree subagents, and /batch create jj workspacesyes——
templates/AGENTS.md, Claude settings, Codex rules and codex-jj launcher, Kiro steering / agent / permissionscopy by handcopy by handcopy by hand

Requirements: jj 0.45+, git 2.41+, Node.js 18+.

Layout

jj-agents/
├── plugin.json                  Agent Plugins v1 manifest (read by Codex and Kiro)
├── .claude-plugin/plugin.json   Claude Code manifest
├── skills/jj-multi-agent/       SKILL.md + references/ (shared by all hosts)
├── mcp.json                     Agent Plugins MCP config (Codex, Kiro): runs `jj-agents-mcp`
├── .mcp.json                    Claude Code MCP config: runs mcp/server.mjs from the plugin
├── mcp/                         the MCP server (dependency-free Node.js) and its package.json
├── hooks/hooks.json             Claude Code hooks
├── hooks/codex-hooks.json       Codex hooks (referenced from plugin.json → extensions."com.openai")
├── hooks/*.mjs                  hook scripts
├── templates/                   per-host configuration to copy into repositories
└── tests/                       mcp-smoke.mjs, hooks-test.mjs

Install

Run the install commands from the folder that contains .claude-plugin/marketplace.json and plugins/ (the course folder); run the test commands from this plugin folder.

First, for Codex and Kiro, put the MCP server's command on your PATH (Claude Code runs it from the plugin folder and does not need this):

npm install -g --install-links ./plugins/jj-agents/mcp     # provides `jj-agents-mcp`

Claude Code (from the folder that contains .claude-plugin/marketplace.json):

claude plugin marketplace add ./
claude plugin install jj-agents@jj-agents-course
claude plugin details jj-agents@jj-agents-course
# or, for a one-off session:  claude --plugin-dir ./plugins/jj-agents

Codex (same folder; Codex reads Claude's marketplace file):

codex plugin marketplace add ./
codex plugin add jj-agents@jj-agents-course
codex plugin list
codex mcp list          # shows the plugin's `jj` server

Then start Codex and review the plugin's hooks with /hooks (Codex runs plugin hooks only after you trust them). The plugin does not change Codex's sandbox: under the default workspace-write mode, jj cannot write to .git (colocated repositories) or to the main workspace's .jj (secondary workspaces). Launch Codex with templates/codex/codex-jj, which adds those as writable roots.

Kiro: open the Powers panel → Add Custom Power → Import power from a folder → select plugins/jj-agents. Kiro activates the power when a request mentions one of its keywords (jj, jujutsu, workspace, …).

Test

node tests/hooks-test.mjs
node tests/mcp-smoke.mjs /absolute/path/to/a/jj/workspace
claude plugin validate .

Security notes

The git-write guard and the permission templates are guidance plus friction, not a sandbox: an agent can still reach Git through scripts or sh -c. The MCP server runs jj with execFile (no shell), requires an absolute workspace path, validates names and revsets, and exposes no remote-publishing or history-rewinding operation.