Long agent sessions can become contradictory and incoherent as useful context is crowded out by intermediate steps and earlier errors. This accumulation creates context rot: unlike humans, an AI agent does not consolidate key information unless that memory is deliberately built. section 3.5.2
Context anchoring preserves focus by maintaining an explicit plan or to-do list throughout the task. The plan acts as external memory and repeatedly brings high-level objectives into the freshest part of the prompt without replaying the entire interaction history. section 3.5.2
A practical anchor should:
- Track task status as work progresses, checking off completed items and updating or reprioritizing remaining work. section 3.5.2
- Recite the current plan at regular intervals so objectives remain visible after tools, intermediate steps, and errors accumulate. section 3.5.2
- Keep the anchor focused on execution objectives rather than treating it as a compiler, linter, or code executor. section 3.5.2
- Avoid naïvely replaying the complete conversation, which bloats the context window and accelerates context loss. section 3.5.2
Execution-plan anchor
Claude Code uses a to-do tool that continuously maintains an execution plan. Each task has a status, and the plan is updated and surfaced again as work advances, giving the agent a structured view of progress. section 3.5.2
Figure 3.9 Execution plan of Claude Code.

Inspect the execution-plan figure to see how task status turns a high-level objective into a persistent context anchor. section 3.5.2
