Context is a budget, not a warehouse
Why a long AI session gets vague, and the small cleaning habits that keep it sharp.
An AI assistant works inside a context window. That is everything it is holding in view during one session: your messages, the files it has read, the output of everything it tried.
That window is a budget, not a warehouse. Every piece of irrelevant material thins out the attention left for what matters. I have watched sessions with Claude go from sharp and focused to vague and confused. Claude had not become less able. The context had filled up with noise.
What piles up
As you work, the session collects things:
- Files it has read
- Approaches that failed and were dropped
- Error output from problems already solved
- Searches that led nowhere
- Background from an earlier task that no longer matters
All of it stays, and all of it competes with what you are doing right now.
Claude doesn't forget. It just gets distracted.
The signs are easy to spot once you know them. Answers become less focused. It brings up outdated details from earlier in the session. You have to repeat instructions. The quality of its thinking drops.
Two ways to clean up
Claude Code, the tool I use, has two commands for this.
Compact squeezes the conversation history down while keeping the key points. Think of cleaning your desk without throwing away the important papers. It is not perfect. Important details can be lost, and exact things like error messages are often the first to go. So before I compact, I make sure the current state of the task is written somewhere that lasts.
Clear wipes the conversation completely. Only the standing instructions for the project survive. I use it when I switch to a completely different task, or when a session is too cluttered for compacting to help.
Clearing is not a failure. It is a tool. Starting fresh is often faster than trying to steer a muddled session back on course.
When I reset
- A change of topic. Background from the last task is pure noise for the next one.
- After a long hunt for a bug. The wrong guesses and error output are useless once it is fixed.
- After finishing a piece of work, before starting the next.
- When quality drops. Answers wander, repeat themselves or mix up details. I compact straight away.
Clean early, not late
By default, the tool tidies up on its own only when the window is nearly full. By then there is a lot of noise, the squeeze has to be hard, and more gets lost.
I set mine to tidy up at 60 percent. It happens more often, but each time is gentler.
It is like cleaning your desk every evening instead of once a month. The daily clean takes two minutes and you never lose anything important. The monthly clean takes an hour, and you might throw away the note you needed.
Habits that keep it clean
Ask for the answer, not the whole file. “Read this and tell me which parts handle sign-in” leaves a short answer behind, not the whole file.
Work in phases. Research, then plan, then build, then review, with a clean-up between each. The noise from research does not leak into the building.
Write the plan to a file. A plan that lives only in the conversation gets squeezed or lost. A plan in a file can be read again after a clean-up. The file survives. The conversation does not.
Keep standing rules in one place. Anything I find myself repeating goes into the project’s instructions file, which is loaded fresh every time.
The whiteboard
I think of the context window as a whiteboard in a meeting room. A fresh session is a clean board. Mid-session it holds useful notes. A cluttered session is covered edge to edge, and you cannot find what matters.
Compacting is taking a photo of the board, wiping it, and pinning the photo to the wall. Clearing wipes everything except the room’s permanent signs.
The goal is not to stop using the whiteboard. It is to wipe it before it becomes useless.
