AnthropicClaude Certified Architect – Foundations2026-105.4 Manage context effectively in large codebase exploration
Carry verified summaries into each phase
Completed by the knowledge check
Learning objective
Pass structured summaries into successive explorations rather than inheriting irrelevant transcripts.
Core idea
When an architect moves from mapping a codebase to investigating a specific risk, the next worker needs established facts and its own question. It rarely needs the complete transcript of how the map was discovered. Build a structured phase summary from verified findings and pass the relevant portion into the next exploration’s initial prompt.
A non-fork Claude Code subagent starts without the parent’s conversation history. Its delegation prompt is the explicit handoff of task-specific context. A fork instead inherits that history. Choose a fresh subagent with a summary when the previous phase contains substantial irrelevant discovery; choose inherited history only when that background is necessary for the work.
See 1.3.3 for the general delegation context contract and 1.3.7 for session forks. Here the decision is which evidence from a completed exploration belongs in the next one, and how to preserve continuity without copying its noise.
How it works
Finish the phase with an evidence summary
At the end of a mapping phase, the coordinator consolidates the workers’ results against the scratchpad described in 5.4.2. Preserve the exact entry points, important dependency edges, relevant decisions, and unresolved questions. Separate a confirmed relationship from a plausible but unverified explanation.
The summary is a designed handoff document, not a required Claude Code file format. You might store it as investigation/phase-1-summary.md. Keeping it on disk lets the coordinator reuse the same baseline across several next-phase assignments, while each assignment loads only the parts it needs.
A useful summary is organized around the next decision. If phase two asks whether a refund can be posted twice, the entry points and ledger call sites matter. An unrelated catalogue of logging helpers does not. If phase two asks about stock allocation tests, include the allocator and test locations rather than every refund detail.
Select a separate slice for each successor question. The duplicate-posting investigator needs ledger callers and unresolved job paths. The test investigator needs those entry points only to identify which behaviors the tests should cover. Give both the evidence baseline and shared constraints, but do not send every worker the complete map merely because it is already summarized. Keep deeper findings reachable through file pointers when a worker discovers it needs them.
Preserve the fields that prevent rediscovery
Use explicit categories so the receiving agent can distinguish what is known from what it must investigate. This example structure belongs to the application:
| Summary element | Example content | Effect on the next exploration |
|---|---|---|
| Goal and scope | Find duplicate ledger posting paths in refund handling | Keeps the worker focused on the successor question |
| Verified baseline | Ledger method, caller paths, and inspected revision | Supplies concrete evidence instead of generic architecture |
| Dependency map | Route-to-service edges and unresolved job callers | Gives the worker starting points and gaps |
| Prior decisions | Exclude generated files; do not modify source | Carries constraints that still apply |
| Open questions | Whether background jobs can reach the same posting method | Defines work still needed rather than a conclusion to assume |
| Evidence pointers | Scratchpad section and relevant source files | Enables targeted verification without the whole transcript |
Avoid a summary whose only content is “billing exploration complete.” It states progress but supplies no usable code facts. Conversely, a chronological list of every search is a transcript in another format. Keep the facts that change what the next worker should inspect.
Do not turn an unanswered question into a negative claim during condensation. If the first phase did not inspect scheduled jobs, the summary must say that their callers remain unverified. “No job callers exist” would convert missing coverage into fabricated certainty.
Inject the summary through the task prompt
Claude Code composes a task message when it invokes the Agent tool. Instruct the coordinator to include the relevant phase summary, the next question, and the required evidence-bearing output in that message. A summary file pointer is useful only if the worker is also told to read it and has the appropriate file access.
In the Agent SDK, supply run-specific findings through the Agent tool’s delegated task prompt; see 1.3.3 for the distinction from reusable AgentDefinition.prompt instructions.
Claude Code’s SubagentStart hook offers another loading mechanism. A hook can return hookSpecificOutput with hookEventName: "SubagentStart" and additionalContext to add context before the first prompt. Your script must select the correct summary for the task. The hook does not automatically choose or verify the application’s findings.
Use the hook for a concise shared baseline when many workers need the same context. Keep task-specific questions in the assignment so two agents receiving that baseline still know which part each one owns. Respect the documented 10,000-character cap on additionalContext instead of trying to inject a full transcript through a hook. SubagentStart also fires on resumption; Claude Code injects another copy only if the worker’s context no longer holds the earlier one, for example after auto-compaction.
Select fresh context or continuation
A fresh non-fork worker plus a phase summary fits a successor question that does not need the preceding discovery transcript. For a continuation that needs the same worker’s history, see 1.3.3: Explore and Plan are one-shot and return no agent ID, so they cannot be resumed; choose general-purpose or a custom subagent when later continuation is likely.
For a task that needs the parent’s conversation instead of selected findings, see 1.3.7 for the fork choice.
Regardless of context choice, verify that the baseline still matches the code. If a file changed after the mapping phase, ask the next worker to reopen the affected evidence instead of inheriting the original conclusion as unquestionable fact.
Key distinctions and trade-offs
Phase summary versus scratchpad: The scratchpad records durable discoveries. The phase summary selects the discoveries that guide the next investigation. They can share evidence without sharing their full size.
Fresh context versus empty knowledge: A non-fork worker lacks parent history, but its task prompt and configured instructions can provide a precise starting point. Fresh context does not require rediscovering everything.
Shared baseline versus task-specific slice: Common constraints and the evidence baseline can apply to every successor. Dependency details should follow each worker’s question, so a short shared summary does not become an irrelevant input for all workers.
Short summaries reduce repeated reading but can erase qualifications. Preserve evidence, coverage, and open questions even when that requires another paragraph. Brevity serves the decision only if the receiving agent can distinguish a verified edge from a gap.
Architecture / decision scenario
A developer productivity tool completes phase one of a legacy order-system exploration. It has verified the refund route, ledger posting method, and separate restocking job. It has not established whether scheduled jobs can invoke the ledger method twice.
For phase two, the coordinator creates a summary containing those paths, the verified edges, the uninspected job scope, and the read-only constraint. It launches a fresh non-fork subagent to trace duplicate posting paths and another to inspect relevant tests. Each receives the baseline plus a different question and return contract.
The duplicate-posting worker starts at the ledger caller map rather than repeating the repository survey. The test worker receives the known entry points and seeks their coverage. Neither receives the long directory listings and discarded leads from phase one.
If the first worker returns a contradiction, the coordinator checks the evidence and revises the shared summary before another phase starts. For a closely related follow-up, it resumes a general-purpose or custom worker if one was used; after Explore or Plan, it sends a fresh worker the verified findings and remaining question.
Common exam traps
- Sending the next worker only a question and expecting it to know prior findings.
- Copying the entire transcript to avoid writing an evidence summary.
- Injecting the complete phase summary into every worker when each needs a different slice.
- Condensing uninspected scope into a claim that no relevant code exists.
- Pointing at a summary file without requiring the worker to read it.
- Trying to resume a one-shot Explore or Plan worker instead of handing off its findings.
What to remember
Summarize the completed phase around the next decision, then pass each worker its relevant slice through the delegation prompt or an explicit loading hook. Retain paths, verified dependencies, constraints, and gaps. Use fresh workers after Explore or Plan; choose a resumable worker in advance when later continuation is likely.
Knowledge check
Phase-two subagents in a codebase exploration keep rediscovering classes that phase one already verified, and sometimes describe them differently. Each is a non-fork subagent launched with only its question. What should the coordinator change?
SubagentStart hook can also load selected context. The full transcript re-imports that noise into every worker, and a consistency instruction refers to findings the worker never saw.Phase two launches two fresh workers: one traces duplicate ledger postings, the other locates tests for the refund entry points. The coordinator holds a long phase-one summary covering many subsystems. What should each worker’s task prompt include?
Phase one verified the refund route and the ledger posting method but never inspected the scheduled jobs. How should the phase-two summary describe those jobs?
Phase one used the built-in Explore subagent to map the refund flow. The coordinator now has a closely related follow-up question for the same investigation. How should it continue?
general-purpose or a custom subagent in advance.References
- Anthropic, Create custom subagents
- Anthropic, Subagents in the SDK
- Anthropic, Hooks reference