I was deep in a Claude Code planning session — the kind where the main agent is holding a whole plan in its head — when a small thing broke. A health check on one of my services was hanging. A health check is just a URL the machine pings to ask “are you alive?”, and this one wasn’t answering.
“Quick fix,” I thought. Famous last words.
The hang turned out to be a thread I could not stop pulling. The endpoint wasn’t answering, which meant checking firewall rules, which meant the token auth — the little password the service uses to prove it’s allowed to talk — might be wired wrong, which meant a config file on a different box needed to change. Four steps in, I had a full infra investigation on my hands.
Here’s the part that matters. The agent session I was in has a context window — think of it as the desk space where it keeps everything it’s currently thinking about. It’s finite. Every firewall rule I read, every log line I pasted, every dead end I explored was paper piling up on that desk. And the desk was supposed to be holding the actual deliverable: the plan I came here to build.
If I let the agent dig, I’d solve the health check and lose the plan. The investigation would bury the thing I actually cared about.
So I didn’t let the main agent dig. I spawned a sub-agent — a fresh Claude Code worker with its own clean desk — and handed it three things: the context I’d already gathered (here’s the endpoint, here’s what I’ve ruled out), a crisp spec for what “done” looks like (tell me the root cause and the exact fix), and one hard rule: report a concise summary, no raw logs.
The sub-agent went down the hole. It read the firewall rules, chased the token wiring, found the cross-box config problem — and all that mess piled up on its desk, not mine. What came back was a paragraph. My main session’s desk stayed clear for the plan.
The trigger I now use is specific enough to act on without thinking: the moment a side task turns into a diagnosis of more than two steps with its own investigation surface, delegate it. One-step lookups I keep — the round-trip of spawning an agent isn’t worth it. But the instant something sprouts branches, it goes to a sub-agent.
The DIG / VERIFY / SYNTHESIS split give me the detail
Not everything should be delegated — the split matters:
- DIG (delegate): open-ended investigation that generates volume — reading logs, tracing config across boxes, reproducing a hang. This is where context gets burned fastest, and it’s exactly what a fresh sub-agent’s window is for.
- VERIFY (keep in main): adversarially checking load-bearing claims. If the sub-agent says “the token was expired,” the main session confirms that against the real deliverable’s assumptions. You don’t outsource the check on a claim your plan depends on.
- SYNTHESIS (keep in main): weaving results into the plan. This needs the full context you’ve been protecting.
The delegation prompt that keeps summaries clean:
You are diagnosing a hanging /health endpoint.
Context already gathered: [endpoint, ruled-out causes].
Deliverable: root cause + exact fix (file + change).
Report format: one-paragraph summary. Do NOT paste raw logs
or full file contents — only the specific lines that matter.That last constraint is load-bearing. Without it, the sub-agent returns a transcript and you’ve just moved the pile-up back onto your desk.
The mechanism is simple once you see it: raw investigation produces a lot of tokens, but the answer is small. A sub-agent lets you pay the token cost on a desk you’re about to throw away, and keep only the receipt.
Treat your main session’s context like the scarce resource it is. When a quick fix grows branches, don’t dig — send someone else down the hole and ask them to bring back a sentence.