Run multiple independent tasks in parallel using git worktrees
Creates isolated git worktrees for each task, spawns agent instances in parallel across them, and collects results when all agents complete. This enables concurrent work on independent tasks without branch conflicts.
/parallel "Build login page" "Build signup page" "Build dashboard"
/parallel --max 3 "Task A" "Task B" "Task C" "Task D" "Task E"
Validate prerequisites. Ensure the current directory is a git repository with a clean working tree. Stash uncommitted changes if necessary.
Parse tasks. Extract individual tasks from the input. Each quoted string or comma-separated item becomes a separate task.
Enforce concurrency limit. Maximum of 5 concurrent worktrees. If more tasks are provided, queue them and run in batches.
Create worktrees. For each task, run scripts/spawn-worktree.sh to:
agent-parallel/<timestamp>-<task-slug>.claude/ config if needed)Spawn agents. For each worktree, use the Task tool to delegate the task to an agent working in that worktree's directory. Each agent:
.agent-status/progress.md in its worktree.agent-status/result.mdMonitor progress. Periodically check .agent-status/progress.md in
each worktree to report overall progress.
Collect results. When all agents complete, run
scripts/collect-results.sh to:
.agent-status/result.md from each worktreeMerge results. For each successful worktree:
Clean up. Run scripts/cleanup-worktrees.sh to remove all temporary
worktrees and branches.
Report summary:
## Parallel Execution Report
**Tasks:** 3
**Succeeded:** 3
**Failed:** 0
**Duration:** 45s
### Results
| Task | Status | Branch |
|-------------------|---------|-------------------------------------|
| Build login page | SUCCESS | agent-parallel/20260201-login-page |
| Build signup page | SUCCESS | agent-parallel/20260201-signup-page |
| Build dashboard | SUCCESS | agent-parallel/20260201-dashboard |
| Setting | Default | Description | |----------------|---------|-------------------------------------------| | Max worktrees | 5 | Maximum concurrent worktrees | | Timeout | 300s | Per-task timeout before forced cleanup | | Auto-merge | true | Automatically merge successful branches | | Cleanup | true | Remove worktrees after collection |
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer