Claude Code Parallel Subagent Patterns: Fan-Out, Fan-In, and Synchronization Strategies That Actually Work A developer outlines a three-phase pattern for running parallel Claude Code subagents: fan-out with bounded concurrency of three to five slots, isolated work on disjoint file paths, and fan-in with deterministic merge order. The approach is presented as a fix for the duplicate work, context pollution, and merge conflicts that arise when subagents are treated as independent workers sharing one codebase. The developer argues bounded slots keep active context predictable, citing five subagents at 40K tokens each as fitting within typical team quotas. This article was written with the assistance of AI, under human supervision and review. Most parallel subagent implementations fail because teams treat them like independent workers when they are actually interdependent processes sharing a single codebase. The result is duplicate work, context pollution, and merge conflicts that consume more time than serial execution would have taken. The pattern that teams overlook is bounded concurrency with explicit coordination. When you dispatch five subagents to analyze different parts of a monorepo, each session sees a different snapshot of the filesystem at fork time. Without synchronization barriers and merge strategies, their outputs diverge. The orchestrator ends up reconciling contradictory recommendations or silently dropping half the work. The fix is a three-phase pattern: fan-out with bounded slots, isolated work on non-overlapping paths, and fan-in with deterministic merge order. The orchestrator enforces concurrency limits typically three to five subagents , assigns disjoint file sets, and collects results in dependency order before applying any writes. This eliminates race conditions and makes the parallel work actually faster than serial. This matters because parallel subagents are the only way to handle large-scale refactors or multi-package analysis within reasonable token budgets. Serial execution hits context limits around 200K tokens. Parallel patterns let you process 1M+ token codebases by partitioning the work, but only if you control the coordination overhead. The fan-out pattern dispatches multiple subagents at once, each handling a discrete slice of the overall task. The failure mode here is subtle but expensive: launching ten subagents to "analyze the codebase" without explicit boundaries creates ten overlapping contexts. Each session reads shared files, proposes conflicting changes, and the orchestrator spends more time reconciling than you saved by parallelizing. The correct pattern enforces three constraints before dispatch. First, the orchestrator calculates a bounded concurrency limit based on token budget and task complexity. Three to five slots is the tested range for most monorepo work. Second, the orchestrator partitions the input space into disjoint sets: packages, modules, feature directories, or test suites. Third, each subagent receives an explicit scope that prevents overlap. The orchestrator holds a queue of pending tasks and releases new work only when a slot opens. This structure prevents context pollution because no two subagents read or write overlapping files. When Subagent A works on src/auth and Subagent B works on src/api , their file reads are isolated. The orchestrator tracks which paths are in-flight and holds back tasks that would violate the disjoint guarantee until conflicting work completes. The token budget constraint matters because each subagent session carries its own context window. If you dispatch ten subagents simultaneously on a 200K token codebase, you burn 2M tokens in parallel. The API rate limits and cost controls both fail. Bounded slots keep total active context predictable: five subagents at 40K tokens each is 200K simultaneous usage, which fits within most team quotas. Parallel subagent orchestration dashboard The orchestrator implementation uses a simple state machine. The queue is a priority list of pending scopes. The active set tracks running subagent sessions. When a subagent completes, the orchestrator marks that slot available and pulls the next task from the queue. The transition logic ensures you never exceed your slot limit and never double-book a file path. Fan-in is where most parallel implementations break. The orchestrator receives five result sets from completed subagents and needs to produce a single coherent output. The naive approach concatenates all results and hands them to a final merge session. This fails because merge complexity grows quadratically with the number of inputs. Five 10K token reports become a 50K token merge task that the final session cannot process without losing context on half the recommendations. The working pattern is dependency-ordered collection with incremental merge. The orchestrator maintains a dependency graph of the original scopes. When src/ui depends on types from src/api , the orchestrator collects the src/api results first, applies those changes to the working tree, and then merges src/ui results against the updated state. This converts an N-way merge into N sequential 2-way merges, each of which fits comfortably in context. interface SubagentResult { scope: string; changes: FileChange ; summary: string; dependencies: string ; } async function fanInResults results: SubagentResult , depGraph: DependencyGraph : Promise