CC-301i · Module 1
Context Window Management
4 min read
The context window is a fixed budget. Every file Claude reads, every conversation turn, every tool output — all of it consumes tokens from that budget. When the budget is full, Claude starts compacting earlier context, which means your carefully built-up project understanding begins to degrade. The art of performance optimization with Claude Code is maximizing useful work per token spent.
The first principle is selective reading. "Read the entire src/ directory" is almost never the right approach. "Read the three files relevant to this task" uses 90% fewer tokens and produces better output because Claude focuses on exactly the context it needs. The effective workflow: describe the task, let Claude determine which files it needs, and approve or refine its file selection. Do not pre-load context speculatively — load it on demand.
Do This
- Let Claude read files on demand as it needs them
- Use CLAUDE.md to point Claude at key files rather than loading them all
- Start new sessions for independent tasks — fresh context for fresh work
- Use /clear between unrelated tasks to reclaim context budget
Avoid This
- Pre-load every file in the project "just in case Claude needs it"
- Run a single session for an entire day — context degrades over hours
- Copy-paste entire files into the chat instead of letting Claude read them
- Ignore context compaction warnings — they mean Claude is losing earlier context