See it as a diagram
Everything below, as a diagram you can edit. Describe yours and see it in seconds.
No account needed · Editable canvas, not a picture
A definition you can reuse
Documentation drift, defined
Two things follow from that definition. First, drift is a property of the pair (doc, system), not of the doc alone: a page nobody has touched in two years is perfectly current if the thing it describes has not changed either. Age is a proxy for drift, not a measure of it. The real unit is “changes to the system since the doc was last true”.
Second, the end states have names. A doc that has drifted far enough to mislead is stale documentation, and the cure there is an audit. A doc that structurally cannot drift, because it is generated from or verified against its source, is living documentation, and that is the target state everything below works toward.
Why drift happens
Drift is not caused by lazy engineers. It is caused by three gaps built into how most teams document:
A separate task. Updating the doc is a second piece of work after the change itself, and the second piece of work is the one that gets cut under deadline. A separate tool. The code changes in the repo; the doc lives in Confluence or Notion, where no diff, review, or build ever touches it. A separate author. The person who made the change is rarely the person who feels responsible for the page describing it, and anyone else is reconstructing context they never had.
Underneath all three sits the structural issue: no test fails when a doc becomes wrong. Every other artifact in a modern pipeline has a feedback loop. Break the build, CI tells you. Break an API contract, a consumer test tells you. Break a sentence in the architecture overview, nothing happens for eight months, and then a new hire provisions the wrong database.
Drift concentrates where change frequency is high and the doc is manual: architecture diagrams pasted as images, setup guides, API examples, config references. Data platforms get the compounding version, because schemas and pipelines change daily; that variant has its own guide on keeping data documentation in sync.
How to detect drift
You cannot test a paragraph against production, so detection works on proxies. Four are worth the setup cost:
1. Doc age against subject churn. List every doc with its last-commit date, next to how often the code it covers changes. A README last touched a year ago in a directory with 400 commits since is drift with a probability near one. This is one command in a repo:
# Every doc, oldest first, with the date it last changed git ls-files 'docs/**/*.md' | while read -r f; do printf '%s %s\n' "$(git log -1 --format=%as -- "$f")" "$f" done | sort
2. CI rules that pair code paths with doc paths. The crude version catches a surprising amount: if a sensitive directory changed and its doc did not, fail the PR and make the author say why.
# ci: fail the PR when infra changes but its doc does not CHANGED=$(git diff --name-only origin/main...HEAD) if echo "$CHANGED" | grep -q '^terraform/' && \ ! echo "$CHANGED" | grep -q '^docs/infrastructure.md'; then echo "terraform/ changed, docs/infrastructure.md did not" exit 1 fi
3. Reference checkers. Link checkers, plus a grep of the docs tree for names of services you have renamed or decommissioned. A doc that mentions a retired service has told you everything you need to know about its maintenance.
4. Ownership with a cadence. Every doc gets an owner in front matter or CODEOWNERS, and owners get asked on a schedule whether their pages are still true. This is the weakest check, because it relies on memory, but it is the only one that covers prose no automation can reason about.
The honest limit
How to stop drift, not just find it
Detection tells you the docs rotted. Stopping the rot means removing the human update step wherever the content is derivable from source:
Generate reference docs. API surface from OpenAPI, infrastructure inputs and outputs from terraform-docs, warehouse models and lineage from dbt docs, module reference from TypeDoc or Sphinx. A generated doc is a build artifact: it is exactly as current as the last build, and it cannot drift, only fail to regenerate, which CI notices.
Move prose into the repo. What cannot be generated (rationale, guides, decisions) should change in the same commit as the code it describes. That does not prevent drift, but it makes drift visible in review, which is the difference between a gap measured in days and one measured in quarters.
Stop exporting diagrams. The classic drift artifact is the architecture screenshot pasted into a wiki. Replace it with a diagram that is embedded from a live source, so every copy in every doc follows one canvas, and updating the diagram once updates it everywhere.
Let the agent that changed the code update the diagram. A coding agent that just modified your pipeline still holds the whole change in context. Through an MCP diagram server, that agent can regenerate the architecture diagram from the repository in the same session, which closes the last gap: same task, same tool, same author. It works for any system an agent can read from the repo, whether that is a data pipeline or a CI/CD pipeline diagram.
These options, and the ones this page skips (wikis with owners, docs-as-code linting), are compared side by side in best tools to keep docs and code in sync.
If your docs have already drifted
Prevention assumes a clean starting point, and almost nobody has one. If you are staring at a wiki you no longer trust, start with the stale documentation audit: find the pages that lie, delete or date-stamp most of them, and automate freshness only for the few that carry weight. Then the prevention above keeps the fixed state fixed.
FAQ
What is documentation drift?
How do you detect documentation drift?
How do you prevent documentation drift?
Is documentation drift inevitable?
What is the difference between documentation drift and stale documentation?