Home / CCA-F / Context Management / The Context Window — Detail & Examples
DWG 5.1 — DETAIL & EXAMPLES

The Context Window — Detail & Examples

Part of Context Management · overview: domain-5.html
In this page

Why scattered context degrades performance even within window limits, a worked headroom scenario, and exactly what /compact keeps versus loses.

5.1aScattered vs. compact context

Same information, different retrieval quality
  • A fact stated once, clearly, near where it's used is easy for the model to apply correctly.
  • The same fact, buried in message 4 of a 60-message transcript with a dozen other topics between it and where it's needed, is technically "in the window" but far more likely to be missed or misapplied.
  • This is why long-running agent sessions benefit from periodically re-stating or re-surfacing key facts, not just trusting they're still "in there somewhere."

5.1bHeadroom, before and after

WORKED EXAMPLE · A CONTEXT WINDOW WITH NO ROOM LEFT
SCENARIOAn agent has been running a long research task and its context is nearly full when a large tool result comes back.
  1. The new tool result (a long document) needs to be incorporated into context to be useful.
  2. With no headroom, something has to give — older context gets truncated or dropped, possibly including instructions or facts still needed later.
  3. The agent may now be reasoning with an incomplete picture without any explicit signal that something was lost.
Better design:Proactively compact or summarize older, no-longer-needed context before it becomes necessary, rather than letting the window fill until something is forced out.

5.1cWhat compaction keeps vs. loses

BEFORE /compactCLAUDE.md loaded (persisted) + 80 messages of conversation (not persisted) + a mid-conversation instruction "always use tabs, not spaces" (never written to a file).
AFTER /compactCLAUDE.md still loaded in full. The 80 messages are summarized down. The tabs-not-spaces instruction, having only ever existed as a chat message, may not survive the summary.

The fix is structural, not behavioral: any rule meant to persist for the life of the project belongs in CLAUDE.md (Domain 3.2), not in a conversation turn that compaction is free to compress away.


Claude Certified Architect — Study NotesDWG 5.1