A 1-million token context window sounds like a dream for coding. That's roughly 2,500 pages of text - enough to fit an entire codebase in a single conversation. So why would you not use all of it?
Because more context doesn't mean better results. In practice, stuffing long coding sessions into Claude Code's full context window leads to degraded output quality, and understanding why requires looking at how large language models actually process information.
The "Lost in the Middle" Problem
LLMs don't treat all parts of their context equally. Research has consistently shown that models pay the most attention to information at the beginning and end of their context, while details buried in the middle get less weight. This is sometimes called the "lost in the middle" effect. In a short conversation, it barely matters. In a session that's grown to hundreds of thousands of tokens - filled with earlier code attempts, abandoned approaches, old error messages, and superseded instructions - the model is wading through noise to find what's actually relevant.
The result: Claude starts repeating earlier mistakes, forgets corrections you made 30 minutes ago, or generates code that conflicts with decisions from earlier in the session. The context window can hold the information, but the model's ability to usefully reason over all of it degrades as the session grows.
Shorter Sessions, Better Code
The practical fix is counterintuitive: start fresh more often. Rather than running one marathon session, break your work into focused conversations. Each new session gets a clean context where every token is relevant to the current task.
A few tactics that help:
- Use CLAUDE.md files to persist important context between sessions. Project conventions, architectural decisions, and key file paths go here so you don't need to re-explain them.
- Scope each session to one task. "Fix the authentication bug" is a better session than "work on the app for two hours."
- Watch for quality drops. If Claude starts generating code that ignores recent corrections or re-introduces bugs you already fixed, that's your signal to start a new conversation.
- Summarize before switching. At the end of a productive session, ask Claude to summarize the current state and decisions made. Paste that summary into your next session as a starting point.
The 1M context window is useful for one-shot tasks where you need to analyze a large codebase or review many files at once. It's less useful as a dumping ground for an entire afternoon of iterative coding. Treating context as a precious resource - keeping it focused and current - consistently produces better results than treating it as infinite storage.