BeClaude

claudemd-audit

New
GitHub TrendingGeneralby blacksundev

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.

Community PluginView Source

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:

bash
python audit.py /path/to/CLAUDE.md

For JSON output:

bash
python audit.py /path/to/CLAUDE.md --json

Then summarise the findings, focusing on:

  1. total instruction line count vs total file line count
  2. ratio of deterministic-eligible to probabilistic-only — high deterministic ratio means a lot of rules could move to hooks
  3. specific vague lines that can be deleted with no loss
  4. specific redundant lines that should be consolidated
  5. 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

1
Create the skills directory
mkdir -p .claude/skills
2
Download the skill file
mkdir -p .claude/skills && curl -o .claude/skills/claudemd-audit.md https://raw.githubusercontent.com/blacksundev/claudemd-audit/main/SKILL.md
3
Invoke in Claude Code
/claudemd-audit
View source on GitHub
code-review

Frequently 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.