An OpenCode plugin that blocks edits until you declare intent.
AI: jj describe -m "Add validation" ← declare intent, unlocks
AI: [edits files] ← all edits in this commit
[session ends] ← auto-commits, locks again
AI: jj describe -m "Add tests" ← declare intent, unlocks
AI: [edits files]
[session ends] ← auto-commits, locks again
User: "undo that"
AI: jj undo ← reverts last commit
jj new runs automatically when the session goes idle — can't accidentally mix work.
npm install -g jj-opencodeAdd to ~/.config/opencode/config.json:
{
"plugin": ["jj-opencode"]
}| Task | Command |
|---|---|
| Start work | jj describe -m "what you're doing" |
| Finish work | (automatic) |
| Undo | jj undo |
| Status | jj st |
| History | jj log |
| Push | jj_push tool |
Safely pushes changes to a bookmark.
jj_push ← push to main (default)
jj_push bookmark="feature" ← push to specific branch
Auto-detects what to push:
- If
@has changes → pushes@ - If
@is empty (common after session idle) → pushes@- - If both empty → searches for unpushed commits, requires confirmation
Flow:
- Shows preview with commits and files
- Requires user confirmation
- Moves bookmark → pushes → verifies clean working copy
Only specify bookmark if user explicitly requested it.
JJ uses bookmarks, not branches. Key difference for pushing:
| Git Model | JJ Model |
|---|---|
| Push commits one by one | Move bookmark to tip, push once |
| Can rewrite after push (with force) | Commits are immutable after push |
Anti-pattern: Don't try to push commits sequentially or squash after pushing.
Subagents that hit the edit gate are blocked and told to return to the parent agent. JJ workflow (describe/new/push) should only be managed by the primary agent.
- Guaranteed separation —
jj newruns automatically on session idle - Never lose work — every edit is in a described commit
- Clear history — every commit has meaning
MIT