From codified-context
Use when checking if project context documents are stale or outdated, when the user says "audit staleness", "check context drift", "are my docs current", or when the session-start hook detected drift. Performs deep analysis of all context documents against current codebase state.
npx claudepluginhub pwarnock/pwarnock-cc-plugins --plugin codified-contextThis skill uses the workspace's default tool permissions.
Before beginning the audit, verify the context infrastructure exists:
Detects documentation drift, stale references, and cross-document inconsistencies in projects. Scans code-doc mismatches, broken links, outdated versions, and git staleness.
Audits codebase documentation for accuracy, completeness, and freshness by comparing against code structure. Auto-fixes small discrepancies in fix mode, reports structural changes. Works with any language/framework.
Audits Claude Code project context (CLAUDE.md, rules, knowledge) for progressive disclosure compliance: verifies knowledge reachability from rules, detects stale references, orphans, and index leakage. Use after adding/refactoring files.
Share bugs, ideas, or general feedback.
Before beginning the audit, verify the context infrastructure exists:
.claude/context/ exists in the project rootdrift-patterns.md at ${CLAUDE_PLUGIN_ROOT}/skills/audit-staleness/references/drift-patterns.md — use it throughout this audit to classify findingsScan each context document for referenced file paths and verify they still exist on disk.
Documents to scan: constitution.md, trigger-tables.md, subsystem-map.md, all files under specs/
For each document:
src/, lib/, pkg/, quoted paths, backtick-wrapped paths, and Markdown code spans containing /)Summarize: "X of Y referenced paths are broken" per document.
For key functions and interfaces mentioned in spec files under specs/:
Focus on high-impact symbols: exported functions, public interfaces, route handlers, and configuration schemas.
Locate the build, test, and lint commands recorded in constitution.md §4 (or equivalent "Commands" section).
For each command:
--help or --dry-run if the tool supports it, or check that the binary/script exists./scripts/build.sh), verify the file exists and is executablebun run build), verify the task is defined in the relevant config fileDo NOT run commands that modify state (no build, deploy, migrate). Only verify existence and basic validity.
Compute a staleness score for each context document. Use the heuristics table in drift-patterns.md (Green / Yellow / Red thresholds).
For each document, calculate:
| Dimension | How to measure | Weight |
|---|---|---|
| Document age | Days since last git log modification date | 25% |
| Path validity | % of referenced paths that still exist | 40% |
| Git coverage | % of subsystems with recent git changes that have updated docs | 25% |
| Command validity | % of referenced commands that are still valid | 10% |
Combine into a per-document score (0–100, higher = healthier). Use the thresholds:
Present a structured report with the following sections:
A single weighted average across all documents. State the score and its color band.
A table:
| Document | Age | Paths | Coverage | Commands | Score | Status |
|-----------------------|------|---------|----------|----------|-------|--------|
| constitution.md | 12d | 100% | 80% | 100% | 91 | Green |
| subsystem-map.md | 45d | 72% | 40% | n/a | 53 | Yellow |
| specs/auth.md | 60d | 60% | 20% | n/a | 38 | Red |
List every broken path or mismatched signature with:
Classify each finding using the drift categories from drift-patterns.md.
Cross-reference subsystem-map.md against recent git history (last 30 days). For each subsystem that had code changes but no corresponding doc update, flag it with the files changed and the doc that should have been updated.
For each Red-status document and each High-severity finding:
After applying fixes, re-run the affected dimension check (path existence, command validity) to confirm the fix resolved the issue.
For Yellow-status documents with no immediate blockers, summarize the recommended maintenance actions and suggest scheduling them.
Consult ${CLAUDE_PLUGIN_ROOT}/skills/audit-staleness/references/drift-patterns.md for: