---
name: ai-context-window-management-discipline
description: "Context-window management discipline from the Dictionary of AI Coding. Use when structuring prompts or managing agent context."
---

# AI Context Window Management Discipline

- Prefer context curation over context expansion: quality comes from a high signal-to-noise context, not from stuffing more tokens in.
- Recognize attention degradation: as a session's context grows, output quality declines because signal-to-noise collapses - it is not the model getting worse.
- Treat the "dumb zone" as attention-budget exhaustion; when responses degrade late in a long session, compact or restart rather than pushing on.
- Because the model is stateless, never assume a future session remembers this one; persist decisions and state into files or summaries the next session will actually read.
- Perform explicit handoffs when clearing context: write an artifact or summary carrying goals, decisions, and open questions across the boundary.
- Diagnose failure modes by name before fixing them: distinguish hallucination, attention degradation, and missing context - each has a different remedy.
- Keep standing instructions (system-prompt-level rules) small and stable; put task-specific detail in the task context, not in permanent instructions.
