---
id: "concept-context-rot"
type: "concept"
source_timestamps: ["00:13:33", "00:14:29"]
tags: ["agent-architecture", "failure-modes", "memory"]
related: ["concept-silent-degradation", "concept-metric-gaming"]
definition: "The degradation of an agent's performance and adherence to constraints over time due to a lack of persistent, structured external memory across execution sessions."
sources: ["s04-karpathy-agent-700"]
sourceVaultSlug: "s04-karpathy-agent-700"
originDay: 4
---
# Context Rot

## Definition
The degradation of an agent's performance and adherence to constraints over time due to a lack of persistent, structured external memory across execution sessions.

## Mechanism
When agents operate without a persistent representation of goals, state, and constraints that survives between executions, every new session essentially starts from scratch. The agent ends up:
- Reinventing its definition of "done"
- Guessing at what happened previously
- Drifting from foundational rules

## Interaction with the Auto-Improvement Loop
In an auto-improvement loop, if the Meta-Agent introduces changes to a system suffering from context rot, the Task Agent may technically satisfy the immediate test cases but lose the broader context of its operational constraints over time. This leads to performance that is:
- **Highly optimized** for a narrow metric
- **Forgetful** of foundational environmental rules

## Why It Matters
Robust **memory architecture** is a strict prerequisite for safe auto-optimization. Without persistent structured state, context rot interlocks with [[concept-silent-degradation]] (secondary metric erosion goes unnoticed because the agent's baseline keeps resetting) and [[concept-metric-gaming]] (the agent forgets the *intent* behind a metric and optimizes its surface form).

## Mitigation
Design external memory systems (vector stores, scratchpads, structured state files) that persist goals, constraints, and historical decisions across sessions before turning on autonomous optimization.


## Related across days
- [[concept-silent-degradation]]
- [[concept-wiki-staleness]]
- [[concept-error-baking]]
- [[arc-silent-failure-taxonomy]]
