<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dhruv Saija</title>
    <description>The latest articles on DEV Community by Dhruv Saija (@dhruv_saija).</description>
    <link>https://dev.to/dhruv_saija</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4240591%2F05a9bd91-e2cd-4b25-abad-46ccddf9126e.jpg</url>
      <title>DEV Community: Dhruv Saija</title>
      <link>https://dev.to/dhruv_saija</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dhruv_saija"/>
    <language>en</language>
    <item>
      <title>Context Rot: When Your AI Agent Learns the Wrong Project</title>
      <dc:creator>Dhruv Saija</dc:creator>
      <pubDate>Thu, 12 Nov 2026 08:53:21 +0000</pubDate>
      <link>https://dev.to/dhruv_saija/context-rot-when-your-ai-agent-learns-the-wrong-project-2jo6</link>
      <guid>https://dev.to/dhruv_saija/context-rot-when-your-ai-agent-learns-the-wrong-project-2jo6</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://blog.dhruvsaija.in/posts/context-rot-ai-agent/" rel="noopener noreferrer"&gt;dhruvsaija.in&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The most dangerous instruction for a coding agent is not the one you forgot to write. It is the one that used to be true.&lt;/p&gt;

&lt;p&gt;A repository can carry a build command that no longer builds, a deployment path that no longer reaches production, or a rule that describes an architecture nobody uses. To a human, those are familiar documentation bugs. To an agent, they are instructions.&lt;/p&gt;

&lt;p&gt;A recent paper gives this pattern a name: &lt;a href="https://arxiv.org/abs/2606.09090" rel="noopener noreferrer"&gt;context rot—the drift between persistent AI context and an evolving codebase.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Documentation drift is old. Agents change the failure mode.
&lt;/h2&gt;

&lt;p&gt;Every project carries old truths. A README names a service that no longer exists. A runbook keeps an environment variable from a previous deployment. A setup guide points at a directory that moved two reorganisations ago. Until recently, this was mostly an onboarding tax. A new engineer would try the command, hit an error, and ask a question.&lt;/p&gt;

&lt;p&gt;Persistent agent context changes that. Coding-agent tools now explicitly load project instructions, scoped rules, and durable memory from the repository. &lt;a href="https://docs.anthropic.com/en/docs/claude-code/memory" rel="noopener noreferrer"&gt;Claude Code documents this model through project files such as CLAUDE.md, AGENTS.md, and scoped rules.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That is useful because an agent should not need to rediscover the build command, the system boundary, or the test workflow from scratch every time. But it creates a harder problem: stale context is no longer a neglected note that a human may ignore. It becomes an input to the next change.&lt;/p&gt;

&lt;h2&gt;
  
  
  The difference between missing and stale context
&lt;/h2&gt;

&lt;p&gt;Missing context creates uncertainty. A good agent can inspect the repository, run a safe check, or ask for a decision. Stale context does the opposite. It hands the system a confident answer before the answer has been earned.&lt;/p&gt;

&lt;p&gt;That is why stale context can be more dangerous than absent context. The command may still run. The integration may still exist. The deploy target may still look plausible. Nothing has to be obviously broken for the change to be wrong. It only has to be wrong at a boundary the local diff cannot reveal.&lt;/p&gt;

&lt;h2&gt;
  
  
  A composite failure mode
&lt;/h2&gt;

&lt;p&gt;Imagine a repository whose agent instructions say that the production web app lives in &lt;code&gt;apps/web&lt;/code&gt;, deploys from the &lt;code&gt;main&lt;/code&gt; branch, and uses a particular environment variable as its canonical URL. All three statements were correct when the instructions were written.&lt;/p&gt;

&lt;p&gt;Six months later, the project has been reorganised. The app now lives in &lt;code&gt;web&lt;/code&gt;, production deploys through a different workflow, and the canonical URL has changed. The instruction file was never updated. An agent receives a request to change the site header, reads the repository context, and confidently edits the old path, validates the wrong build target, and reports a clean result.&lt;/p&gt;

&lt;p&gt;Nothing in that sequence requires the agent to hallucinate. It followed the project knowledge it was given. The failure came earlier: a fact was stored, trusted, and allowed to outlive its usefulness.&lt;/p&gt;

&lt;p&gt;This is a composite scenario, not a claim about a specific incident. Its point is that stale context produces a particularly awkward class of failure: the output can be technically tidy, locally verified, and still wrong about the system it is meant to change.&lt;/p&gt;

&lt;h2&gt;
  
  
  The context rot test: three questions before an agent trusts a fact
&lt;/h2&gt;

&lt;p&gt;The practical response is not more context. It is context that can answer three questions before an agent is expected to trust it.&lt;/p&gt;

&lt;p&gt;First: where is the source of truth? If an instruction says how to build, it should point to the package script or build configuration—not become a competing copy of it.&lt;/p&gt;

&lt;p&gt;Second: how can it be verified? A critical fact should have a command, test, CI check, permission boundary, or review step that can expose drift. Prose is useful for explaining why a constraint exists. It is a weak place to store rules that must always be true.&lt;/p&gt;

&lt;p&gt;Third: what updates or removes it when the system changes? An instruction with no maintenance path is a future liability. If nobody owns it, the agent will eventually inherit an old decision as if it were current architecture.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep context small enough to maintain
&lt;/h2&gt;

&lt;p&gt;Do not turn AGENTS.md into a catch-all archive of conventions, exceptions, and historical decisions. A file nobody can safely update becomes another source of context rot.&lt;/p&gt;

&lt;p&gt;Better context is compact and scoped. A repository guide can describe the project map and non-negotiable boundaries. Local instructions can describe subsystem-specific conventions. Build scripts and CI can carry verification rules. Access controls can make clear which actions need a human decision. Each layer should do the work it is best suited for.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changes in practice
&lt;/h2&gt;

&lt;p&gt;The point is not to make an agent autonomous. It is to make the next change easier to explain, verify, and own. When a project boundary changes, update the context that describes it. When a command changes, remove the old command. When something cannot be verified, state the uncertainty instead of presenting a clean but unreliable summary.&lt;/p&gt;

&lt;p&gt;That is ordinary engineering discipline. The difference is that the next person reading the project map may be an agent that can turn a stale assumption into a polished pull request before anyone has asked whether the assumption is still true.&lt;/p&gt;

&lt;h2&gt;
  
  
  Further reading
&lt;/h2&gt;

&lt;p&gt;The term context rot comes from &lt;a href="https://arxiv.org/abs/2606.09090" rel="noopener noreferrer"&gt;Context Rot in AI-Assisted Software Development&lt;/a&gt;, which connects persistent AI configuration to the long-standing problem of documentation consistency.&lt;/p&gt;

&lt;p&gt;The question is no longer whether your AI agent has enough context. It is whether the context you gave it is still true.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>ai</category>
      <category>agents</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
