You've seen it. The first hour with an AI assistant is great. By message 200 it suggests a fix you already rejected, forgets the framework you're using, and confidently reintroduces a bug from an hour ago.
That's context rot, and it's not your imagination.
Every model has a limited context window. Long chats fill it with everything: dead ends, abandoned approaches, old versions of the same file. Even when it all technically fits, the model has to decide what matters, and old noise competes with the new signal.
Common symptoms:
When you notice the symptoms, stop. Ask the model:
Summarize this conversation in 5 lines: goal, constraints, decisions made, current state, next step.
Check the summary, fix anything wrong, then start a new chat and paste it as the first message. Add the current version of the file you're working on.
That's it. You keep everything that matters and drop the noise.
Coding agents that edit many files burn through context even faster. A clean handoff summary between big steps keeps them on track and makes their diffs easier to review.
Disclosure: I work on MadGPT. Its Coder model and VS Code agent are built for long, multi-file tasks, but the technique above works with any assistant. Drafted with AI assistance, edited by a human.