jj Agent Spawn
Create a new jj workspace (the equivalent of git worktree add) and open it 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.
Prerequisites
.jj/exists in the repo root.$TMUXis set if--tmuxmode is desired.$EDITORis set (or an explicit editor is provided).
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 — usually
@(current) ortrunk().Spawn. Prefer the plugin wrapper if available:
# Preferred: with nwiizo/jujutsu.fish installed jj_agent <name> -r 'trunk()' jj_agent <name> --tmux # opens a new tmux window jj_agent <name> -e 'claude' # override editor # Fallback: plain jj jj workspace add --name <name> -r 'trunk()' ../<name> cd ../<name> $EDITOR .Confirm the workspace registered:
jj workspace list # or `jj_agent_list` if the plugin is installedThe new workspace should appear with an empty
@.
Lifecycle follow-ups
Plugin-available shortcuts (otherwise run the underlying jj commands):
- Compare two agents' output:
jj_agent_diff <A> <B>(orjj diff --from <A>@ --to <B>@). - Close out a workspace:
jj_agent_done <name> --push-pr --forget(or summarize + push +jj workspace forget <name>). - Cleanup of empty abandoned workspaces:
jj_agent_prune --dry-runthenjj_agent_prune.
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 invoke this skill programmatically just to create a workspace — the skill exists so the user explicitly chooses the name, base, and mode.