Lesson 5.4Lesson 28 of 30
Context in large codebase exploration
Manage context effectively in large codebase exploration
Key points
- 1Long exploration sessions degrade: answers start contradicting earlier ones and cite "typical patterns" instead of the specific classes found earlier. The cure is managing context, not a bigger window.
- 2Spawn subagents for specific questions ("find all test files", "trace refund flow dependencies"). Their verbose output stays in their context; the main agent keeps the high-level map and gets back concise findings.
- 3Keep a scratchpad file of key findings (class names, file paths, what was ruled out) and consult it before answering later questions. It survives /compact and context boundaries.
- 4Between phases, summarise what the phase established and inject that summary into the next-phase subagents' prompts. Use /compact when verbose discovery output fills the context.
- 5For crash recovery, each agent exports its state to a known location; on resume the coordinator loads a manifest and injects it into agent prompts, so only unfinished work is redone.
What the exam guide checks here
Objective wording from the exam guide (English).
- 5.4.K1Context degradation: inconsistent answers, "typical patterns" instead of specific classes
- 5.4.K2Scratchpad files persist key findings across context boundaries
- 5.4.K3Subagents isolate verbose exploration while the main agent coordinates
- 5.4.K4Crash recovery: agents export state, coordinator loads a manifest on resume
- 5.4.S1Spawn subagents for specific questions (find all test files, trace refund flow)
- 5.4.S2Maintain scratchpad files and consult them later
- 5.4.S3Summarise a phase before spawning next-phase subagents, inject the summary
- 5.4.S4Design manifest-based crash recovery injected into agent prompts
- 5.4.S5Use /compact when exploration output fills context
Lock it in
Answer scenario questions on this topic. Every option comes with an explanation.
Practise 5.4 · 23 questions