weston.pub

October 20, 2026

Context Contamination

"Availability is influence."

Today's harnesses and standard practices are very good at the additive side of context engineering: retrieving context relevant to the task at hand. But they are very bad at removing bloat and contamination. Contamination in particular seems to be the most prominent source of agent failure today. The fact that contamination is largely hidden from human practitioners and compounds over time makes the problem particularly insidious.

The best models today are even more capable than most people think when handed a promperly currated context.


Types

Contents within context that hurt performance because they are irrelevant, contradictory, confusing, etc.

"Change of Plans"

Residue from plan reversals, abandoned approaches, interrupts, repeated corrections, renegotiated requirements, unexpected roadblocks, etc.

Even if the model has decided a new course of action, all of the tokens pointing to the discarded approach are still influencing output.

"Existential Crisis"

aka "Meta Analysis"

This usually occurs when you have a session evaluate itself, you criticize the model or its work, or tell it what not to do instead of what to do.

The model spends a bunch of tokens deliberating why it should do something vs it shouldn't. The extra thinking creates bloat and derails the model but also no matter what it chooses for each decision it will have tokens in its context with reasoning against that decision since it had to weigh the pros and cons.

Context Poisoning

malicious insertion into context designed to align the agent to alternative goals


Contamination Transfer

aka Cross Contamination

Memories

An "aligned" memory today may be a "misaligned" memory tomorrow. We humans change our minds about things and overestimate the universality of our own rules.

Briefs

Brief contamination: failure to exclude everything but the problem statement to a subagent, in a case where the purpose of delegating the task is to optimize the context for that task. Instead of simply presenting the problem and allowing the agent to take an unbiased approach, claude poisons the subagent context with its own opinion and directives about what should be done.

FileSystem

files on the filesystem which contain contaminated context.

FileSystem Contamination is essentially equivalent to codebase entropy, aka slop accumulation. Progress will grind to a halt on a codebase where vibe-coding is used too liberally. Entropy accumulates and compounds to the point where every bug fixed merged produces two more.


How it Relates to Subagents

There usually 3 reasons for a coordinator to create a subagent:

reason 1: currate the subagent's context for a given task

reason 2: prevent context contamination and bloat in the coordinator's context

reason 3: cost-performance tradeoff optimization


Using this Information

Avoiding Brief Contamination

An external-evaluation approach is necessary. possible options:

Also use external evaluation to determine contamination levels, so that you can make a more informed decisions about when to discard a session and resume with fresh context.

Avoiding Filesystem Contamination