Back to library

Context Window Management

Context window management is one of the most overlooked PM skills for working with AI. Most degradation in output quality — the model "forgetting" earlier instructions, contradicting itself, losing nuance — traces back to context problems, not model capability. This skill diagnoses context issues and provides practical techniques to fix them.

---

Context

What a context window is (PM-level explanation):

Every AI model has a maximum amount of text it can hold in working memory at once — this is the context window. Everything you've said, everything it's responded with, and everything you've pasted in counts toward that limit. When the window fills up, older content gets dropped. The model doesn't tell you this — it just starts producing worse output.

Current context window sizes (as of 2025):
ModelContext windowPractical usable limit
GPT-4o128k tokens~80k tokens before quality drops
Claude 3.5 Sonnet200k tokens~150k tokens
Gemini 1.5 Pro1M tokens~600k tokens
Rule of thumb: 1,000 tokens ≈ 750 words. A full PRD is ~3–5k tokens.

---

Step 1 — Diagnose the context problem

Classify the issue: Context overflow, Input too large, Attention diffusion, Cross-session forgetting, or Irrelevant context pollution.

Step 2 — Apply the right technique

Technique 1 — Structured context front-loading (for attention diffusion)

Critical instructions at start and end. Explicit section markers.

Technique 2 — Chunking (for input too large)

Process at natural boundaries. Carry forward a running summary, not the full chunk.

Technique 3 — Context compression (for context overflow)

Summarise the session into a context brief and start fresh.

Technique 4 — Selective context inclusion (for irrelevant context pollution)

Fresh session with only the relevant context. Exclude earlier conversation turns.

Technique 5 — External memory (for cross-session forgetting)

Maintain a living document with standing context, current state, key decisions, and "do not revisit" list. Paste standing context at start of every session.

Step 3 — Output the context management plan

Include: diagnosed problem, recommended techniques, and rules going forward (session length limit, chunk size, external memory decision, fresh session trigger).

Quick reference — context window red flags

Red flagWhat's happeningFix
Model contradicts earlier instructionInstruction dropped from windowCompress + fresh session
Model answers different questionAttention diffusionRestructure prompt
Model stops following formatFormat instruction lostRestate format at end of every prompt
Model references wrong documentContext pollutionFresh session with selective context
Model becomes more generic over timeWindow filling with noiseCompress context; remove irrelevant turns

Quality check before delivering

Problem type is correctly diagnosed before recommending a technique
Template is customised to the user's specific task
Context window size for their model is stated
Fresh session trigger condition is specific
External memory template is included if cross-session work is needed
Suggested next step: If your project spans multiple sessions, set up the external memory document now — before you need it. The cost of rebuilding lost context is always higher than maintaining it from the start.