CCA-F start here · Trap gym · Large codebase exploration

Large codebase exploration

A long Claude Code session in a big codebase starts to blur what it found in the morning. The tempting answers keep everything in the session: read more files, remind Claude, get a bigger window, or restart and hope. The exam wants the findings to live somewhere the context can't blur: written down, with the noisy searching done elsewhere.

D5 Context Management & ReliabilityExam guide 5.4About 12 minutes

At a glance: in a long codebase exploration, save key findings to a scratchpad file, send verbose exploration to subagents, and use /compact when the context fills.

Start here: the detective's board

A detective works a long case with hundreds of files.

Trust memory. By the third day, “the suspect left at 9:40” has become “some time in the evening, as these things usually go”. Asked twice, the detective gives two different times.
Pin it to the board. Every confirmed fact goes on the board with where it came from. Juniors sift the boxes of paper and come back with one paragraph each. Every so often, the desk is cleared. Days later, the board still says exactly what was found.

Claude Code works the same way. Everything Claude reads sits in its context window, the working memory for one session. In a long session that memory gets crowded, and the exam guide names the signs of context degradation: inconsistent answers, and talk of “typical patterns” instead of the specific files found earlier. Four habits fix it:

Subagent reads hundreds of files in its own context search summary Main session context morning findings (blur first) long search output recent turns fills turn by turn Scratchpad file on disk, with file and line; survives /compact and crashes write read /compact condenses the history, frees room
The one question to ask: is the session starting to forget or blur what it found earlier, and where should those findings live instead?

Words in the question that tell you which side you're on

Scratchpad or manifest

  • “inconsistent answers”
  • “typical patterns” instead of the file it named
  • “forgot an earlier finding”
  • “session crashed”, “pick up tomorrow”

Subagents or /compact

  • “verbose output”, “thousands of lines”
  • “searching hundreds of files”
  • “context nearly full”
  • “long exploration”

Try it: a day in a big codebase

Pick the day, then a strategy. The meter fills turn by turn. At 95% Claude Code compacts on its own; with /compact you do it at 70%. Three times during the day the engineer asks the same question. At the end you see which findings are still exact, and where they live.

1. The day

2. Your strategy
Dashed lines: 70% (when you run /compact) and 95% (when auto-compact runs).

Token sizes and blur rates are illustrative, chosen to show the shape. They are not measurements. Each finding gets the same dice under every strategy, so the strategies differ only in how they work. The exam guide's point is that a long exploration degrades into inconsistent answers and “typical patterns”, and that findings kept on disk survive context limits and crashes.

Things to try: long day + just keep going, and read the three answers. Then + subagents: the meter stays lower, but the morning still blurs. Then + scratchpad + subagents + /compact. Last, the crash with /compact, with the scratchpad, and with the manifest.

The four traps

TrapWhat the wrong option looks likeWhy it loses
Fills context“Read every file in the module up front so nothing is missed”Fine on a small module. On a large codebase it floods the context, and the earlier findings degrade.
Loses findings“Restart the session whenever answers get inconsistent”It clears the clutter, but without a saved record the new session starts from nothing.
Delays the problem“Switch to a model with a bigger context window”It works for a while, then the same degradation returns later in the run.
Only usually works“Ask Claude to keep earlier findings in mind”An instruction isn't storage. The findings still live only in the context, and still fade as it grows.

Practice: three exam-style questions

Answer first, then open “Think it through”.

Rule to remember

Write findings down, delegate the noisy searching, and compact the rest.

Exam guide 5.4: “Context degradation: inconsistent answers, referencing "typical patterns" vs specific earlier findings.” “Scratchpad files persist key findings across boundaries; subagent delegation isolates verbose output.” “Structured state persistence (manifests) for crash recovery; /compact to reduce context usage.”

← All traps