CLAUDE LABJP
2.1.278 — The auto mode classifier now runs server-side by default on the Claude API, Enterprise, Bedrock, Vertex and Foundry. You are not billed for the classifier, and /status gained an Auto mode server lineTASKOUT — The TaskOutput tool is gone. taskOutputMaxChars and TASK_MAX_OUTPUT_LENGTH no longer do anything, and background output is read with Read instead10/07 — The old management-configuration key spellings are accepted until noon PT on October 7, seventeen days from now. After that, entries that still use them stop working until you rewrite themBUNPANIC — Reports are coming in of the newest build crashing on launch alone. Earlier builds still run on the same machine, which points at the release rather than the environmentNEW — Deciding what belongs in Cowork and what belongs in Claude Code, using the approval boundary as the lineSONNET4.5 — A date in a deprecation table is a floor, not an end date. Sonnet 4.5 is still active and no deprecation notice has been posted2.1.278 — The auto mode classifier now runs server-side by default on the Claude API, Enterprise, Bedrock, Vertex and Foundry. You are not billed for the classifier, and /status gained an Auto mode server lineTASKOUT — The TaskOutput tool is gone. taskOutputMaxChars and TASK_MAX_OUTPUT_LENGTH no longer do anything, and background output is read with Read instead10/07 — The old management-configuration key spellings are accepted until noon PT on October 7, seventeen days from now. After that, entries that still use them stop working until you rewrite themBUNPANIC — Reports are coming in of the newest build crashing on launch alone. Earlier builds still run on the same machine, which points at the release rather than the environmentNEW — Deciding what belongs in Cowork and what belongs in Claude Code, using the approval boundary as the lineSONNET4.5 — A date in a deprecation table is a floor, not an end date. Sonnet 4.5 is still active and no deprecation notice has been posted
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 Code255subagents9architecture10automation110

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 $15 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-09-02
Two hooks that record every model switch and stop the ones you never agreed to
Build a PostModelSwitch hook that logs every model change and a PreModelSwitch hook that blocks unapproved switches during unattended runs. Complete scripts, measured timings, and the reason the two jobs must stay separate.
Claude Code2026-08-31
Half of My Scheduled Runs Vanished Without a Single Error
A batch job set to run twice a day was only firing once. No errors, no failure alerts. Here is how to expand your own schedule, count expected runs, and reconcile them against execution records to catch silent misses.
📚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