Automatically intercepts git commands when working in a jj project and redirects to jj equivalents.
When a .jj directory is detected in your project:
- System prompt injection — appends a jj guide to every agent turn, so the agent always knows it's in a jj project
- Git command interception — intercepts
bashtool calls that usegitand either:- Auto-transforms safe read-only commands (
git status→jj status,git log→jj log, etc.) - Blocks dangerous commands (
git commit,git add,git stash, etc.) with a message explaining the jj equivalent
- Auto-transforms safe read-only commands (
- Status indicator — shows
🦀 jjin the footer when active
These git commands are silently rewritten to jj equivalents:
| git | jj |
|---|---|
git status |
jj status |
git log |
jj log |
git diff |
jj diff |
git show |
jj show |
git blame |
jj annotate |
git push |
jj git push |
git pull |
jj git pull |
git fetch |
jj git fetch |
git branch -a |
jj bookmark list --all |
These git commands are blocked with a message suggesting the jj equivalent:
git commit, git add, git stash, git checkout, git merge, git rebase, git reset, git cherry-pick, git revert, git switch, and more.
pi install https://github.com/cole/pi-jjManual install
cp -r extensions/pi-jj ~/.pi/agent/extensions/Then /reload in pi.
| Command | Description |
|---|---|
/jj |
Show current jj detection status |
/jj on |
Re-enable jj interception |
/jj off |
Disable jj interception for this session |
/jj status |
Show whether jj project is detected |
/jj help |
Show help |
- On
session_start, checks for.jjdirectory in the project root - On
before_agent_start, injects a jj reference into the system prompt - On
tool_callforbashcommands, detects git invocations and either transforms or blocks them - Uses
/jjcommand for manual control
AI agents default to git commands. In a jj project, running git commit or git stash can cause confusion because jj manages the working copy differently. This extension ensures the agent always uses the right tool for the job.