parallel-execution
Implements parallel subagent execution using Task tools to optimize concurrent operations and reduce execution time.
Install
mkdir -p .claude/skills/parallel-execution && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/3813" && unzip -o skill.zip -d .claude/skills/parallel-execution && rm skill.zipInstalls to .claude/skills/parallel-execution
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Patterns for parallel subagent execution using Task tool with run_in_background. Use when coordinating multiple independent tasks, spawning dynamic subagents, or implementing features that can be parallelized.Key capabilities
- →Spawn multiple independent subagents simultaneously
- →Execute concurrent tasks using the Task tool
- →Synthesize results from multiple parallel subagents
- →Manage TodoWrite status for concurrent task tracking
How it works
The skill uses the Task tool with the run_in_background parameter set to true. All task calls must be included in a single assistant message to trigger concurrent execution.
Inputs & outputs
When to use parallel-execution
- →Running tasks in parallel
- →Spawning multiple subagents
- →Optimizing workflow latency
About this skill
Parallel Execution Patterns
When to Load
- Trigger: Multi-agent tasks, concurrent operations, spawning subagents, parallelizing independent work
- Skip: Single-step tasks or sequential workflows with no parallelization opportunity
Core Concept
Parallel execution spawns multiple subagents simultaneously using the Task tool with run_in_background: true. This enables N tasks to run concurrently, dramatically reducing total execution time.
Critical Rule: ALL Task calls MUST be in a SINGLE assistant message for true parallelism. If Task calls are in separate messages, they run sequentially.
Execution Protocol
Step 1: Identify Parallelizable Tasks
Before spawning, verify tasks are independent:
- No task depends on another's output
- Tasks target different files or concerns
- Can run simultaneously without conflicts
Step 2: Prepare Dynamic Subagent Prompts
Each subagent receives a custom prompt defining its role:
You are a [ROLE] specialist for this specific task.
Task: [CLEAR DESCRIPTION]
Context:
[RELEVANT CONTEXT ABOUT THE CODEBASE/PROJECT]
Files to work with:
[SPECIFIC FILES OR PATTERNS]
Output format:
[EXPECTED OUTPUT STRUCTURE]
Focus areas:
- [PRIORITY 1]
- [PRIORITY 2]
Step 3: Launch All Tasks in ONE Message
CRITICAL: Make ALL Task calls in the SAME assistant message:
I'm launching N parallel subagents:
[Task 1]
description: "Subagent A - [brief purpose]"
prompt: "[detailed instructions for subagent A]"
run_in_background: true
[Task 2]
description: "Subagent B - [brief purpose]"
prompt: "[detailed instructions for subagent B]"
run_in_background: true
[Task 3]
description: "Subagent C - [brief purpose]"
prompt: "[detailed instructions for subagent C]"
run_in_background: true
Step 4: Retrieve Results with TaskOutput
After launching, retrieve each result:
[Wait for completion, then retrieve]
TaskOutput: task_1_id
TaskOutput: task_2_id
TaskOutput: task_3_id
Step 5: Synthesize Results
Combine all subagent outputs into unified result:
- Merge related findings
- Resolve conflicts between recommendations
- Prioritize by severity/importance
- Create actionable summary
Dynamic Subagent Patterns
Pattern 1: Task-Based Parallelization
When you have N tasks to implement, spawn N subagents:
Plan:
1. Implement auth module
2. Create API endpoints
3. Add database schema
4. Write unit tests
5. Update documentation
Spawn 5 subagents (one per task):
- Subagent 1: Implements auth module
- Subagent 2: Creates API endpoints
- Subagent 3: Adds database schema
- Subagent 4: Writes unit tests
- Subagent 5: Updates documentation
Pattern 2: Directory-Based Parallelization
Analyze multiple directories simultaneously:
Directories: src/auth, src/api, src/db
Spawn 3 subagents:
- Subagent 1: Analyzes src/auth
- Subagent 2: Analyzes src/api
- Subagent 3: Analyzes src/db
Pattern 3: Perspective-Based Parallelization
Review from multiple angles simultaneously:
Perspectives: Security, Performance, Testing, Architecture
Spawn 4 subagents:
- Subagent 1: Security review
- Subagent 2: Performance analysis
- Subagent 3: Test coverage review
- Subagent 4: Architecture assessment
TodoWrite Integration
When using parallel execution, TodoWrite behavior differs:
Sequential execution: Only ONE task in_progress at a time
Parallel execution: MULTIPLE tasks can be in_progress simultaneously
# Before launching parallel tasks
todos = [
{ content: "Task A", status: "in_progress" },
{ content: "Task B", status: "in_progress" },
{ content: "Task C", status: "in_progress" },
{ content: "Synthesize results", status: "pending" }
]
# After each TaskOutput retrieval, mark as completed
todos = [
{ content: "Task A", status: "completed" },
{ content: "Task B", status: "completed" },
{ content: "Task C", status: "completed" },
{ content: "Synthesize results", status: "in_progress" }
]
When to Use Parallel Execution
Good candidates:
- Multiple independent analyses (code review, security, tests)
- Multi-file processing where files are independent
- Exploratory tasks with different perspectives
- Verification tasks with different checks
- Feature implementation with independent components
Avoid parallelization when:
- Tasks have dependencies (Task B needs Task A's output)
- Sequential workflows are required (commit -> push -> PR)
- Tasks modify the same files (risk of conflicts)
- Order matters for correctness
Performance Benefits
| Approach | 5 Tasks @ 30s each | Total Time |
|---|---|---|
| Sequential | 30s + 30s + 30s + 30s + 30s | ~150s |
| Parallel | All 5 run simultaneously | ~30s |
Parallel execution is approximately Nx faster where N is the number of independent tasks.
Example: Feature Implementation
User request: "Implement user authentication with login, registration, and password reset"
Orchestrator creates plan:
- Implement login endpoint
- Implement registration endpoint
- Implement password reset endpoint
- Add authentication middleware
- Write integration tests
Parallel execution:
Launching 5 subagents in parallel:
[Task 1] Login endpoint implementation
[Task 2] Registration endpoint implementation
[Task 3] Password reset endpoint implementation
[Task 4] Auth middleware implementation
[Task 5] Integration test writing
All tasks run simultaneously...
[Collect results via TaskOutput]
[Synthesize into cohesive implementation]
Troubleshooting
Tasks running sequentially?
- Verify ALL Task calls are in SINGLE message
- Check
run_in_background: trueis set for each
Results not available?
- Use TaskOutput with correct task IDs
- Wait for tasks to complete before retrieving
Conflicts in output?
- Ensure tasks don't modify same files
- Add conflict resolution in synthesis step
When not to use it
- →When tasks have dependencies on other task outputs
- →When tasks modify the same files
- →When sequential execution order is required
Limitations
- →Requires all Task calls to be in a single message for true parallelism
- →Risk of file modification conflicts if tasks overlap
- →Requires manual synthesis of results after task completion
How it compares
This approach reduces total execution time by running independent tasks simultaneously rather than executing them one after another.
Compared to similar skills
parallel-execution side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| parallel-execution (this skill) | 4 | 6mo | No flags | Advanced |
| opencode-cli | 14 | 7mo | Review | Advanced |
| claude-automation-recommender | 47 | 2mo | Review | Beginner |
| mcp-integration | 21 | 8mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by CloudAI-X
View all by CloudAI-X →You might also like
opencode-cli
SpillwaveSolutions
This skill should be used when configuring or using the OpenCode CLI for headless LLM automation. Use when the user asks to "configure opencode", "use opencode cli", "set up opencode", "opencode run command", "opencode model selection", "opencode providers", "opencode vertex ai", "opencode mcp servers", "opencode ollama", "opencode local models", "opencode deepseek", "opencode kimi", "opencode mistral", "fallback cli tool", or "headless llm cli". Covers command syntax, provider configuration, Vertex AI setup, MCP servers, local models, cloud providers, and subprocess integration patterns.
claude-automation-recommender
anthropics
Analyze a codebase and recommend Claude Code automations (hooks, subagents, skills, plugins, MCP servers). Use when user asks for automation recommendations, wants to optimize their Claude Code setup, mentions improving Claude Code workflows, asks how to first set up Claude Code for a project, or wants to know what Claude Code features they should use.
mcp-integration
anthropics
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context Protocol", "connect external service", mentions "${CLAUDE_PLUGIN_ROOT} with MCP", or discusses MCP server types (SSE, stdio, HTTP, WebSocket). Provides comprehensive guidance for integrating Model Context Protocol servers into Claude Code plugins for external tool and service integration.
hook-development
anthropics
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.
agent-factory
alirezarezvani
Claude Code agent generation system that creates custom agents and sub-agents with enhanced YAML frontmatter, tool access patterns, and MCP integration support following proven production patterns
swarm-advanced
ruvnet
Advanced swarm orchestration patterns for research, development, testing, and complex distributed workflows