Stop running one giant chat: manage context in Claude Code
The habit that quietly hurt my Claude Code sessions the most was never resetting. I would start a chat in the morning, work through three unrelated tasks, and by afternoon the same session was carrying tens of thousands of tokens of history that had nothing to do with what I was asking now. It got slower, it got more expensive, and it got worse at the actual work. Here is how I stopped doing that, and the mental model that finally made the cost side click.
The myth I had to unlearn
I used to think a long conversation was fine because "you only pay for what you send." Then I flipped and assumed the opposite: that every turn re-bills the entire history at full price, so a huge chat must be burning money on every keystroke. Both are wrong.
The truth is in between. The underlying API is stateless, so the whole conversation is sent up on every turn. But the stable early part of a chat can be served from a prompt cache at a fraction of the normal input price, so one more turn mostly costs the new tokens, not the entire backlog re-billed at full rate.
So a long session is not linearly more expensive per turn the way I feared. What it actually costs you is three other things.
What a bloated session really costs
- Cache-miss spikes. Caching only helps while the early part of the conversation stays byte-for-byte identical. The moment something near the front changes, everything after it has to be reprocessed at full price on the next turn. Long sessions hit these spikes more often, and they are the real money leak.
- Latency. More tokens in context means more for the model to read before it can answer. A fresh chat feels snappy; a 200k-token one feels like wading through mud. If you have wondered why Claude Code feels slow, this is usually why.
- Worse answers. As the window fills, recall and accuracy drop. That is not a vibe, it is a documented effect called context rot. The single most useful thing you can do for answer quality is not paste more, it is carry less.
The habits that keep context lean
Start a fresh session per task, not per day. When you finish one thing and move to an unrelated one, reset instead of piling on. The new task does not benefit from the old task's history; it only pays for it. See when to /clear, /compact, or start over for the exact command.
Compact before the window gets huge, not after. If a single task is genuinely long, /compact replaces the raw back-and-forth with a structured summary so you keep the thread without hauling every tool output along. Claude Code will also compact automatically as the window fills, but doing it deliberately at a natural break point gives you a cleaner summary.
Do not paste what the agent can read. Dropping an entire file into the chat pins it in context forever. Letting the agent open the file itself means it can move on and let that content age out. Point it at paths, not walls of text.
Put durable facts in CLAUDE.md, not in every prompt. Anything you find yourself re-explaining ("the build command is X", "we use Preact not React") belongs in a project CLAUDE.md. It loads once, cheaply, instead of being retyped into a dozen sessions.
Delegate verbose exploration to sub-agents. A sub-agent reads the big files and searches the codebase in its own separate context, then hands back only a short summary. The heavy reading never lands in your main window at all.
When a huge context window is the right call
Sometimes you genuinely want everything in view at once, a whole codebase or a long document, and the opus[1m] or sonnet[1m] one-million-token window is there for exactly that. On the current models it does not even carry a premium per-token rate. But treat it as a deliberate choice for a task that needs it, not a reason to stop resetting. A bigger window makes room for more; it does not make more free of latency or rot.
The short version
Match the session to the task. Reset when you switch jobs, compact when one job runs long, keep durable facts in CLAUDE.md, and let sub-agents absorb the bulky reading. You will get faster responses, fewer cache-miss spikes, and noticeably better answers. For the rest of the money-and-speed leaks, see the full rundown of pricey Claude Code habits.
More in How-to