hydra - Start multiple agents in parallel across worktrees
/plugin marketplace add Marcel-Bich/marcel-bich-claude-marketplace/plugin install marcel-bich-hydra-plugins-hydra@Marcel-Bich/marcel-bich-claude-marketplaceYou 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:
for WT in feature-x feature-y; do
REPO_NAME=$(basename "$(git rev-parse --show-toplevel)")
git worktree add -b "hydra/$WT" "../${REPO_NAME}-worktrees/$WT"
done
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]
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.