Skip to lesson

AnthropicClaude Certified Architect – Foundations2026-105.4 Manage context effectively in large codebase exploration

Delegate searches and retain the coordination map

Completed by the knowledge check

Learning objective

Offload narrow codebase investigations to subagents while keeping overall coordination context compact.

Core idea

An architect exploring a large codebase needs a map of the system, not every search result that produced it. Keep the main conversation responsible for the investigation’s goal, verified relationships, unresolved questions, and next assignments. Delegate the reading that answers a bounded question to a subagent, then bring back the evidence needed to update that map.

Claude Code subagents run in separate context windows. Their intermediate reading and tool results stay in those windows; the main conversation receives their reports. This isolates verbose discovery, but it does not make the returned material free of context cost. Ten long reports can crowd the coordinator as effectively as ten long searches.

See 3.4.3 for choosing Explore during planning and 1.3.1 for defining a specialist. Here the decision is what the coordinator should retain after each investigation and how to keep repeated delegation from rebuilding the same context problem.

How it works

Assign a question with a finish line

Claude delegates through the Agent tool. In an interactive session, ask it to use a subagent for a specific investigation, such as finding refund entry points or identifying tests for the stock allocator. Give the relevant paths, symbols, exclusions, and required result directly in the assignment.

Use Explore for bounded codebase discovery (see 3.4.3), and define coverage from the question the coordinator needs answered.

A useful assignment identifies both the question and the evidence that closes it. For example, ask which routes invoke RefundLedgerService.post_reversal(), require each route-to-method chain with file paths, and require explicit unresolved edges. A bare request to explore billing lacks a finish line and invites a survey whose size the coordinator cannot predict.

Keep the output contract compact

Require the report to separate findings, evidence locations, coverage, and open questions. These are your assignment’s categories, not built-in response fields. A finding should name the symbol and its role; evidence should name where the worker established it; coverage should identify what it searched.

The coordinator usually needs a call chain and the uncertain edge, not the complete output of every search. If exact detail is needed later, preserve it in an ordinary findings file using the persistence ownership described in 5.4.2.

Do not compress away uncertainty to meet a length target. “No callers found in routes/” is a bounded observation. “Nothing calls this method” is a much wider claim. Returning the searched scope preserves the difference without attaching pages of negative search results.

Update one coordination map

After each report, keep only what changes the investigation: a confirmed dependency, a contradicted assumption, an unanswered question, or a decision about the next search. Record which worker owns each open question so another assignment does not silently repeat it.

For a refund investigation, the compact map might retain that the HTTP route reaches the ledger service, that restocking runs separately, that background-job callers remain unverified, and that the next worker should inspect those jobs. It need not retain directory listings that only helped locate the files.

Keep the map organized around the original question. A report about the refund route closes only that branch; it does not close the scheduled-job branch. Mark the route edge as verified, keep the job edge unresolved, and assign that gap explicitly. When a worker contradicts an edge, keep its evidence pointer and reopen the question instead of accumulating two incompatible maps in the coordinator’s context.

Anthropic documents parallel research as useful when the paths do not depend on one another. Test-file discovery and a ledger caller search can run independently. An investigation into duplicate refunds that depends on the first worker’s caller map should receive that map before it starts. See 1.3.5 for execution ordering and 5.4.4 for phase summaries.

Preserve input isolation deliberately

Pass task-specific background through the delegation prompt (see 1.3.3). Explore skips startup CLAUDE.md loading (see 3.4.3), so restate required exclusions such as generated code in its assignment.

Delegation reduces the coordinator’s reading load; it does not eliminate the worker’s token use. Choose it for substantial discovery that would otherwise pollute the main context. A small lookup that needs frequent clarification can remain in the main conversation.

Key distinctions and trade-offs

Discovery context versus coordination context: Discovery includes searches, file reads, and rejected leads. Coordination retains the system map and the questions that determine the next step. The report is the boundary between them.

Narrow scope versus incomplete scope: A narrow worker answers one well-defined question thoroughly enough to support its result. It does not silently omit a required package to shorten the report.

Separate context versus no context cost: The worker’s intermediate output stays separate, but its returned report occupies the main window, and the worker sends requests of its own.

Delegation works best when you can define a useful result before the search starts. When every small discovery needs a conversation with the requester, the repeated handoffs can add overhead without producing a clearer map.

Architecture / decision scenario

A developer productivity agent is mapping a legacy order system before a refund change. The coordinator has already read long directory listings and begins describing “typical billing layers” instead of naming the classes it found.

It assigns Explore one question: identify refund routes and return route-to-ledger chains with paths and unresolved calls. A separate Explore assignment locates refund tests, reports the search scope, and distinguishes direct ledger coverage from route coverage. Both assignments exclude generated files explicitly.

The coordinator retains three conclusions: which route calls the ledger, which tests cover that route, and which job callers still need investigation. It persists those findings using the workflow in 5.4.2. It then delegates the job caller question with the verified ledger path rather than asking another worker to explore all billing code.

If the reports contain every file read, the coordinator asks for a shorter evidence-bearing handoff before continuing. The aim is a usable system map with precise gaps, while verbose investigation remains in the workers’ contexts.

Common exam traps

  • Keeping every discovery read in the main conversation to avoid handoff loss.
  • Delegating “explore the codebase” without a bounded question or return contract.
  • Assuming separate worker windows prevent long returned reports from consuming context.
  • Treating one verified route as a complete map while job callers remain unresolved.
  • Treating a scoped search with no matches as proof of absence across the repository.

What to remember

Delegate verbose reading through a bounded Agent assignment, return compact findings with evidence and coverage, and retain the map that drives subsequent work. Keep required constraints in the worker’s prompt. Context isolation is effective only when the coordinator also controls what comes back.

Knowledge check

References