/live-rules:audit-rulesfrom live-rules
Audits .claude/rules/ for dead globs, oversized or duplicate rules, and leftover v1 keys. Useful when rules seem ignored or context feels heavy.
Ships in live-rules. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Run the script from the project root and read the result:
node "${CLAUDE_PLUGIN_ROOT}/scripts/audit-rules.mjs" --rules .claude/rules --table
It needs Node 22.5 or later. If Node is missing or older, say the audit cannot run here and stop. Drop --table for JSON. Add --file <path> to look at one rule. For user scope use --rules ~/.claude/rules.
The script reads files only. It exits 0 unless a file cannot be parsed, so a clean exit does not mean no findings. Read the table.
| Code | Meaning | Fix |
|---|---|---|
parse-error | The frontmatter cannot be read. The rule is not loading. | Open the file, fix the line it names. Each frontmatter line is key: value or - item. |
ignored-field | A v1 key (globs, dirs, prompt, include, priority, enabled) sits in a native rule. Claude Code ignores it, so the rule may be loading everywhere. | Apply the fix in the finding. |
no-match | A paths glob matches no file in the project. | Correct the glob. Delete the rule if that code is gone. |
over-budget | The body is over 1.5 KB for an always-loaded rule, or 2 KB for a path-scoped one. | Trim it. For an always-loaded rule, adding a paths glob is usually better. Otherwise split it by concern. |
possible-duplicate | Two rules have the same paths and a shared heading. | Merge them or delete one. It is a hint, so read both first. |
The audit skips the codebase map (codebase-map.md and map/), which has its own limits and status check, and says so in one line. Files under guides/ are audited like any rule.
The last line of the table is the total always-loaded bytes. Every byte there is paid for in every session. If the number is large, point at the biggest always-loaded rules and ask whether each really applies everywhere.
Lead with what is wrong and how bad it is. One line per finding: file, problem, fix. Do not apply the fixes without being asked, since rules are the user's standing instructions. When asked, edit the file and run the audit again to show it is clean.
Glob matching uses git ls-files, including untracked files git does not ignore. Outside git it walks the directory and skips node_modules. Matching follows gitignore rules, the same as the engine.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub eigenwise/eigenwise-toolshed --plugin live-rules2 skills in this plugin
Other plugins' skills for the same job