All skills
Skillintermediate

šŸ›¤ļø Parallelization

<div align="center">

Claude Code Knowledge Pack7/10/2026

Overview

<div align="center">

šŸ  Home › Workflows › šŸ›¤ļø Parallelization

← 02 Routing ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā—ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā” 04 Orchestrator-Workers →

</div>

šŸ›¤ļø Parallelization

TL;DR: Execute independent tasks simultaneously and aggregate outputs. Two flavors: Sectioning (split data, combine all) and Voting (same task, pick best).


Core Concept

%%{init: {'theme': 'base', 'themeVariables': {'lineColor': '#64748b'}}}%%
flowchart LR
    classDef user fill:#6366f1,stroke:#4f46e5,stroke-width:2px,color:#ffffff
    classDef main fill:#8b5cf6,stroke:#7c3aed,stroke-width:2px,color:#ffffff
    classDef parallel fill:#3b82f6,stroke:#2563eb,stroke-width:2px,color:#ffffff

    IN["šŸ™‹ā€ā™€ļøšŸ“„"]:::user --> SPLIT["šŸ”šŸ”€ Split"]:::main
    SPLIT -->|"šŸ”šŸŖŗ"| A["🐦⚔"]:::parallel
    SPLIT -->|"šŸ”šŸŖŗ"| B["🐦⚔"]:::parallel
    SPLIT -->|"šŸ”šŸŖŗ"| C["🐦⚔"]:::parallel
    A -->|"šŸ¦šŸ“¤"| MERGE["šŸ”šŸŒ€ Merge"]:::main
    B -->|"šŸ¦šŸ“¤"| MERGE
    C -->|"šŸ¦šŸ“¤"| MERGE
    MERGE -->|"šŸ”šŸ“¤"| OUT["šŸ’ā€ā™€ļøšŸ“¤"]:::user

Key Insight

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│  āš ļø  IMPORTANT: Parallelization vs Orchestrator-Workers                     │
ā”œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¤
│                                                                             │
│  In Parallelization, all spawned subagents are IDENTICAL.                   │
│  Same prompt, same capabilities. They are INTERCHANGEABLE.                  │
│                                                                             │
│  šŸ›¤ļø Parallelization:        🐦⚔ = 🐦⚔ = 🐦⚔   (clones)                     │
│  šŸ¦‘ Orchestrator-Workers:   šŸ¦šŸ”’ ≠ 🐦⚔ ≠ šŸ¦šŸŽØ   (specialists)               │
│                                                                             │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

Characteristics

PropertyValue
ComplexityMedium
ParallelismHigh
Human-LoopOptional
IterationNone

2 Types of Parallelization

Type 1: šŸ›¤ļø Sectioning (Split DATA)

Break a task into independent subtasks run in parallel, then combine ALL results.

%%{init: {'theme': 'base', 'themeVariables': {'lineColor': '#64748b'}}}%%
flowchart LR
    classDef user fill:#6366f1,stroke:#4f46e5,stroke-width:2px,color:#ffffff
    classDef main fill:#8b5cf6,stroke:#7c3aed,stroke-width:2px,color:#ffffff
    classDef parallel fill:#3b82f6,stroke:#2563eb,stroke-width:2px,color:#ffffff

    S_IN["šŸ™‹ā€ā™€ļøšŸ“„ 100 files"]:::user --> S_SPLIT["šŸ”šŸ›¤ļø"]:::main
    S_SPLIT -->|"šŸ”šŸŖŗ"| S1["🐦⚔ Files 1-50"]:::parallel
    S_SPLIT -->|"šŸ”šŸŖŗ"| S2["🐦⚔ Files 51-100"]:::parallel
    S1 -->|"šŸ¦šŸ“¤"| S_MERGE["šŸ”šŸŒ€ Combine ALL"]:::main
    S2 -->|"šŸ¦šŸ“¤"| S_MERGE
    S_MERGE -->|"šŸ”šŸ“¤"| S_OUT["šŸ’ā€ā™€ļøšŸ“¤"]:::user

Examples:

  • Guardrails: One instance processes queries, another screens for inappropriate content
  • Evals: Each LLM call evaluates a different aspect of model performance

Type 2: šŸ—³ļø Voting (Same TASK, pick BEST)

Run the same task multiple times to get diverse outputs, then select the best.

%%{init: {'theme': 'base', 'themeVariables': {'lineColor': '#64748b'}}}%%
flowchart LR
    classDef user fill:#6366f1,stroke:#4f46e5,stroke-width:2px,color:#ffffff
    classDef main fill:#8b5cf6,stroke:#7c3aed,stroke-width:2px,color:#ffffff
    classDef parallel fill:#3b82f6,stroke:#2563eb,stroke-width:2px,color:#ffffff
    classDef success fill:#10b981,stroke:#059669,stroke-width:2px,color:#ffffff

    V_IN["šŸ™‹ā€ā™€ļøšŸ“„ Write headline"]:::user --> V_COPY["šŸ”šŸ”€ 3 attempts"]:::main
    V_COPY -->|"šŸ”šŸŖŗ"| V1["🐦⚔ Version A"]:::parallel
    V_COPY -->|"šŸ”šŸŖŗ"| V2["🐦⚔ Version B"]:::parallel
    V_COPY -->|"šŸ”šŸŖŗ"| V3["🐦⚔ Version C"]:::parallel
    V1 -->|"šŸ¦šŸ“¤"| VOTE{"šŸ”šŸ—³ļø Compare"}:::main
    V2 -->|"šŸ¦šŸ“¤"| VOTE
    V3 -->|"šŸ¦šŸ“¤"| VOTE
    VOTE -->|"šŸ”āœ… B wins"| BEST["šŸ† Best"]:::success

Voting Selection Strategies

StrategyHow It WorksBest For
LLM JudgeMain Agent compares outputs and selects bestCreative content, subjective quality
Scoring RubricEach output scored against criteria, highest winsCode review, compliance checks
ConsensusMajority agreement requiredCritical decisions, validation
Weighted VoteOutputs weighted by model capabilityMixed model ensemble

Summary

TypeWorkersInputOutput
šŸ›¤ļø SectioningIDENTICALDifferent DATA chunksCombine ALL
šŸ—³ļø VotingIDENTICALSame DATAPick ONE best

When to Use

Parallelization is effective when the divided subtasks can be parallelized for speed, or when multiple perspectives are needed for higher confidence results.


When NOT to Use

  • Tasks depend on each other's output
  • Sequential order matters
  • Limited resources

Variant: šŸš‚ Parallel Tool Calling

Execute multiple independent šŸ”§ tool calls in a single message for efficiency.

%%{init: {'theme': 'base', 'themeVariables': {'lineColor': '#64748b'}}}%%
flowchart TB
    classDef main fill:#8b5cf6,stroke:#7c3aed,stroke-width:2px,color:#ffffff
    classDef state fill:#10b981,stroke:#059669,stroke-width:2px,color:#ffffff

    MA["šŸ” Main Agent"]:::main -->|Single Message| TOOLS

    subgraph TOOLS["šŸš‚ Parallel Tool Calls"]
        T1["šŸ”§ Read file1.ts"]
        T2["šŸ”§ Read file2.ts"]
        T3["šŸ”§ Read file3.ts"]
    end

    T1 --> RESULTS["āœ… All Results"]:::state
    T2 --> RESULTS
    T3 --> RESULTS

    RESULTS --> MA

    classDef toolbox fill:#dbeafe,stroke:#3b82f6,stroke-width:2px,color:#1e40af
    TOOLS:::toolbox

Variant: 🧬 Master-Clone

Spawn multiple isolated 🐦 instances handling independent domains with no shared state.

Key Characteristics

PropertyValue
IsolationComplete - each clone has own context
State SharingNone - clones cannot communicate
Best ForIndependent domains, parallel generation
Merge StrategyCombine all outputs (no conflict resolution needed)

Diagram

%%{init: {'theme': 'base', 'themeVariables': {'lineColor': '#64748b'}}}%%
flowchart TB
    classDef main fill:#8b5cf6,stroke:#7c3aed,stroke-width:2px,color:#ffffff
    classDef subagent fill:#ec4899,stroke:#db2777,stroke-width:2px,color:#ffffff
    classDef state fill:#10b981,stroke:#059669,stroke-width:2px,color:#ffffff

    MA["šŸ” Main Agent"]:::main

    MA -->|"Context: fr-FR"| C1["🐦 Clone: fr-FR"]:::subagent
    MA -->|"Context: es-ES"| C2["🐦 Clone: es-ES"]:::subagent
    MA -->|"Context: de-DE"| C3["🐦 Clone: de-DE"]:::subagent

    C1 -->|9 files| R1[Result: fr-FR]
    C2 -->|9 files| R2[Result: es-ES]
    C3 -->|9 files| R3[Result: de-DE]

    R1 --> MERGE["āœ… Merge Results"]:::state
    R2 --> MERGE
    R3 --> MERGE

    MERGE --> MA

When to Use Master-Clone

Use CaseWhy Master-Clone?
Multi-locale generationEach locale is independent domain
Multi-platform buildsiOS, Android, Web don't share state
Parallel documentationEach doc section is self-contained
A/B test generationVariants shouldn't influence each other
Multi-tenant operationsTenant data must be isolated

<div align="center">

← 02 Routing ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā—ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā”ā” 04 Orchestrator-Workers →

</div>