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.

What's going on

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:

  • it repeats suggestions you already turned down;
  • it mixes up two versions of the same function;
  • it drifts away from the original goal;
  • answers get longer and vaguer.

The fix: a 5-line handoff

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.

Habits that prevent it

  • One chat per task. Don't debug auth and design a landing page in the same thread.
  • Paste current code, not history. "Here's the file as it is now" beats "remember the version from earlier".
  • Write decisions down. When you settle something ("we're using Postgres, not Mongo"), say it explicitly so it ends up in the summary.

Why this matters more with agents

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.