Context Windows: Giving Claude the Right Amount of Information
Intermediate: Context Windows: Giving Claude the Right Amount of Information
Context Windows: Giving Claude the Right Amount of Information
Series: Claude Learning Journey · Intermediate Usage
A context window is memory. Claude can hold a certain amount of your conversation and your files at once, and what you put in that window determines what it can actually work with. Put in too much and you waste tokens and dilute the signal. Put in too little and Claude works blind.
Most people get this wrong in one of two ways: either they dump everything into every prompt and wonder why costs spiral, or they give nothing and wonder why the output is generic. The skill is knowing what to include and when.
What the Context Window Actually Holds
The context window is not just the conversation history. It is everything you give Claude in a session: your messages, the files you share, the system prompt, and the conversation so far. Every token counts.
What this means practically: if you paste in a 5,000-line file to make a small change, you are paying for 5,000 tokens of context on every single subsequent message. That adds up fast.
The Art of Selective Inclusion
The right amount of context is enough for Claude to understand the specific task at hand, without overwhelming it with tangentially related material.
For a targeted bug fix: the relevant function, the test that fails, the error message. Not the entire codebase.
For an architectural discussion: the key components, how they interact, the constraint you are working under. Not every implementation detail.
For a refactor: the file or module being refactored, the surrounding patterns, what “good” looks like for this codebase. Not three years of commit history.
Reading Only What You Need
Claude can read files. You do not need to paste everything in. Use file reads for large files, paste only the relevant sections for smaller ones.
The pattern: ask Claude to read a specific file or function first, then ask it to make changes based on what it found. This keeps context clean and lets you verify Claude understood correctly before giving the next instruction.
You: "Read the auth middleware at src/middleware/auth.py and tell me what it does."
Claude: [reads and summarises]
You: "Good. Now add a rate limit check before the token validation."This is better than pasting the file in upfront because sometimes Claude will fix something you did not ask about, or make assumptions based on context you did not intend to give it.
Managing Long Conversations
Long sessions accumulate context. The further you go, the more Claude has to hold, and the slower and more expensive each subsequent message becomes.
Practical strategies:
- Summarise and restart: ask Claude to summarise the session, then start fresh with that summary as the new context
- Archive completed work: if you finished a feature, move on rather than continuing to work in the same session
- Use thread markers: if a session covers multiple distinct tasks, explicitly mark transitions
What You’ll Learn
- Why selective context beats comprehensive context
- How to use file reads to manage context efficiently
- When to start a new session versus continuing an existing one
- How to handle multi-topic conversations without confusion
Try It Yourself
Take a task you would normally dump into Claude all at once. Instead: start with a focused opening prompt, let Claude respond, then share only the specific context needed for the next step. Notice how the quality of responses changes when Claude is working with tight, relevant context rather than a flood of everything.
What’s Next
Once you can manage context effectively, the next skill is keeping your project documentation in sync with what Claude knows. We will look at documentation practices that work with Claude, not against it.
Part of the Claude Learning Journey series · Next: Working with Documentation