jj Agent Spawn
Create a new jj workspace (the equivalent of git worktree add) and open it in an editor or tmux window, ready for an agent to start work.
When to use
- User wants to run two or more agents on different tasks in parallel.
- User wants to try an alternative approach without contaminating the main working copy.
- User wants the agent's output isolated in its own
@for later review viajj_agent_diff.
Prerequisites
jj_agentfunction is available (this plugin is installed).$TMUXis set if--tmuxmode is desired.$EDITORis set (or override with-e).
Steps
Pick a workspace name. Short, descriptive, kebab-case:
- Good:
fix-auth,review-pr-42,try-approach-b. - Bad:
agent1,tmp,wip.
- Good:
Pick the base revision:
jj_agent <name> # based on current @ jj_agent <name> -r 'trunk()' # based on trunk jj_agent <name> -r <change-id> # based on a specific revisionPick the launch mode:
--tmux— opens a new tmux window inside the current session. Preferred when running multiple agents side by side.- (default) — opens
$EDITORinside the new workspace directory. -e '<command>'— override editor, e.g.-e 'claude',-e 'codex'.
Confirm the workspace registered:
jj_agent_listThe new workspace should appear with state
clean(no edits yet).
Lifecycle follow-ups
- Compare two agents' output:
jj_agent_diff <A> <B>. - Close out the winning workspace:
jj_agent_done <name> --push-pr --forget. - Bulk cleanup of empty abandoned workspaces:
jj_agent_prune --dry-runthenjj_agent_prune.
See README.md "End-to-end agent loop" for the full cycle walkthrough.
Notes for the invoking agent
- The spawned session is an independent jj workspace. Operations there record into the shared op log, so the main agent can see what the spawned agent did via
jj op logfrom any workspace. - Do not call
jj_agentprogrammatically to reproduce this skill — the skill exists so the user explicitly chooses the name, base, and mode.