Audit CLAUDE.md and AGENTS.md at the repository root. Both files
intentionally share the same H2 section structure; their bodies are allowed
to diverge only for runtime-specific sections (typically Conventions,
Plugin Structure, MCP Tool Surface, MCP Server (local dev) — confirm
per project).
Rules
- The set of
##H2 section titles must be identical across both files. - For every section NOT on the project's allow-list, the body text must be character-for-character identical.
- Sections on the allow-list may diverge in body content but must still appear under the same heading in both files.
How to run
If the cartographing-kittens package is installed and the project ships
scripts/sync_claude_agents_md.py:
uv run python scripts/sync_claude_agents_md.py --check
Otherwise, do it inline:
ReadbothCLAUDE.mdandAGENTS.md.- Extract the H2 section list from each (lines matching
^##). - Diff the title sets. Report any title present in one file but not the other.
- For each title present in both, compare bodies. Skip sections on the
project's allow-list (look for a constant like
CONTENT_ALLOWLISTinscripts/sync_claude_agents_md.pyif present; otherwise infer from section names — anything that names a runtime, plugin layout, or MCP surface is likely allow-listed). - Report drift in the form
<file>: section <title>: <description of difference>.
Fix mode
When $ARGUMENTS includes --fix:
- For missing sections, propose copying the section header (and a stub
TODO: align with <other file>line) into the file that's missing it. Ask the user to confirm before writing. - For body drift in non-allow-listed sections, propose syncing AGENTS.md ← CLAUDE.md by default (the project may pick the other direction; if so, follow the project's convention).
- Never auto-write without confirmation when the section body has clearly diverged on purpose — surface the diff and ask which side is canonical.
Report
Print one line per drift item, then a summary like
CLAUDE.md and AGENTS.md: <N> drift items across <K> sections (<M> in allow-listed sections, ignored). Exit 0 if no non-allow-listed drift.
Notes
- This skill is project-agnostic. The allow-list of sections that may legitimately diverge lives in the project's own sync script — do not hardcode kitty's list when running against other repositories.
- Pre-commit hooks typically run this in
--checkmode; the skill is invoked when a human wants a richer diff and optional auto-fix.
Source: Kakise/cartographing-kitties-plugin — distributed by TomeVault.