Why AI Forgets in Long Chats: Context Rot Explained

Building O9X taught me: AI context rot isn't a bug, it's architecture. Real examples of dangerous forgetting + validation workflow I use to catch it

Why AI Forgets in Long Chats: Context Rot Explained
Context Rot in Long AI Chat Sessions

The build was twelve hours in. I had defined a constraint clearly at the start: a guard cannot work overtime more than four times in a rolling 30-day period. Not a calendar month. Rolling. I asked AI to explain how the constraint would be enforced. It said the count resets at the start of each calendar month.

AI did not misunderstand. It forgot.

This is not a bug — it is how these systems are built. As context grows, older instructions compete with newer ones for the model’s attention. The longer the session, the dimmer early constraints become.

I used to work in three-hour sessions. Context rot was a constant problem. Now I break work across shorter sessions — each with a focused scope. The migration rule is what I use when a session still goes long and contradictions appear.

The Decision Rule

A single contradiction in the first ten messages — restate the constraint and continue. AI missed it once. Restating puts it back in active context.

Repeated contradictions in a long session — stop. Migrate. Do not continue building on a compromised context.

The Migration Process

Ask AI to review the entire conversation and produce two things: a migration document covering everything the working document does not, and an updated export of the working file — schema, config, or code. Start a fresh chat. Load only the working file. Read the migration document. If AI missed anything, add it manually before continuing.

The working file for my O9X schema was roughly 15,000 tokens. One long session ballooned to over 100,000 tokens. Migration stripped it back to what mattered.

Known Loss

Some details do not survive migration. The migration document captures most of it. A manual review catches the rest. A clean 15,000-token context is more reliable than a 100,000-token context where AI has already started contradicting itself.

I caught the rolling constraint violation because I asked AI to explain its implementation back to me. I developed that habit after catching errors the hard way when I accepted a constraint AI confirmed verbally, only to see during coding that it had not been built that way. The question now goes in at the start of every session, not after the problem appears.

Trigger Condition: Repeated contradictions in a long session.

Mandated Action: Full migration — updated export, migration document, fresh chat, manual review.

Known Exception: Single early contradiction — restate and continue.