parallel-execution
Skill0 starsChanged 30 days agoMITView on GitHub
Guides running independent work in parallel, as several tool calls or several subagents in one message, and merging the results. Use when a task splits into independent sub-problems, when the user says "do these in parallel", "fan out", "explore several approaches at once", "run these agents at the same time", or when several branches, hypotheses or perspectives need to be explored together. Also covers parallel code editing in isolated worktrees and advanced ensemble and tree-search patterns. Not for steps that depend on each other (use self-reflecting-chain).
9 other projects use a version of this.
Adopted by
Most recently taken up by
- andreymudri/claude-teammatestheir own version, first seen Nov 2, 2026
- andreymudri/fleetmatestheir own version, first seen Nov 2, 2026
- NoobyGains/godmodetheir own version, first seen Nov 1, 2026
- garri333/Skillstheir own version, first seen Oct 11, 2026
- CloudAI-X/opencode-workflowtheir own version, first seen Oct 8, 2026
- CloudAI-X/claude-workflowtheir own version, first seen Oct 8, 2026
Used with
Projects with it also use writing-skills.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
OpenAISkillwriting-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
Also in 3 projects that use this
Other versions9 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 9
- CloudAI-X/claude-workflow★ 1.4ksame name
- CloudAI-X/claude-workflow-v2★ 1.4ksame name
- CloudAI-X/opencode-workflow★ 275same name
- NoobyGains/godmode★ 118same name
- andreymudri/claude-teammates★ 3same name
- andreymudri/fleetmates★ 3same name
- beeltec/skills★ 2same name
- cheukswiss/etdxm★ 2same name
- garri333/Skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository15 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- adversarial-reasoningSkill
- analogical-transferSkill
- breadth-of-thoughtSkill
- dialectical-reasoningSkill
- hypothesis-eliminationSkill
- integrated-reasoningSkill
- negotiated-decision-frameworkSkill
- option-synthesisSkill
- premortem-evolvedSkill
- rapid-triage-reasoningSkill
- reasoning-handover-protocolSkill
- self-reflecting-chainSkill
- skill-gauntletSkill
- tree-of-thoughtsSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 229
If proposers agree: Boost confidence +5%
- Distinctive: line 230
If 2/3 agree: Use majority, document minority
- Distinctive: line 231
If no agreement: Escalate to DR (Dialectical Reasoning)
- Distinctive: line 338
Parallelizing sequential dependencies: - If step 2 needs step 1's output, don't parallelize
- Distinctive: line 340
No merge strategy defined: - Always know how to combine results before fan-out
“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Parallel Execution Patterns
Built-in Parallel Patterns (no skill needed)
Claude Code v2.1.76+ provides native parallelism. Use these first before reaching for advanced patterns.
| Pattern | How | Best For |
| Parallel tool calls | Multiple tools in single response auto-batch | Reading files, searching, independent lookups |
| Parallel subagents | Multiple Task calls with run_in_background: true | Independent research, analysis, exploration |
| Agent teams | CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 | Coordinated multi-file work with shared tasks |
| Worktree isolation | isolation: worktree in agent frontmatter | Parallel agents editing code on separate branches |
| Background execution | Ctrl+B or run_in_background: true | Long-running tasks you don't need results from immediately |
Parallel Tool Calls
Just make multiple tool calls in one response. Claude Code batches them automatically:
# These run in parallel:
- Read file A
- Read file B
- Grep for pattern X
- Glob for *.ts filesParallel Subagents
Spawn multiple independent agents that run concurrently:
# Fan-out: 3 agents in parallel
Task 1 (run_in_background: true): "Analyze database performance"
Task 2 (run_in_background: true): "Review API response times"
Task 3 (run_in_background: true): "Check frontend bundle size"
# Fan-in: collect results
TaskOutput from Task 1, 2, 3
Synthesize findingsAgent Teams
For coordinated parallel work where agents need to communicate:
Enable: CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
Shared task list:
1. Refactor models (no deps)
2. Update routes (depends: 1)
3. Update tests (depends: 1)
4. Update docs (depends: 1, 2, 3)
Agents pick available tasks and coordinate automatically.Worktree Isolation
For parallel code editing without conflicts:
# Agent 1
---
isolation: worktree
model: sonnet
---
"Implement feature A in src/features/a/"
# Agent 2
---
isolation: worktree
model: sonnet
---
"Implement feature B in src/features/b/"Each agent gets its own git worktree. Merge when done.
When to Parallelize
Parallelize when:
- Problem decomposes into independent sub-problems
- Multiple solution approaches need exploration (BoT, ToT branching)
- High confidence required (ensemble methods)
- Multiple hypotheses need simultaneous testing (HE)
- Cross-domain analogies need parallel investigation (AT)
Do not parallelize when:
- Steps have sequential dependencies (use SRC instead)
- Each step depends on previous results
- Problem is inherently linear (debugging traces)
- Merge strategy is undefined
Decision Tree
Is the task decomposable?
├─ NO -> Use sequential execution
└─ YES -> Are sub-tasks independent?
├─ NO -> Use sequential with checkpoints
└─ YES -> Is merge strategy clear?
├─ NO -> Define merge strategy first
└─ YES -> How many sub-tasks?
├─ 2-3 -> Parallel tool calls or subagents
├─ 4-8 -> Subagents with run_in_background
└─ 8+ -> Agent teams or DPTS patternAdvanced Cognitive Patterns
These patterns complement the built-in execution with structured reasoning strategies.
Pattern 1: Dynamic Parallel Tree Search (DPTS)
Efficiency: 2-4x improvement, 70% faster convergence
Adaptive parallel exploration that dynamically allocates resources to promising branches while pruning unpromising ones.
Key Mechanisms:
- Dynamic worker allocation: more workers on promising branches
- Adaptive pruning thresholds: adjust based on best-found confidence
- Early termination: stop when confidence exceeds threshold
- Resource rebalancing: move workers from exhausted/pruned branches
Integration with ToT:
## DPTS + Tree of Thoughts
### Phase 1: Initial Parallel Expansion
- Spawn N workers for Level 0 branches (N = 5-10)
- Each worker explores one branch independently
- Workers report confidence scores as they complete
### Phase 2: Dynamic Reallocation
- Rank branches by score
- Top 2 branches get 3 workers each for Level 1
- Prune branches below dynamic threshold
### Phase 3: Convergence
- Continue until winning branch > 85% confidence
- OR all branches at Level 4+
### Pruning Threshold Formula
dynamic_threshold = max(0.40, best_confidence - 0.30)Example:
Level 0: 5 branches, 5 workers (parallel subagents)
├─ Branch A: 75% (3 workers for L1)
├─ Branch B: 68% (2 workers for L1)
├─ Branch C: 52% (1 worker)
├─ Branch D: 48% (1 worker)
└─ Branch E: 35% (PRUNED)
Best found: A.2 at 82% -> New threshold: 52%
-> Branch D PRUNED (48% < 52%)Pattern 2: Branch-Solve-Merge (BSM)
Decompose problems, solve sub-problems in parallel, merge results. Use when problems partition cleanly.
## Branch Phase
1. Analyze problem structure
2. Identify independent sub-problems
3. Define interfaces between sub-problems
## Solve Phase (parallel subagents)
1. Spawn worker per sub-problem (run_in_background: true)
2. Each worker solves independently
3. Workers report partial solutions
## Merge Phase
1. Collect all partial solutions
2. Apply merge strategy
3. Resolve conflicts
4. Synthesize final solutionMerge Strategies:
| Strategy | When to Use | Method |
| Consensus | Multiple workers on same problem | Majority agreement |
| Voting | Competing approaches | Weighted score aggregation |
| Aggregation | Complementary results | Union with deduplication |
| Synthesis | Conflicting valid results | Dialectical resolution |
Pattern 3: Mixture of Agents (MoA)
Layered proposer/aggregator architecture for ensemble confidence.
┌────────────────────────────────────────┐
│ Aggregator Layer │
│ (Synthesizes proposals, resolves │
│ conflicts) │
└──────────────────┬─────────────────────┘
│ Proposals flow up
┌────────────────────────────────────────┐
│ Proposer Layer │
│ ┌────────┐ ┌────────┐ ┌────────┐ │
│ │Prop 1 │ │Prop 2 │ │Prop 3 │ │
│ │(ToT) │ │(BoT) │ │(AT) │ │
│ └────────┘ └────────┘ └────────┘ │
└────────────────────────────────────────┘Conflict Resolution:
- If proposers agree: Boost confidence +5%
- If 2/3 agree: Use majority, document minority
- If no agreement: Escalate to DR (Dialectical Reasoning)
Pattern 4: Graph of Thoughts (GoT)
Arbitrary graph-structured reasoning with merge, split, and cycle operations.
| Operation | Description | Use Case |
| Branch | Split one thought into multiple | Generate alternatives |
| Merge | Combine multiple thoughts into one | Synthesize findings |
| Refine | Iterate on a single thought | Improve solution |
| Backtrack | Return to previous thought | Error correction |
| Cycle | Re-evaluate with new information | Iterative improvement |
[Problem]
│
┌───┴───┐
▼ ▼
[A] [B]
│ │
└───┬───┘
▼
[Merged]
│
▼
[Refined] <── Cycle
│
▼
[Solution]Pattern 5: Self-Consistency with RASC
Efficiency: 70% compute reduction vs naive self-consistency
Generate multiple reasoning paths, cluster by rationale similarity, use representative answers.
## Phase 1: Generate K reasoning paths (parallel subagents)
## Phase 2: Cluster paths by rationale similarity
## Phase 3: Select representative from each cluster
## Phase 4: Weighted vote among representatives
Cluster A (size 3): "team autonomy" -> Microservices
Cluster B (size 3): "scalability" -> Microservices
Cluster C (size 2): "simplicity" -> Monolith
Final: Microservices (70% weighted agreement)Integration with Cognitive Skills
BoT: Parallel Branch Exploration
Spawn 8-10 parallel workers (subagents with run_in_background)
Each explores one approach independently
Pruning after ALL Level 0 complete (static 40% threshold)ToT: MCTS-Style Search
UCB1(branch) = avg_score + C * sqrt(ln(N) / n_branch)
Run parallel rollouts from each branch (subagents)
Use UCB1 to decide which branches get more rolloutsHE: Parallel Hypothesis Testing
Phase 1: Generate hypotheses
Phase 2: Identify independent evidence (parallel subagents)
Phase 3: Parallel evidence gathering
Phase 4: Synchronized hypothesis update + eliminationAT: Multi-Perspective via MoA
Proposer 1: Technology domain analogies (subagent)
Proposer 2: Nature/biology analogies (subagent)
Proposer 3: Business/economics analogies (subagent)
Aggregator: Cross-analogy synthesis (main session)Pruning Strategies
| Pattern | Threshold | Rationale |
| BoT | Static 40% | Conservative breadth |
| ToT | Static top-1/top-2 | Aggressive, find single best |
| DPTS | Dynamic (best - 30%) | Adaptive to landscape |
| HE | Evidence-based | Prune when evidence eliminates |
| MoA | Agreement-based | Prune minority after consensus |
Anti-Patterns
- Parallelizing sequential dependencies - If step 2 needs step 1's output, don't parallelize
- Too many branches - 5-10 at Level 0 is reasonable; 20+ causes diminishing returns
- No merge strategy defined - Always know how to combine results before fan-out
- Ignoring shared state - Workers must write to isolated paths; merge in fan-in
- Parallel everything - Some problems are inherently sequential; accept it
Quick Reference
| Situation | Pattern | Why |
| Independent file reads | Parallel tool calls | Built-in, zero overhead |
| Independent research | Parallel subagents | Background execution |
| Coordinated editing | Agent teams / worktrees | Avoid conflicts |
| Explore unknown space | DPTS + BoT | Dynamic pruning, parallel breadth |
| Find optimal option | MCTS + ToT | Simulation-guided depth |
| Decomposable problem | BSM | Clean partition and merge |
| Need ensemble confidence | MoA or RASC | Multiple perspectives |
| Iterative refinement | GoT | Merge and cycle support |
| Test hypotheses | Parallel HE | Independent evidence gathering |
Configuration
Note: The configuration below is illustrative — these are conceptual thresholds for reasoning about parallelization, not actual Claude Code configuration settings.
{
"parallel_execution": {
"max_workers": 10,
"worker_timeout_minutes": 30,
"pruning": {
"bot_threshold": 0.40,
"tot_keep_top": 2,
"dpts_margin": 0.30
},
"merge_strategies": {
"default": "aggregation",
"conflict_resolution": "weighted_voting",
"confidence_agreement_boost": 0.05
}
}
}Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

