Papers
Topics
Authors
Recent
Search
2000 character limit reached

Context Rot in AI-Assisted Software Development: Repurposing Documentation Consistency for AI Configuration Artifacts

Published 8 Jun 2026 in cs.SE and cs.AI | (2606.09090v1)

Abstract: Developers increasingly provide AI coding assistants with persistent context through configuration files such as CLAUDE.md, AGENTS.md, and .cursorrules. These files describe code elements, architecture, and development conventions, forming the context that guides AI tool behavior across sessions. As software evolves, this context can become stale, a phenomenon we call context rot. While AI configuration artifacts are new, the underlying consistency problem connects to decades of software documentation research. Researchers have built tools to check consistency between documentation and code, spanning README files, code comments, API documentation, architecture descriptions, and installation instructions. We argue that this existing toolbox is an immediate starting point for detecting context rot, and we present a research roadmap mapping documentation consistency approaches to corresponding problems in this new setting. As preliminary evidence, applying an existing README/wiki consistency checker to a statistically representative sample of 356 repositories identifies stale code element references in 23.0% of repositories, showing that traditional documentation consistency tools can already surface context rot.

Summary

  • The paper reframes context rot as documentation-code inconsistency and applies the unmodified DOCER checker to 612 AI configuration files across 356 repositories.
  • The study found stale code references in 23.0% of repositories, with 230 outdated references and manual validation indicating that 64% were genuine cases of referential rot.
  • The paper proposes CI-based consistency checks and a research roadmap covering behavioral instructions, MCP tools, architecture claims, dependency guidance, and automated repair.

Overview

"Context Rot in AI-Assisted Software Development: Repurposing Documentation Consistency for AI Configuration Artifacts" by Treude and Baltes addresses a gap that has emerged as AI coding assistants such as Claude Code, GitHub Copilot, Cursor, and Gemini CLI have become embedded in development workflows. These tools rely on persistent, repository-versioned Markdown configuration files — CLAUDE.md, AGENTS.md, copilot-instructions.md, GEMINI.md, and the deprecated .cursorrules — to supply project-specific context across sessions. The authors introduce the term context rot for the gradual divergence between what these files claim about a codebase and what actually holds: references to functions that no longer exist, file paths that have been deleted, or conventions the team has abandoned. The paper's central argument is that this problem is structurally identical to documentation-code inconsistency studied since the early 2000s, so existing consistency checkers are an immediate starting point rather than requiring new detection techniques.

The paper makes three contributions: (1) the conceptual framing of context rot for AI configuration artifacts; (2) preliminary empirical evidence obtained by applying DOCER, an unmodified README/wiki consistency checker (2606.09090), to AI configuration files; and (3) a research roadmap mapping five classes of documentation consistency technique onto open problems in this setting. The term "context rot" extends prior usage, which referred to degradation within a model's input context window; here it denotes staleness of repository-versioned artifacts relative to an evolving codebase.

Background and motivation

AI configuration files differ from interactive prompts in that they live alongside source code, are versioned, and are read automatically at session start. They contain substantive content — architecture descriptions, build commands, testing practices, and precise references to specific functions, files, and constants. Prior work establishes their relevance: Lulla et al. show empirically that AGENTS.md files reduce agent runtime and token consumption, making the accuracy of these files directly consequential for assistant efficiency. Mohsenimofidi et al. study context engineering practices, and Galster et al. provide both a dataset of configuration files (with AGENTS.md at 42.7%, CLAUDE.md at 30.3%, and copilot-instructions.md at 13.7% of files) and an exploratory study of configuration practices.

The authors' key observation is asymmetry in how drift is caught: code changes are continuously validated by compilers, tests, and CI, whereas configuration files — like all documentation — are updated manually and incompletely. They enumerate five established consistency research threads whose divergence classes map onto AI configuration artifacts: README/code reference checking (DOCER), code comment consistency (iComment, @tComment, deep just-in-time detection), API documentation checking, architecture consistency via traceability link recovery, and installation/dependency instruction checking (FindICI). The common operationalization is that a textual claim about software state can be checked against the actual software and flagged on divergence.

Preliminary study

The study isolates one form of context rot: referential rot, where a configuration file names code elements (functions, classes, constants, scripts, file paths) that no longer exist. Using the Galster et al. dataset, after excluding empty and pointer-only files, the authors randomly sampled 356 repositories (seed 42), sized for 95% confidence with a 5% margin of error over the eligible population, yielding 612 configuration files.

They apply DOCER without modification: extract candidate identifiers from the HEAD version of each configuration file via regular expressions, verify presence in source at the file's first commit, re-verify at HEAD, and classify elements present at first commit but absent at HEAD as stale. This deliberate non-tuning is the point of the exercise — measuring what traditional tooling reveals out of the box.

Headline result: DOCER extracted roughly 18,000 verified references and found 230 stale ones distributed across 82 repositories — 23.0% of repositories (95% CI 18.8–27.2%) contained at least one stale reference. Per-reference stale rates were similar across file types (1.0–1.4%), with CLAUDE.md and Copilot instructions at 1.42% and AGENTS.md at 1.04%. Among affected repositories, the median stale count was 1 and the maximum 20. Concrete examples include a missing tsyringe library reference in microsoft/pr-metrics, a function apparently renamed during a UI rewrite in dagu-org/dagu, and deleted script paths in EricLBuehler/mistral.rs.

Manual inspection of 50 randomly sampled stale classifications by one author found 64% genuine referential rot, 24% false positives, and 12% ambiguous cases. False positives stem from DOCER's broad regular expressions matching common English words or generic tokens. The authors also note two opposing biases on the 23.0% figure: the two-snapshot design misses references introduced after the first commit (deflating prevalence), while regex imprecision inflates it. They therefore present 23.0% as a feasibility signal, not a precise prevalence estimate — an appropriate caveat given the single-annotator validation and lack of inter-rater agreement assessment.

A practical implication follows immediately: the lightweight git grep-based two-snapshot check requires no new tooling, runs in CI, and surfaces concrete drift such as renamed functions or dropped dependencies. Treating configuration files as code and reviewing them alongside refactors prevents much rot at the source.

Research roadmap

Beyond the demonstrated referential case, the paper identifies four open transfer opportunities, each pairing an established technique with an unstudied problem:

Technique Representative tools AI configuration analogue Status
Referential (code/README) DOCER Stale code element references Shown here
Code comment iComment, @tComment Behavioral instructions referencing renamed/deleted elements Open
API documentation Directive defect checkers MCP tool descriptions diverging from implementations Open
Architecture Traceability link recovery Drifting architectural claims Open
Installation/dependency FindICI Runtime/dependency versions that no longer hold Open

Four research questions structure the agenda. RQ1 asks for a full taxonomy of context rot types, requiring longitudinal analysis of the configuration-file corpus. RQ2 asks which techniques transfer without modification, testable via the recipe used here: apply the unmodified tool, measure firing rates, manually validate precision. RQ3 asks which forms of rot actually affect assistant behavior — a configuration file can be stale without degrading output, and controlled experiments injecting stale references (extending Lulla et al.'s with/without-AGENTS.md design) are needed to establish causal impact. RQ4 concerns repair, proposing a hybrid in which deterministic detection localizes the stale element and a LLM inspects git history to suggest the corrected reference, evaluated against the element's actual rename. The authors concede the taxonomy is not exhaustive: natural-language convention descriptions resist operationalization as code queries.

Limitations and open questions

Several limitations bound the results. The manual validation involved a single annotator with no inter-rater agreement check. The two-snapshot design systematically undercounts rot by ignoring later-introduced references, while regex breadth inflates false positives; the authors explicitly decline to interpret 23.0% as precise prevalence. The sample covers only public GitHub repositories containing AI configuration files, limiting generalization to private or non-GitHub settings. Per-type differences in stale rates were not tested for significance. Open questions include whether behavioral, architectural, and dependency forms of rot occur at comparable rates (RQ1), whether the remaining four technique families transfer without tuning (RQ2), and whether detected rot measurably degrades assistant output quality (RQ3).

Conclusion

This paper reframes staleness in AI coding-assistant configuration files as an instance of the long-studied documentation consistency problem and demonstrates the reframing empirically: an off-the-shelf checker, applied unchanged, flags stale code references in nearly a quarter of sampled repositories, with roughly two-thirds precision on inspected cases. The contribution is less a new technique than a transfer argument backed by a concrete roadmap — behavioral instructions, MCP tool descriptions, architectural claims, and dependency references remain untested targets. Whether context rot materially degrades assistant behavior, and whether hybrid detect-and-repair pipelines close the loop, are the questions the paper leaves to subsequent work.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.