update-docs

A procedure for bringing project documentation in line with the current code, including both committed documents and local instruction files.

In plain words
What is it for?
Use it after code changes to discover affected documentation, verify counts and conventions, and update the relevant files.
Why use it?
It finds changed areas and outdated structural details, such as documented test counts, that can otherwise mislead developers.

Command for Claude Code

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/xsovad06/sova/update-docs
Clone the repo
git clone --depth 1 https://github.com/xsovad06/sova

Made for: Claude Code.

Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 951 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 $0.00018 $0.00951
Opus 5 $0.00009 $0.00476
Sonnet 5 $0.00004 $0.00190
Haiku 4.5 $0.00002 $0.00095

Measured yesterday against content hash d36d8e26e79f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

update-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 yesterday.

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/update-docs.md · 107 lines

How it starts

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

Update Documentation

Ensure all documentation matches the current code state. Updates both git-tracked docs (committed) and local-only docs (e.g., CLAUDE.md files if gitignored).

Context: $ARGUMENTS

Phase 1: Discover What Changed

# Find the base branch
BASE=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo "main")

# Changed files on this branch (determines which docs to check)
CHANGED=$(git diff --name-only $(git merge-base HEAD origin/$BASE)..HEAD)
echo "$CHANGED"

Read the project's CLAUDE.md or AGENTS.md to understand documentation conventions and which files track counts.

Phase 2: Verify Structural Counts

Run the project's actual count verification commands and compare against documented values. Adapt the commands below to the project's structure.

# Tests (Python)
TEST_COUNT=$(find tests -name 'test_*.py' -exec grep -c 'def test_\|async def test_' {} + 2>/dev/null | awk -F: '{s+=$2}END{print s}')

# Tests (JS/TS)
# TEST_COUNT=$(find src \( -name '*.test.ts' -o -name '*.spec.ts' \) -exec grep -c 'it(\|test(' {} + 2>/dev/null | awk -F: '{s+=$2}END{print s+0}')

Search documentation files for count references and compare:

for f in README.md CLAUDE.md AGENTS.md docs/VISION.md .claude/rules/architecture.md docs/*.md .claude/rules/*.md; do
  [ -f "$f" ] && grep -niE '(tests|services|routers|templates|steps|commands|pages|modules|models|subcommands)[[:space:]]*:?[[:space:]]*[0-9][0-9,]*\+?|[0-9][0-9,]*\+?[[:space:]]*(tests|services|routers|templates|steps|commands|pages|modules|models|subcommands)' "$f"
done

Flag any documented count that doesn't match the actual count.

Phase 3: Check Scope-Specific Docs

Based on which files changed, check related documentation:

  • Source code structure changed (new files, renamed modules) -- verify architecture docs, module lists, project tree
  • Tests added/removed -- verify test counts in all docs
  • CLI commands changed -- verify command lists and help text references
  • Configuration changed -- verify config docs, env var references, default values
  • API endpoints changed -- verify API references, request/response shapes

Read the full file on GitHub · 107 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. yesterday First seen · 107 lines · 18 tokens per session scan A d36d8e26e79f

Subscribe to this mod's changes

update-docs is a command published in the GitHub repository xsovad06/sova (2 stars, last pushed 2d ago), licensed Apache-2.0. It adds 18 tokens to every session and 951 once invoked, about $0.0001 per session on Opus 5. 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-31.