CLAUDE LABJP
CORPS — Anthropic unveils Claude Corps (Jun 11), a $150M national fellowship placing 1,000 early-career workers inside US nonprofits; the first cohort starts in OctoberSUBAGENTS — Claude Code sub-agents can now spawn their own sub-agents, up to 5 levels deep — multi-stage delegation workflows out of the boxWORKFLOWS — Dynamic workflows arrive in research preview across CLI, Desktop, and VS Code for codebase-wide bug hunts and large migrations (Max/Team/Enterprise)BILLING — 2 days to the Jun 15 change: Agent SDK, headless runs, and GitHub Actions move to monthly credits ($20/$100/$200); Sonnet 4 and Opus 4 retire from the API the same dayFABLE5 — Fable 5 remains included free on Pro, Max, Team, and Enterprise through Jun 22CODE80 — IPO coverage reports Claude now writes over 80% of its own code, up from under 10% in February 2025CORPS — Anthropic unveils Claude Corps (Jun 11), a $150M national fellowship placing 1,000 early-career workers inside US nonprofits; the first cohort starts in OctoberSUBAGENTS — Claude Code sub-agents can now spawn their own sub-agents, up to 5 levels deep — multi-stage delegation workflows out of the boxWORKFLOWS — Dynamic workflows arrive in research preview across CLI, Desktop, and VS Code for codebase-wide bug hunts and large migrations (Max/Team/Enterprise)BILLING — 2 days to the Jun 15 change: Agent SDK, headless runs, and GitHub Actions move to monthly credits ($20/$100/$200); Sonnet 4 and Opus 4 retire from the API the same dayFABLE5 — Fable 5 remains included free on Pro, Max, Team, and Enterprise through Jun 22CODE80 — IPO coverage reports Claude now writes over 80% of its own code, up from under 10% in February 2025
Articles/Claude Code
Claude Code/2026-06-13Advanced

Context Budgets for Nested Subagents: Designing Contracts So 5-Level Delegation Doesn't Lose Quality

Once subagents could nest, deeper delegation made summaries thinner and reruns more frequent. Here is how I rebuilt quality by adding four contracts between layers: token budgets, a handoff schema, failure isolation, and an independent grader.

Claude Code143subagents5architecture7automation61

Premium Article

One night a scheduled run kept going forty minutes longer than usual. Tracing the logs, the subagent I had handed article generation to had spawned a grandchild for verification, which spawned a great-grandchild, and by the fourth level they were repeating the same consistency check in a loop. Nobody held the role of stopping.

As soon as subagent nesting shipped, I rebuilt the blog automation for the four sites I run as an indie developer — moving from a single fan-out of children to a tree of delegation. Going deep was genuinely convenient. But the moment I went deep, my quality metrics got worse. Summaries thinned out one level at a time, reruns climbed, and token spend swelled.

The cause was not the extra depth itself. It was the absence of any contract between the layers. These are the four contracts I added over three weeks at Dolice Labs — token budgets, a handoff schema, failure isolation, and an independent grader — and the numbers behind them.

"Can go deep" and "should go deep" are different questions

Tree delegation carries two kinds of decay that flat parallelism never had.

The first is summary decay. When a child returns to a parent, it summarizes its work log. The grandchild summarizes to the child, and the child summarizes that summary again on the way up. Information compresses at every hop, and stacked four deep, what reached the parent was a single line — "completed successfully." That is an accident, not a report.

The second is loss of control. The parent does not watch its grandchildren directly. When a middle layer runs away, all the parent receives is "in progress," with nothing to decide on. The forty-minute runaway above was exactly this.

So the design question is not "how many levels can I go," but "what contract does each layer sign with the ones above and below it." Depth is a result, not a goal.

Hand each layer a context budget: the token contract

The first thing I added was token-budget allocation. The parent holds the total budget, and every time it delegates, it explicitly passes the child the token amount it is allowed to spend. The child then carves a share for its own grandchildren.

Even allocation did not work. The leaves do the most concrete work yet run out of budget — a tapering problem. I decay the share with depth while guaranteeing a floor at the leaf.

def allocate_budget(total: int, depth: int, max_depth: int = 3,
                    leaf_floor: int = 8000) -> dict:
    """Split the parent's remaining `total` between this layer and its children.
    decay: tighter the deeper you go, capping any single layer's runaway.
    leaf_floor: guarantees the leaf can finish its concrete work.
    """
    if depth >= max_depth:
        return {"self": max(total, leaf_floor), "children_pool": 0}
 
    decay = 0.55 ** depth          # depth0=1.0, depth1=0.55, depth2=0.30
    self_share = int(total * 0.35 * decay)
    children_pool = total - self_share
 
    # If what's left for children dips under the leaf floor, do not go deeper
    if children_pool < leaf_floor:
        return {"self": total, "children_pool": 0, "force_leaf": True}
 
    return {"self": self_share, "children_pool": children_pool}

When force_leaf comes back, that layer stops delegating and finishes the work itself. This became "depth limiting by budget." Even in an environment that permits five levels, my article workflow hits the leaf floor at three, so it effectively caps at three. Letting the budget form the ceiling, rather than hardcoding a depth constant, flexes with how heavy the task is — which I find far easier to live with.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
A budget-allocation algorithm that hands each layer its own token allowance, plus code that degrades summaries when a layer runs out
Measured results from three-level delegation: rerun rate down from 23% to 7%, summary fidelity up from 0.62 to 0.88
A rubric for an independent grader placed at the leaf, so a layer never scores its own output
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Claude Code2026-06-13
How Deep Should Nested Subagents Go? Rethinking My Delegation Tree After Claude Code's 5-Level Limit
Claude Code subagents can now spawn their own subagents, up to five levels deep. I rebuilt my automation around nesting and settled on three levels — here is why.
Claude Code2026-06-13
When Your Edited SKILL.md Doesn't Take Effect — Hot-Swapping Claude Code Skills with /reload-skills and Auto-Loaded .claude/skills
A practical routine for hot-swapping Claude Code skills without restarts: /reload-skills, SessionStart hooks, and version stamps that show which SKILL.md is live.
Claude Code2026-05-30
Authoring Dynamic Workflows: Building Reusable Research Pipelines with phase / agent / pipeline
A hands-on guide to writing your own Claude Code Dynamic Workflows: the phase / agent / pipeline / parallel primitives, locking outputs with JSON Schema, porting the adversarial-verification pattern, and designing for token cost.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →