claudemd-audit
NewAnalyse a CLAUDE.md against an instruction budget. Classifies each instruction line as deterministic-eligible (could be enforced by a hook), probabilistic-only (requires LLM judgment), vague (no actionable signal), or redundant (duplicates another rule). Outputs a budget report. Use when reviewing CLAUDE.md size, identifying rules that should move to hooks, shrinking an oversized instruction file, or planning an instruction migration. Triggers on phrases like "audit my CLAUDE.md", "is my CLAUDE.md too long", "what rules can I move to hooks", "instruction budget", or when the user is reviewing a CLAUDE.md file.
Overview
claudemd-audit
Audits a CLAUDE.md file against an instruction budget.
When to invoke
When the user asks any of:
- •"audit my CLAUDE.md"
- •"is my CLAUDE.md too long"
- •"what rules can I move to hooks"
- •"what's wasting my instruction budget"
- •"classify the rules in my CLAUDE.md"
Also when refactoring or shrinking a CLAUDE.md.
How to use
The skill ships with audit.py. Run it against the user's CLAUDE.md:
python audit.py /path/to/CLAUDE.mdFor JSON output:
python audit.py /path/to/CLAUDE.md --jsonThen summarise the findings, focusing on:
- total instruction line count vs total file line count
- ratio of deterministic-eligible to probabilistic-only — high deterministic ratio means a lot of rules could move to hooks
- specific vague lines that can be deleted with no loss
- specific redundant lines that should be consolidated
- the three biggest deterministic-eligible candidates worth moving to hooks first
Classifications
- •deterministic-eligible — rule that could be enforced by a hook (e.g. "never edit migrations", "always run lint before commit")
- •probabilistic-only — requires LLM judgment (e.g. "match the existing code style")
- •vague — no actionable signal (e.g. "be helpful", "write good code")
- •redundant — near-duplicate of another rule
Limitations
The classification heuristics are intentionally simple. They catch common signal patterns and miss subtler ones. Misclassifications are expected. Treat the output as a starting point for human review.
If a heuristic misfires noticeably on a given input, file the case as a TODO comment in audit.py rather than fixing the heuristic in place. The goal is repeatable signal, not perfect classification.
Install & Usage
mkdir -p .claude/skillsmkdir -p .claude/skills && curl -o .claude/skills/claudemd-audit.md https://raw.githubusercontent.com/blacksundev/claudemd-audit/main/SKILL.md/claudemd-auditFrequently Asked Questions
What is claudemd-audit?
Analyse a CLAUDE.md against an instruction budget. Classifies each instruction line as deterministic-eligible (could be enforced by a hook), probabilistic-only (requires LLM judgment), vague (no actionable signal), or redundant (duplicates another rule). Outputs a budget report. Use when reviewing CLAUDE.md size, identifying rules that should move to hooks, shrinking an oversized instruction file, or planning an instruction migration. Triggers on phrases like "audit my CLAUDE.md", "is my CLAUDE.md too long", "what rules can I move to hooks", "instruction budget", or when the user is reviewing a CLAUDE.md file.
How to install claudemd-audit?
To install claudemd-audit, create the .claude/skills directory in your project, then run the curl command to download the skill file. Once installed, invoke it in Claude Code with /claudemd-audit.
What is claudemd-audit best for?
claudemd-audit is a community categorized under General. It is designed for: code-review. Created by blacksundev.