Act 07 · The agent turn 2:30 Injection, danger, and context rot

Context rot: why long agent runs decay.

Over a long run, an agent's context fills with accumulated history — old steps, tool dumps, dead ends — burying the goal and drowning the signal, so performance quietly decays; the fix is active context management.

Video rendering soonThe cinematic render for this episode is being generated. The article, transcript and key ideas are all here now.

Key ideas

  • The one idea — Over a long run, an agent's context fills with accumulated history — old steps, tool dumps, dead ends — burying the goal and drowning the signal, so performance quietly decays; the fix is active context management.
  • How it is shown — A short run (clean context, sharp) versus a long run (context clogged with stale attempts and tool output) where the agent forgets the goal and repeats itself.
  • The trap to avoid — Assuming more context is always better and letting history pile up — beyond a point, accumulated context actively hurts.
  • What it sets up — If context is finite and precious, how do you give a model the RIGHT knowledge exactly when needed?

Your AI agent gets quietly worse the longer it works. Same model, same task — but the window slowly fills with old steps and dead ends until the goal drowns.

The one idea

Over a long run, an agent's context fills with accumulated history — old steps, tool dumps, dead ends — burying the goal and drowning the signal, so performance quietly decays; the fix is active context management.

Here's a strange fact: the longer an agent runs, the worse it can get. Not because the model changes, but because its context fills up. Every step piles more history into the window, until the signal drowns in noise. This slow decay is called context rot. Every loop step appends to the context: your goal, each action, every tool result, every dead end. Over a few steps, fine. Over dozens, it becomes a huge, cluttered transcript — stale attempts, irrelevant dumps, contradictions — all still there, competing for the model's attention. Three problems follow. The original goal gets buried far back, losing its pull. The finite window fills, as history and tool output eat the space. And outdated or contradictory information muddies the next choice.

How it works — the demo

A short run (clean context, sharp) versus a long run (context clogged with stale attempts and tool output) where the agent forgets the goal and repeats itself.

Piece by piece, the agent loses track of what it's doing. The symptoms are familiar: it repeats itself, loses the thread, forgets a constraint from the start, contradicts an earlier step. It isn't getting dumber — it's getting buried. The useful signal is still in there, just drowned under piles of accumulated context. The fix is context management, a core agent skill. Summarize and compress the history. Prune irrelevant tool outputs. Keep the goal fresh by re-stating it. Hold notes in external memory, not the window. Spin off fresh sub-agents for sub-tasks. Curate what's in the context.

The trap to avoid

Assuming more context is always better and letting history pile up — beyond a point, accumulated context actively hurts.

Why it matters — and what’s next

If context is finite and precious, how do you give a model the RIGHT knowledge exactly when needed?

The trap: assuming more context is always better, and letting history pile up. Beyond a point, accumulated context hurts — burying the goal, filling the window, adding noise. Managing what's in the window matters as much as what the model knows. That's context engineering. So context rot is the quiet decay of a long run as the window clogs, and the fix is to manage it. That closes Act seven, the agent turn. And it points ahead: if context is finite, how do you give a model the right knowledge, only when it needs it? That's retrieval. Next act: the plumbing, starting with RAG.

This is one short episode in AI: Zero → Frontier, a step-by-step climb through how AI actually works. Each episode builds only on the ones before it.

Full transcript 2:30 of narration

Here's a strange fact: the longer an agent runs, the worse it can get. Not because the model changes, but because its context fills up. Every step piles more history into the window, until the signal drowns in noise. This slow decay is called context rot.

Every loop step appends to the context: your goal, each action, every tool result, every dead end. Over a few steps, fine. Over dozens, it becomes a huge, cluttered transcript — stale attempts, irrelevant dumps, contradictions — all still there, competing for the model's attention.

Three problems follow. The original goal gets buried far back, losing its pull. The finite window fills, as history and tool output eat the space. And outdated or contradictory information muddies the next choice. Piece by piece, the agent loses track of what it's doing.

The symptoms are familiar: it repeats itself, loses the thread, forgets a constraint from the start, contradicts an earlier step. It isn't getting dumber — it's getting buried. The useful signal is still in there, just drowned under piles of accumulated context.

The fix is context management, a core agent skill. Summarize and compress the history. Prune irrelevant tool outputs. Keep the goal fresh by re-stating it. Hold notes in external memory, not the window. Spin off fresh sub-agents for sub-tasks. Curate what's in the context.

The trap: assuming more context is always better, and letting history pile up. Beyond a point, accumulated context hurts — burying the goal, filling the window, adding noise. Managing what's in the window matters as much as what the model knows. That's context engineering.

So context rot is the quiet decay of a long run as the window clogs, and the fix is to manage it. That closes Act seven, the agent turn. And it points ahead: if context is finite, how do you give a model the right knowledge, only when it needs it? That's retrieval. Next act: the plumbing, starting with RAG.

AgentsContext RotContext Engineering