The Search Should Happen in a Context You Can Throw Away
Finding something in a large system is a messy activity, and the mess is the problem. When an agent goes looking for the one file that handles a particular flow, or the one paragraph in a long reference that answers a question, it does not arrive there in a straight line. It searches, reads candidates, follows a lead that goes nowhere, backs out, and tries again. Every one of those steps leaves residue in the context window, and by the time the right answer surfaces, the agent is carrying a great deal of material it no longer needs and will keep carrying for the rest of the task. The durable move is to refuse to let that happen in the working context at all. Run the search somewhere separate and disposable, and let only the answer come back.
This is not a claim about tidiness. It is a claim about where a scarce resource gets spent. The main agent’s context is the space in which the actual work is reasoned about, and discovery, done inline, quietly fills that space with the debris of a process whose only product is a single fact. Delegating the search to a child agent is the cleanest way to keep the debris out of the room where it would do damage.
Discovery produces far more state than it yields
The thing that makes discovery worth isolating is the ratio between what it generates and what it returns. Ask an agent to locate where a particular concern is implemented in an unfamiliar codebase, and the request expands the moment it starts running. A search returns dozens of matches, most of them irrelevant. Each promising candidate gets opened and read in full, useful or not, because the only way to know whether a file matters is to look at it. Some of those reads are dead ends that get abandoned after a paragraph. The trail wanders across directories before it converges. When it finally converges, the payload is tiny: an identifier, a location, maybe a sentence of context. Everything else was scaffolding for producing that one line, and all of it landed in the context window on the way.
The imbalance is structural, not a sign of a sloppy search. A well-run investigation still reads many wrong files before it finds the right one, because eliminating candidates is how the right one gets identified. The verbosity is intrinsic to the method. This is exactly why it deserves special handling. A task whose intermediate state is small can be done inline without consequence. Discovery is the opposite case: the intermediate state dwarfs the result, and if that state accumulates in the main context, the cost of finding one fact is paid in room that the rest of the work needed.
The residue has value only while the search is running
The sharper observation is that all of this intermediate state is worth something for exactly as long as the search is in progress, and nothing at all afterward. The rejected candidates, the raw query results, the source that looked right and was not, these are how the agent narrows toward the answer. They are working memory for the act of searching. The instant the answer is found, they invert. They stop being the tools of the search and become pure liability, because they occupy space and carry no further use.
Inline discovery keeps that liability resident. The dead ends the agent explored at the start of a task are still sitting in the context at the end of it, competing with everything that came after. This is where the cost turns from abstract to concrete. Context is not a neutral container that holds more or less without effect. Every token of stale search residue is a token the model must attend to alongside the material that actually bears on the task, and irrelevant content does not sit inertly. It dilutes attention, and as it piles up across a task it buries the load-bearing material deeper in the window, in the low-recall middle rather than at the well-attended edges, and can eventually crowd real work out of the window entirely. It is also billed and re-read on every subsequent turn, since the whole accumulated context is reprocessed each time the agent acts. A search done inline is not a one-time expense. It is a tax levied on every step that follows it, for a benefit that was fully collected the moment the answer appeared.
A child context absorbs the mess and then disappears
Delegation resolves this by moving the entire messy process into a context that is built to be discarded. The main agent does not perform the search. It frames the question precisely, states the shape of the answer it wants, and hands the whole thing to a child agent. The child runs the investigation in its own window, where all the verbose intermediate state accumulates as it must: the searches, the candidate reads, the dead ends. Then the child returns its finding, and its context is thrown away. The searches and dead ends lived and died inside the child. They never crossed into the parent.
The property doing the work here is that the child’s context is disposable. It exists to hold the mess of one investigation, and it is expected to vanish when that investigation concludes. The main agent receives the same answer it would have found inline, at a fraction of the residue: it gets the located answer without ever seeing the twenty sources that had to be read to find it. The verbose state is not compressed or summarized after the fact, which would still require generating it in the main context first. It is quarantined from the start, in a place where its eventual disposal is the plan rather than a cleanup step. The parent stays clean for the whole duration of the task, not because it was diligent about pruning, but because the material that would have needed pruning was never admitted.
The economics decide it, not the reflex
None of this makes delegation free, and treating it as a default is its own mistake. Spawning a child agent carries real overhead. There is the cost of standing up a fresh context, the latency of waiting for the investigation to finish before the parent can proceed, the tokens the child spends on its own reasoning, and the coordination of framing the question and consuming the result. For a lookup that is small, that overhead is larger than anything delegation saves. A system that reflexively hands every trivial search to a child agent spends more effort operating the delegation machinery than it would have spent doing the searches inline, and it is slower and more fragile for the trouble.
The deciding question is how much intermediate state a search will actually throw off. Nothing needs isolating when there is nothing to discover: a known location is just a read, and a short document in an obvious place resolves in one step. The overhead only repays itself once the volume of throwaway state climbs, which tends to happen in a few recognizable shapes. Mapping an unfamiliar codebase, where an answer surfaces only after a stack of candidates has been opened and ruled out, is the clearest. Hunting one applicable passage through a sprawling reference or changelog, where almost nothing on the page bears on the question, is close behind. And a lookup that has to chain several searches, each spawning its own pile of results before anything conclusive forms, is the third. In every one of these the intermediate state is large, and walling it off pays for itself quickly.
As a crude threshold, the calculus tips somewhere past a couple of chained reads. Under that, staying inline is quicker and the delegation overhead is dead weight. Past it, quarantining the mess earns its keep, and the margin only grows as the investigation deepens. What the pattern actually asks of you is the judgment to size a lookup before you commit to a way of running it, so the heavier machinery is reserved for the searches that will fill a window and the trivial ones never leave the main thread.
The answer has to come back small, or the isolation leaks
The entire benefit rests on one condition at the boundary: the child has to return something small and structured. The parent asked for a focused answer specifically so that its context would stay clean, and if the child instead returns a narrative, a walkthrough of everything it read and how it reasoned about it, the parent’s context is polluted just as badly as inline discovery would have polluted it, with the spawn overhead added on top. The verbose state that was supposed to die inside the child instead crosses the boundary and takes up residence in the parent anyway.
Preventing that is a matter of specifying the return before the child runs, not hoping for a tidy result after. The parent defines the shape of the answer up front, narrow enough that there is no room for a wall of text: the resolved identifier, a sentence of context, and nothing more. Left unspecified, a child that found something interesting has no guidance on how much to say, and it will default to the fluent thing, which is a paragraph of explanation. The constraint on the return is what keeps the isolation from leaking. It is the part of the pattern that turns a clean idea into a clean result, and it is worth as much deliberate attention as the decision to delegate at all.
Treat the finding as a hypothesis, not a verdict
One caveat rides along with the whole arrangement, and ignoring it undoes the value in a different way. The parent, by design, never sees the evidence the child gathered. It receives a conclusion stripped of the process that produced it, which is exactly what keeps the context clean, and also exactly what removes the parent’s ability to check the reasoning. So the finding has to be treated as a hypothesis rather than an established fact. A child agent can be wrong. It can miss a file that overrides the one it found, misread a signature, or return a result drawn from a stale version of a document.
How much that matters depends on the stakes of what comes next. For a low-consequence lookup, acting directly on the child’s answer is usually fine, and the occasional miss is cheaper than verifying every result. For a decision on the critical path, such as identifying the exact record about to be updated or the configuration about to be changed, the parent should spot-check the finding before it acts, because an error accepted here propagates into everything downstream and surfaces far from where it entered. Calibrating that trust to the stakes is the judgment the boundary asks for. Blind acceptance of every delegated finding is how a subtle discovery error becomes a defect three steps later that nobody can trace back to its source.
The trade is context for cost, and cost is the easier debt
What delegation really does is convert one kind of problem into another. Discovery threatens the main context with verbose, low-value residue that would otherwise sit there for the rest of the task, taxing attention and spend on every step. Delegation trades that threat away for a cost paid once: the overhead of a spawn, a wait, and a handoff. That is a good trade whenever the residue is large, because a context problem compounds across an entire task while a cost is settled at the moment it is incurred. A polluted context degrades everything that happens afterward; a one-time spend does not.
Seen that way, the pattern is less a coordination technique than a discipline for protecting a scarce resource. The main agent’s context is the space where the actual work is thought through, and it should be spent on that work, not on the debris of finding out where the work is. Push the search into a context built to be discarded, insist that only a small, structured answer comes back, and verify that answer when the stakes warrant. What remains in the working context is the task and its conclusions, which is all that was ever supposed to be there.
