The context window
Full Lesson Reference
The context window is Claude's working memory for the current session. Everything you've typed, every response, every file read - all accumulates in it. It has a limit. When it fills, Claude gets worse.
Understanding this is the single most important mechanic in Claude Code.
What accumulates in the context window
- CLAUDE.md files (always loaded)
- Memory loaded at /startup
- Skill descriptions + bodies of invoked skills
- MCP tool schemas when you invoke tools
- Every prompt you've typed
- Every response Claude has given
- Every file Claude has read
- Every command output
- Every data pull from MCPs or databases
Long session = large context. It's cumulative - nothing leaves once it's in.
Why it matters
Every message you send to Claude resends the ENTIRE conversation history so far. Your 15th message carries 14 previous exchanges, every file Claude read, every output. The token bill compounds.
More importantly: as context fills, quality drops. Claude starts to:
- Forget instructions from earlier in the session
- Repeat itself or output you already approved
- Hallucinate details that were never said
- Make avoidable mistakes on stuff it handled correctly at the start
Not a hard break - a gradual degradation.
The 50% rule
If you've installed ccstatusline (covered in Module 13 Lesson 3), you'll see a live context percentage at the bottom of your terminal. If not, just ask Claude periodically how full the context window is.
- 0-30% - fresh session. Claude is sharp. Do your best work here.
- 30-50% - getting full. Still functional. Start thinking about wrapping up soon.
- 50%+ - quality degrading. Run /wrapup and start fresh.
Yes, there's a ramp-up cost when you restart. Yes, it feels annoying to stop mid-flow . But a degraded session where Claude is forgetting instructions costs you more than the ramp-up does.
Signs you're over 50%
Without the status line, watch for
- Claude re-creating a file you already made
- Claude forgetting a preference you told it earlier in the session
- Responses getting noticeably slower
- Claude asking you to clarify something you already clarified
- Claude generating output that's clearly from earlier context (wrong client, wrong project)
All of these mean: /wrapup now. Start fresh.
Don't use /compact
Claude Code has a built-in "compact" feature that compresses your context mid-session. Don't use it. It gives you the worst of both worlds - you lose the useful details but keep fragments that confuse Claude.
Start fresh instead. A new session with saved memory always beats a compacted one.
Mental model: sessions are cheap, context is precious
Opening a new session takes 30 seconds. Running /wrapup takes 30 seconds. That's 1 minute to reset your context to clean. Pushing through a degraded session for 30 minutes costs you way more.
When in doubt, wrap up. Start again. Your memory layer carries the context forward.
Action items
☐ Understand: context window is Claude's working memory for THIS session only
☐ Memorise the 50% rule - wrap up and restart before you hit it
☐ Learn the signs of degradation (repeat output, forgotten instructions)
☐ Never use /compact
☐ Remember: new session = 1 minute cost. Degraded session = 30 minute cost.
Next lesson: Within-session vs between-session memory.
Exercises
- Review the concepts covered in this lesson: The context window.
- Write down your key takeaway from this lesson.
- Practice running any commands or prompts mentioned above inside your terminal.