K3.4.3 Task 3.4

120 Files Explored, 12% Context Used

Reading files in the main session accumulates context. Reading 45 files consumes 75% of the context window. Reading 30+ log files causes analysis to degrade — earlier findings get compressed or lost, the agent repeats shallow conclusions, and connections between entries are missed.

The Explore subagent runs in an isolated context. It reads as many files as needed for discovery, then returns only a structured summary to the main session. The main session’s context stays clean for implementation.

The Numbers

ApproachFiles exploredContext consumedDependencies foundContext left for implementation
Main session4575%8 of 1125%
Explore subagent12012% (summary)11 of 1188%

The subagent explored 2.7x more files, found 37% more dependencies, and left 3.5x more context for the implementation phase. It is strictly better for large-scale exploration.

How Context Exhaustion Manifests

When a CI agent reads 30+ log files directly in the main session, quality degrades midway through the investigation:

  • Analysis becomes shallow and repetitive
  • Earlier findings are ignored or contradicted
  • Connections between entries are missed
  • The agent repeats conclusions instead of building on prior analysis

This is not a capability limitation. It is context window exhaustion. As files accumulate, earlier conversation content — including critical analysis — gets compressed or truncated. The agent literally loses access to its own prior work.

The fix is not shorter Read ranges (still accumulates), not /clear (destroys work already done), and not Plan mode (does not compress context). The fix is an Explore subagent that keeps the verbose reading in isolated context.

The Hybrid Strategy

For a 2,000-file codebase requiring both architectural understanding and specific implementation details:

  1. Explore subagent — Broad architectural discovery. Traverses the codebase, maps module boundaries, identifies key dependencies. Returns a structured summary.
  2. Read specific key files — In the main session, read only the files the subagent identified as critical for the implementation. Targeted reads, not bulk exploration.

The subagent handles breadth (architecture across 2,000 files). The main session handles depth (detailed implementation patterns in key files). Context budget supports both.

Mid-Session Rescue

If exploration has already consumed 40% of the main context with 8 more services to trace:

  • Do not continue reading in the main session — the remaining exploration would push context past 80%.
  • Do not /clear — this destroys the 40% of findings already gathered.
  • Do delegate remaining exploration to an Explore subagent. The subagent traces the remaining 8 services in isolation and returns a summary. The main session retains its earlier findings alongside the new summary.

Things That Do Not Exist

  • Plan mode auto-compression — Plan mode is a read-only exploration mode. It does not compress file contents, free context space, or manage capacity. All content read during Plan mode still consumes the context window.
  • Batch-and-discard for Read — Claude does not automatically discard file contents after processing. Every file read accumulates in context.
  • On-demand context compression — Claude cannot compress its own context through user-directed summarization commands. Context compression happens automatically at the system level when limits are approached.
  • Unlimited fork context — Skills with context: fork have the same context window constraints as the main session. Fork provides isolation, not expanded capacity.
  • Temperature drift — Temperature does not change during a session. It remains constant.

When Not to Use the Explore Subagent

For small-scale exploration (a few files, known locations), the Explore subagent adds unnecessary indirection. If you know which 3 files to read, reading them directly in the main session is faster and provides full detail for implementation.

The subagent is for exploration that would consume significant context — typically 30+ files across multiple modules. For targeted reads of known files, direct Read is more efficient.


One-liner: The Explore subagent reads hundreds of files in isolated context and returns only a summary — preserving 88% of the main session for the work that actually needs it.