# Context rot in AI agents: How to recognize and fix it

DevFeed: [Context rot in AI agents: How to recognize and fix it](<https://devfeed.tech/articles/context-rot-in-ai-agents-how-to-recognize-and-fix-it-119840.md>)

Original publisher: [Read original article](<https://www.thoughtworks.com/insights/blog/generative-ai/what-is-context-rot>)

Author: Piyush Sonawane

Published: 2026-11-05T00:00:00Z

Content type: article

Language: en

Sources: [Thoughtworks Insights](<https://devfeed.tech/sources/thoughtworks-insights.md>)

Topics: [AI Context Management](<https://devfeed.tech/topics/ai-context-management.md>), [Agent Harness](<https://devfeed.tech/topics/agent-harness.md>), [AI Models](<https://devfeed.tech/topics/ai-models.md>), [context](<https://devfeed.tech/topics/context.md>), [agentic-coding](<https://devfeed.tech/topics/agentic-coding.md>), [AI-assisted coding](<https://devfeed.tech/topics/ai-assisted-coding.md>), [Retrieval Augmented Generation (RAG)](<https://devfeed.tech/topics/retrieval-augmented-generation-rag.md>)

Tags: [agent-harness](<https://devfeed.tech/tags/agent-harness.md>), [agents](<https://devfeed.tech/tags/agents.md>), [agents-md](<https://devfeed.tech/tags/agents-md.md>), [ai](<https://devfeed.tech/tags/ai.md>), [ai-agent](<https://devfeed.tech/tags/ai-agent.md>), [ai-agents](<https://devfeed.tech/tags/ai-agents.md>), [ai-coding](<https://devfeed.tech/tags/ai-coding.md>), [ai-coding-agent](<https://devfeed.tech/tags/ai-coding-agent.md>), [ai-coding-tools](<https://devfeed.tech/tags/ai-coding-tools.md>), [ai-model](<https://devfeed.tech/tags/ai-model.md>), [anthropic](<https://devfeed.tech/tags/anthropic.md>), [code](<https://devfeed.tech/tags/code.md>), [coding](<https://devfeed.tech/tags/coding.md>), [coding-agent](<https://devfeed.tech/tags/coding-agent.md>), [coding-agents](<https://devfeed.tech/tags/coding-agents.md>), [coding-tools](<https://devfeed.tech/tags/coding-tools.md>), [compaction](<https://devfeed.tech/tags/compaction.md>), [context](<https://devfeed.tech/tags/context.md>), [context-rot](<https://devfeed.tech/tags/context-rot.md>), [how-to](<https://devfeed.tech/tags/how-to.md>)

## AI overview

Context rot is an agent's declining ability to use information effectively as its working context grows, gets noisy, or becomes outdated; a larger context window alone does not prevent it. Signs include forgotten constraints, repeated failed approaches, outdated plans, distraction, and inconsistent decisions, especially as tasks lengthen. The article recommends filtering tool outputs while retaining enough detail to investigate, summarizing goals, constraints, findings, failures, changes, and next steps, retrieving files or documents on demand, keeping stable project instructions separate from temporary task state, and starting a fresh context with a careful handoff when needed. Each approach can lose useful evidence if applied poorly. An agent harness can coordinate retrieval, output filtering, task-state updates, compaction, and context refresh around model calls, with observability and evaluation to assess results. Context rot concerns effective use of context; context poisoning concerns misleading or harmful information entering it, so reducing clutter alone does not address poisoning.

## Source excerpt

Context rot in AI agents: How to recognize and fix it