| name | parallel |
| description | Launch and track parallel work streams in isolated git worktrees. Prevents duplicate work, tracks active branches, and manages the lifecycle of concurrent tasks. Use when user says "/parallel", "do this in parallel", "work on this separately", or wants to run independent tasks without touching the working tree. |
| user-invocable | true |
| disable-model-invocation | false |
| allowed-tools | ["Bash","Read","Write","Edit","Glob","Grep","Agent"] |
Parallel
Run independent tasks in isolated worktrees. Track what's running. Prevent duplicates.
State
All state lives in .parallel/ at the repo root (gitignored).
.parallel/
manifest.json # array of tracked work items
Each entry in the manifest:
{
"id": "<short-id>",
"task": "<one-line description>",
"branch": "<branch-name>",
"worktree": "<worktree-path>",
"status": "running" | "done" | "merged",
"created": "<ISO timestamp>",
"agentId": "<agent-id if available>"
}
Commands
Parse the user's input after /parallel:
/parallel <task description>
Launch a new parallel task.
- Read the manifest. If
.parallel/manifest.json exists, load it. Otherwise initialize empty array.
- Check for duplicates. Compare the task description against existing
running entries. If something looks like the same work (fuzzy match on description), warn the user and ask to confirm before proceeding.
- Generate identifiers. Create a short kebab-case branch name from the task (e.g.,
parallel/presign-urls). Generate a 4-char random ID.
- Ensure
.parallel/ is gitignored. Check .gitignore for .parallel/ entry. Add it if missing.
- Launch the agent. Use the Agent tool with
isolation: "worktree" and run_in_background: true. Pass the full task description as the prompt. Include context about the repo and what files are likely relevant.
- Record in manifest. Add the entry with status
running and the agent ID.
- Confirm to user. Print the task, branch name, and ID. Keep it brief.
/parallel status
Show all tracked work.
- Read the manifest.
- For each
running entry, check if the worktree/branch still exists (git worktree list, git branch).
- Print a table: ID, status, branch, task description.
- If any entries have stale worktrees (worktree deleted but status still
running), mark them done and note the branch.
/parallel merge <id or branch>
Merge completed work back.
- Find the entry by ID or branch name.
- If worktree still exists, warn that work may still be in progress. Ask to confirm.
- Run
git merge <branch> from the main working tree.
- Update status to
merged in manifest.
- Clean up: remove the worktree if it still exists (
git worktree remove).
/parallel clean
Remove all done and merged entries from the manifest. Prune any orphaned worktrees.
/parallel cancel <id or branch>
- Find the entry.
- Remove the worktree (
git worktree remove --force).
- Delete the branch (
git branch -D).
- Remove from manifest.
Agent Prompt Template
When launching the worktree agent, use this prompt structure:
You are working on an isolated task in a git worktree. Your changes will be on a separate branch.
## Task
<user's task description>
## Context
- Repo: <repo root>
- Base branch: <current branch>
- Your branch: <generated branch name>
## Instructions
- Focus only on the described task. Do not make unrelated changes.
- Commit your work with clear commit messages when done.
- If you need clarification, stop and report what you need. Do not guess.
Rules
- Always check the manifest before launching. Duplicates waste compute.
- Branch names use
parallel/ prefix for easy identification.
- The manifest is the source of truth. If a worktree is gone but the branch exists, the work was completed.
- Never touch the user's working tree. That's the whole point.
- Keep status output compact. One line per item.