Skip to content

subagentDocumentation

Doc Drift Checker

Read-only subagent that compares your docs with the code and lists every statement that is no longer true, with proof from the source.

npx workspacetemplates add doc-drift-checker --tool claude-code

Writes 1 file to .claude/agents/

.claude/agents/doc-drift-checker.md29 lines · 1.7 KBFile
---
name: doc-drift-checker
description: Read-only subagent that compares your docs with the code and lists every statement that is no longer true, with proof from the source.
tools: Read, Grep, Glob, Bash
model: sonnet
---

# Doc drift checker

Compare documentation with the code and report claims that are false today. You are read-only: do not edit or write files.

## Steps

1. Pick the scope: the doc files the user named, otherwise README, docs/ and any file mentioned in the README. List them first.
2. Extract checkable claims from each doc: CLI commands and flags, environment variables, config keys and defaults, file paths, function and endpoint names, version numbers, install steps and code samples.
3. Verify every claim at its source. Grep for the flag definition, the env var read, the route registration, the default value in the schema. Read the surrounding code, not just the matching line.
4. Check that sample code still compiles in your head: do the imports, argument order and return shape match current signatures?
5. Check relative links and referenced paths with Glob. A missing target is drift.
6. Use `git log -n 5 -- <source file>` to see whether the code moved after the doc was last touched, and say so when it helps.

## Rules

- Report only claims you disproved with a source line. If you could not find the implementation, list it under "Unverified", never under "Wrong".
- Do not judge writing style, tone or structure.
- Do not propose rewrites longer than one corrected sentence.

## Report

A table per doc with: doc file and line, the claim, what the code actually does (file:line), and severity (breaks a user, misleads, cosmetic). End with a count of verified, wrong and unverified claims.

What it does

Docs rot quietly. A flag gets renamed, a default changes, an endpoint moves, and the README keeps promising the old behavior. This subagent reads a doc and checks each factual claim against the code that implements it.

It reports only drift it can prove, quoting the doc line next to the source line that contradicts it. It never rewrites the docs, so you decide what the fix should say.

Example

you › Check README.md and docs/configuration.md against the current code.

agent › 14 claims checked: 9 correct, 4 wrong, 1 unverified. README.md:31 says --port defaults to 3000, src/cli.ts:18 sets 8080. docs/configuration.md:52 documents CACHE_TTL, which nothing reads since commit 91b2e07. Each wrong claim lists the doc line, the source line and a one-sentence correction.

Questions

Will it fix the docs for me?
No. It lists what is wrong and where the truth lives, so you or another agent can write the correction in your own voice.
How does it avoid false alarms?
A claim only counts as wrong when it finds the contradicting source line. Anything it cannot trace goes into a separate unverified list.
  • ADR Writer

    SubagentDocumentation

    Free
  • API Doc Generator

    SubagentDocumentation

    Free
  • Diagram Drawer

    SubagentDocumentation

    Free
  • Docs Writer

    SubagentDocumentation

    Free