/hydra:parallelfrom hydra
Starts multiple agents in parallel across git worktrees. Parses pipe-separated worktree:prompt tasks, validates worktrees, creates missing ones, and spawns background agents for each.
Ships in hydra. Installing the plugin adds it to Claude Code.
You are executing the /hydra:parallel command. Start multiple agents simultaneously in different worktrees.
$ARGUMENTS is parsed as a pipe-separated list of tasks:
worktree1:prompt1 | worktree2:prompt2 | worktree3:prompt3
Example:
/hydra:parallel feature-a:Implement login | feature-b:Implement logout | feature-c:Write tests
Split $ARGUMENTS at | and parse each part:
# Example parsing
echo "$ARGUMENTS" | tr '|' '\n' | while read task; do
WORKTREE=$(echo "$task" | cut -d':' -f1 | xargs)
PROMPT=$(echo "$task" | cut -d':' -f2- | xargs)
echo "Worktree: $WORKTREE, Prompt: $PROMPT"
done
For each task:
git worktree list | grep -qE "$WORKTREE|hydra/$WORKTREE"
If a worktree is missing, offer to create it:
The following worktrees do not exist:
- feature-x
- feature-y
Should I create them? (Branches will be forked from main)
If yes, create missing worktrees:
Run from the repo root, with the repo name and each worktree name written literally (no shell variables; the worktree guard checks the literal destination path):
# Repo name (read-only lookup, use the printed name below)
basename "$(git rev-parse --show-toplevel)"
mkdir -p ../<repo>-worktrees
git worktree add -b hydra/feature-x ../<repo>-worktrees/feature-x
# bring excluded files (rules, .credo/, ...) into the fresh worktree
"${CLAUDE_PLUGIN_ROOT}/scripts/worktree-setup.sh" ../<repo>-worktrees/feature-x
git worktree add -b hydra/feature-y ../<repo>-worktrees/feature-y
"${CLAUDE_PLUGIN_ROOT}/scripts/worktree-setup.sh" ../<repo>-worktrees/feature-y
Run worktree-setup.sh right after every git worktree add (see /hydra:create).
IMPORTANT: Use a single response with multiple Task tool calls!
For each task, call Task tool with:
subagent_type: general-purpose
run_in_background: true
prompt: [like in /hydra:spawn]
Every prompt also names the absolute main checkout path (the main= line of worktree-setup.sh) with this rule: when something important is missing in the worktree (neither checked out, linked nor copied), look it up READ-ONLY in the main checkout; never write, commit or run state-changing git commands there; mention in the report anything that should be added to the worktree files list. Inside its own worktree the agent may commit on its worktree branch, but never push or merge - that stays with the main agent.
All Task calls must be in ONE response for true parallelism.
After starting all agents:
Parallel agents started:
Worktree | Agent ID | Task
--------------|-----------------|---------------------------
feature-a | agent-abc123 | Implement login
feature-b | agent-def456 | Implement logout
feature-c | agent-ghi789 | Write tests
All agents running in background.
Next steps:
- /hydra:status # Progress of all worktrees
- TaskOutput agent-abc123 # Result of one agent
- /hydra:merge feature-a # When done: merge individually
If JSON preferred:
[
{"worktree": "feature-a", "prompt": "Implement login"},
{"worktree": "feature-b", "prompt": "Implement logout"}
]
If line breaks:
feature-a: Implement login
feature-b: Implement logout
feature-c: Write tests
Detect the format automatically and parse accordingly.
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub marcel-bich/marcel-bich-claude-marketplace --plugin hydra10 commands in this plugin
/cleanupWorktree Cleanuphydra - Remove already merged worktrees and their branches/createWorktree Createhydra - Create a new Git worktree for isolated work/deleteWorktree Deletehydra - Safely remove a Git worktree/helpHydra Plugin Helphydra - Show available commands and explain the concept/listWorktree Listhydra - List all Git worktrees of the repository/mergeWorktree Mergehydra - Merge a worktree branch back into current branchOther plugins' commands for the same job