audit_docs

audit_docs is a command for Claude Code from swarm-ai-research/swarm. It costs 0 tokens per session (1,776 once invoked), scanned A, original, MIT.

A command for checking project documentation and metadata for outdated counts, version mismatches, broken links, missing entries, and incomplete navigation.

In plain words
What is it for?
Auditing all metadata, checking the MkDocs navigation, or analyzing documentation-health history from the project provenance log.
Why use it?
It finds documentation problems without changing files automatically, so the team can correct them deliberately.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions AGENTS.md.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/swarm-ai-research/swarm/audit_docs
Clone the repo
git clone --depth 1 https://github.com/swarm-ai-research/swarm

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for audit_docs

README.md
[![agentmods](https://agentmods.dev/badge/commands/swarm-ai-research/swarm/audit_docs.svg)](https://agentmods.dev/commands/swarm-ai-research/swarm/audit_docs)
Your own site
<a href="https://agentmods.dev/commands/swarm-ai-research/swarm/audit_docs"><img src="https://agentmods.dev/badge/commands/swarm-ai-research/swarm/audit_docs.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,776 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01776
Opus 5 $0.00000 $0.00888
Sonnet 5 $0.00000 $0.00355
Haiku 4.5 $0.00000 $0.00178

Measured 6d ago against content hash 45f58ca6188c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

audit_docs scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/audit_docs.md · 227 lines

How it starts

The opening of the file, as written. The whole thing — 227 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/audit_docs

Audit all project metadata files for stale counts, version mismatches, broken references, and missing entries. Reports discrepancies without auto-fixing.

Use --nav-only to just check mkdocs.yml nav completeness (replaces the former /check_nav command).

Usage

/audit_docs [--nav-only] [--provenance]

Examples:

  • /audit_docs (full audit)
  • /audit_docs --nav-only (just check mkdocs nav)
  • /audit_docs --provenance (provenance log analysis only)

Argument parsing

  • --nav-only: Only run Phase 6 (mkdocs nav check) and report. Skip all other phases.
  • --provenance: Analyze .claude/provenance.jsonl for documentation health trends. Skip all other phases.

--provenance mode

Analyze the full provenance log (.claude/provenance.jsonl) for documentation health trends. Each line is a JSON object with fields: timestamp, branch, files_changed (array), new_files (array, optional), docs_reminders_resolved (int), docs_reminders_unresolved (int).

1. Parse provenance log

Read .claude/provenance.jsonl. If it doesn't exist or is empty, report "No provenance data found" and exit.

2. Compute overall stats

  • Total commits tracked: number of entries
  • Documentation co-staging rate: For each doc file type (CHANGELOG.md, README.md, AGENTS.md), count how many entries include that file in files_changed. Report as N/total (%).
  • Docs reminders issued: sum of docs_reminders_resolved + docs_reminders_unresolved across all entries
  • Docs reminders resolved: sum of docs_reminders_resolved
  • Docs reminders unresolved: sum of docs_reminders_unresolved

3. Recent trend

Take the last 10 entries (or all if fewer than 10). Compute the same co-staging rate and unresolved count for this window.

4. Files with most unresolved reminders

Group entries by the directory prefix of files in files_changed (e.g. swarm/core/, swarm/agents/, .claude/commands/). For entries with docs_reminders_unresolved > 0, count how many times each directory appears. Report the top 5.

Read the full file on GitHub · 227 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 227 lines · 0 tokens per session scan A 45f58ca6188c

Subscribe to this mod's changes

audit_docs is a command published in the GitHub repository swarm-ai-research/swarm (41 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,776 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.