Manage context effectively in large codebase exploration
What you should be able to do
- Recognise context degradation — inconsistent answers, appeals to typical patterns rather than what was found.
- Persist key findings in scratchpad files that survive a context boundary.
- Delegate verbose exploration to subagents while the main agent holds the high-level picture.
- Design crash recovery around structured state exports the coordinator reloads on resume.
Exam traps (5)
Keep exploring in one long session so nothing has to be re-established.
Late in a long session answers drift toward generic patterns and away from the specific classes found earlier — and it still sounds authoritative.
Write findings to a scratchpad and refer back to it, so knowledge outlives the window.
Have the main agent read the files itself to keep everything in one place.
Verbose discovery fills the context that coordination needs, so the agent loses the overview it was there to hold.
Delegate specific investigations to subagents; the main agent keeps the map, not the terrain.
Carry the raw exploration output into the next phase so nothing is lost.
The next phase begins with its budget already spent on the previous phase's transcript.
Summarise the phase, then inject the summary as the next phase's starting context.
Handle a crash by starting the exploration again.
Every agent's work is lost, and on a large codebase the re-run is the expensive part.
Have each agent export state to a known location and reload the manifest on resume.
Compact aggressively as soon as the context fills.
Compaction is lossy, so specifics established early are the first to go — and they are usually the reason the session was still running.
Persist what must survive first, then compact. Compaction is not a substitute for writing things down.
Primary sources
- Context windowschecked 2026-08-15
- Claude Code — common workflowschecked 2026-08-15
Know cold
- Scratchpad
- /compact command
- Explore subagent
- Resumability
- Run / session state
6 practice questions in the bank are tagged to this task statement.
Practise this task in context: open it inside the interactive study guide, which carries the concept cards, the mock quiz and the practice simulation.