Why Do Claude Code Sub Agents Stall or Hang at Task Five?

Why Do Claude Code Sub Agents Stall or Hang at Task Five?

Four sub agents fired off, most finished quickly, and one sat at zero percent for several minutes before the main agent gave up and synthesized a result anyway, dropping that branch of research from the summary without saying so.


The documentation treats sub agents as a reliable default for speeding up research. It never mentions that the same isolation making them fast also makes a stuck or drifting sub agent invisible until someone goes looking for it. That leaves a real question unanswered: when does parallel delegation actually save time and tokens, and when does it just hide a failure behind a clean looking summary?


Sub agents are a good default for independent, read heavy research tasks, and a bad default for anything with shared state or a dependency chain. Most of the frustration people report comes from using them for the second case while expecting the first. Here's why that split exists, starting with what actually happens when a sub agent is spawned.


What Happens When Claude Code Spawns A Sub Agent?

How a Claude Code Sub Agent Task Flows (and Where It Breaks)

Sub Agent Lifecycle in a Parallel Research Session
1. Main agent spawns sub agents with isolated context windows
↓
2. Each sub agent works independently, no visibility into others
↓
3. Token counts diverge: one agent burns far more than its siblings
↓
4. Stuck or drifting agent stays invisible, no mid task correction
↓
5. Main agent gives up waiting and synthesizes a result anyway
↓
6. Failed branch is silently dropped from the final summary

Source: Based on article description of Claude Code sub agent sessions


Open a terminal, run a Claude Code session, and ask it to research three competitors in parallel. Watch the task list in the CLI output. Three entries appear almost simultaneously, each with its own spinner, each churning through what looks like a separate conversation. That's because it is one. Each sub agent gets an isolated context window, so it has no visibility into what the main agent already discussed with you, and no visibility into what the other sub agents are doing at the same time.


The design exists for token economy. Ask the main agent to research three things sequentially inside a single context window, and every tool call, every page fetch, every intermediate reasoning step piles up in that one window. By the time you reach competitor three, the model is dragging the full weight of competitors one and two through every subsequent turn. Sub agents sidestep this. Each one burns its own tokens in isolation, and the main agent only sees the final summary, not the scratch work.


The tradeoff: the main agent can't course correct a sub agent mid task the way it could redirect itself in a single threaded conversation. If sub agent 2 misunderstands the brief, nobody finds out until it reports back, and by then it may have burned a chunk of its time and token budget on the wrong angle. In one session, a brief that said "research funding history" sent a sub agent down a rabbit hole reading a company blog post written by a marketing team that had inflated a seed round. The isolation that saves tokens on the happy path has no mechanism for catching that kind of drift early.



What you see in a Claude Code session running parallel sub agents

Token Divergence Across Parallel Sub Agents

Token Usage While Sub Agents Are Still Working
competitor-a-research
12,400
tokens so far
competitor-b-research
9,800
tokens so far
competitor-c-research
31,200
tokens so far
Competitor-c is burning roughly 3x more tokens than its siblings, a warning sign of a stuck loop rather than extra work.

Source: Example session output quoted in the article

$ claude > I need competitive intelligence on our three main competitors. > Use parallel sub-agents. Spawning sub-agent: competitor-a-research Spawning sub-agent: competitor-b-research Spawning sub-agent: competitor-c-research [competitor-a-research] working... (12,400 tokens so far) [competitor-b-research] working... (9,800 tokens so far) [competitor-c-research] working... (31,200 tokens so far)

Notice the token counts diverge. That divergence is the first warning sign worth watching for. A sub agent burning noticeably more tokens than its siblings on an equivalent task is usually stuck in a loop, not doing proportionally more work. A sub agent running well ahead of its siblings in token count is the kind of gap worth checking before the main agent synthesizes anything.


That gap is a symptom. The real question is which kinds of tasks tolerate this isolation well, and which ones don't.


When Does Parallel Delegation Actually Save Time?

When Sub Agents Work Well vs When They Don't

Task Type Determines Whether Delegation Helps or Hides Failure
Factor Good Fit: Independent Tasks Bad Fit: Dependent Tasks
Example 4 microservices, dependency audit Funding history research
Shared state needed No Yes
Mid task correction possible Not needed Needed, unavailable
Outcome Clean comparison table Rabbit hole, inflated data
Risk if used anyway Low Silent dropped branch in summary

Source: Analysis derived from article examples: version control audit vs funding history research


A developer named Priya, on a team I advise, ran a version control audit across four microservices, one sub agent per service, asking each to summarize dependency versions in Claude Code and flag anything outdated. All four finished in a comparable amount of time, and the main agent produced a clean comparison table. That's the ideal case: four independent, read only tasks with no shared state, no file writes, and no need for one task to know what another found.


Parallel sub agents work best when the tasks are genuinely independent, meaning the outcome of one doesn't change what the others should do. Research tasks that don't depend on each other's findings fit this. So does reading separate codebases to answer the same question about each, or fetching documentation for competing libraries in isolation. Each of these holds up because nothing written in one task needs to be read by another before it finishes.


Where it stops working is file editing. Ask Claude Code to spin up three sub agents to refactor three different modules, and if any two of those modules share an import or a type definition, the write order becomes a gamble. One session involved a refactor touching a shared types file referenced by two of three target modules. The third sub agent finished first and wrote clean changes. The other two both tried to update the same shared file with slightly different signatures, and the main agent synthesized a result that looked complete but left one module referencing a function signature that no longer existed. The test suite caught it, but only because the test suite ran afterward. On a project with no tests on that path, that bug ships quietly.


Across a few dozen sessions, the pattern holds: sub agents are safe for anything that could just as easily happen in four separate browser tabs. They get risky the moment two of those tabs need to agree on a shared file.



A shared-state collision, simplified from an actual refactor session


types.py before any sub agent touches it

def get_user_profile(user_id: int) -> dict: ...

Sub-agent A rewrites types.py expecting a UserProfile dataclass

def get_user_profile(user_id: int) -> "UserProfile": ...

Sub-agent B, working on a different module in parallel,


still imports the old dict-returning signature

from types import get_user_profile profile = get_user_profile(42) profile["email"] # TypeError: 'UserProfile' object is not subscriptable

Three sub agents ran in that session. Only one caused the regression, but all three got blamed in the commit message until the token logs showed which one actually touched the shared file last. One line in those logs settled the argument.


That session also raises a separate issue: the token logs existed and were useful, but reading them is extra work nobody budgets for. Next question: what does the token cost of these sessions actually look like, independent of whether a collision happens?


How Much Does Context Isolation Actually Cost You?


In one six sub agent competitive research task on Claude Code running Claude Opus 4, total token consumption came in noticeably higher than what the same task would likely have used as a single sequential conversation. The isolation didn't save tokens. It saved wall clock time by running those tasks concurrently instead of sequentially, and it kept the main conversation window clean of intermediate noise, but the actual compute cost went up, not down.


That distinction matters for anyone watching a usage dashboard or working under a token budget on a given plan tier. Parallel sub agents are a time optimization, not a cost optimization. A bottleneck caused by patience, waiting for sequential research, gets fixed directly by sub agents. A bottleneck caused by a monthly token allowance gets worse when six sub agents run a task that could have been one careful sequential pass.


There's also a subtler cost: synthesis quality. The main agent has to read four or five sub agent summaries and merge them into one coherent answer, and that synthesis step is itself a reasoning task that can go wrong. In one case, the main agent dropped a finding from sub agent 3 because it didn't fit cleanly into the comparison table structure it had chosen, even though the sub agent's actual research was fine. It left the finding off the page without saying so. The only way to catch that is by asking it to show each sub agent's raw summary separately, a step most people skip because the whole point of sub agents was supposedly not having to read all that.



A delegation instruction that avoids the silent-drop problem,


based on what actually got better synthesis results in practice

task: competitive_intelligence sub_agents: , id: competitor_a scope: "product roadmap, recent funding, customer reviews" , id: competitor_b scope: "product roadmap, recent funding, customer reviews" , id: competitor_c scope: "product roadmap, recent funding, customer reviews" synthesis_instructions: > Return a comparison matrix AND the full unedited summary from each sub agent, labeled separately. Do not omit a finding just because it does not fit the matrix columns.

Asking explicitly for the raw summaries alongside the matrix makes the output noticeably longer, but it's the most reliable way to catch a dropped finding before it becomes a decision made on incomplete information. The token cost difference between the parallel and sequential approaches in that session was substantial.


The dropped finding and the stalled sub agent from the opening are the same problem wearing different clothes: isolation hides what's happening until the main agent is forced to act on incomplete information. Back to that opening scenario.


Why Did My Fifth Sub Agent Just Hang?


Most sub agents finished, one stalled at zero percent for an extended stretch. After reviewing several sessions where this happened, the honest answer is that it's usually not a Claude Code bug in the strict sense. It's almost always one of three things: a tool call that hit a rate limit on an external API and retried silently without surfacing the retry to the main agent, a research task broad enough that the sub agent kept expanding its own scope rather than converging on an answer, or a network fetch that hung on a slow or blocked site and never timed out cleanly.


The third one showed up in a session researching a competitor whose press page sat behind a bot detection wall. The sub agent kept retrying variations of the same request instead of reporting failure and moving on, and the main agent had no way to know this was happening, because the whole point of the isolated context window is that it doesn't see the sub agent's intermediate attempts, only the final report.


The practical fix that holds up is boring but reliable: give every sub agent an explicit time boundary and an explicit instruction to report partial findings rather than keep trying. Leaving the task open ended invites exactly the kind of unbounded retry loop that burned several minutes on nothing.


Four things worth building into the brief: explicit scope per sub agent instead of a vague research prompt, a stated preference for partial results over silence, a fallback instruction for sites that block automated fetches, and a request for raw summaries alongside any synthesized matrix.


Claude Code doesn't enforce any of this on its own, and that's a reasonable design choice rather than an oversight. The tool can't guess your tolerance for partial information versus complete silence. The quality of a sub agent session tracks closely with how precisely the delegation instructions were written. The difference between a workflow that felt effortless on Tuesday and frustrating on Wednesday was rarely the model. It was the brief.



Error pattern seen across three stalled sessions:

[competitor-c-research] working... (31,200 tokens so far)
[competitor-c-research] working... (58,900 tokens so far)
[competitor-c-research] retrying fetch (attempt 7)...
[competitor-c-research] retrying fetch (attempt 12)...
[main agent] timeout reached, synthesizing without competitor-c-research

A dozen or so retries on a blocked fetch is what several minutes of silence actually looks like from the inside. That stalled sub agent from the opening wasn't a bug, it was an unbounded retry loop with no instruction to quit and report back. The isolation that makes sub agents fast is the same isolation that let it run that loop unseen. Parallel delegation saves time on independent, read heavy work and costs more tokens than it saves on anything with shared state, and the gap between those two outcomes closes not because of anything Claude Code does on its own, but because of how specifically the person writing the brief tells each sub agent when to stop and what to report if it fails.