dead-rules-audit — Claude Code plugin: what it does, how to install
dead-rules-audit tracks how Claude Code adheres to CLAUDE.md rules during edits and flags chronically violated items.
MIT ★ 586 updated 2026-10-26
/plugin marketplace add karanb192/claude-code-hooks
/plugin install dead-rules-audit@claude-code-hooksWhat dead-rules-audit does
At session start, the plugin parses your nearest CLAUDE.md into numbered individual rules. Every time Claude calls Edit, MultiEdit, or Write, a background PostToolUse hook checks the diff against each rule using deterministic pattern matching. It does not ping an LLM or use network bandwidth.
At the end of the session, it produces a scorecard sorted worst-first. Rules with repeated misses get a ⚠ promote→hook indicator, suggesting you convert text instructions into hard verification scripts. Built-in thresholds trigger this warning once an item hits at least 3 violations alongside a 0.5 failure rate, bounded by safety caps of 200 rules and 256 KB file size.
All state stays on your drive under ~/.claude/dead-rules-audit/ alongside session hook logs. It relies strictly on standard Node.js modules without extra third-party packages.
What it helps with
- audit which CLAUDE.md instructions the model actually follows
- measure rule violation frequency across file edit actions
- identify prompt rules that should be automated as enforcement hooks
Example prompts for the agent
- /dead-rules-audit:scorecard
- Check the CLAUDE.md compliance scorecard for this session
- Display which project rules were violated during recent edits
How to install dead-rules-audit
Plugin marketplace
/plugin marketplace add karanb192/claude-code-hooks/plugin install dead-rules-audit@claude-code-hooksStep by step, with commands for each platform: Claude Code plugins: marketplaces, installing, and building your own
Questions about dead-rules-audit
How to install dead-rules-audit in Claude Code?
Run /plugin marketplace add karanb192/claude-code-hooks followed by /plugin install dead-rules-audit@claude-code-hooks, then restart Claude Code.
What does dead-rules-audit do?
It records rule compliance from CLAUDE.md across editing commands and generates a scorecard highlighting frequently ignored instructions.
Does dead-rules-audit require an API key or internet access?
No, it operates entirely offline via local pattern heuristics and built-in Node.js libraries without network calls.
Source text
dead-rules-audit · MIT
# dead-rules-audit > A CLAUDE.md compliance scorecard that tallies which rules Claude actually follows vs ignores as you edit, and flags chronically-ignored rules to promote into a deterministic hook. At SessionStart it finds the nearest CLAUDE.md and parses it into numbered atomic rules, snapshotting which loaded this session. On every Edit/MultiEdit/Write a PostToolUse hook scores the change against each rule and tallies, per rule, how often it was relevant and whether it was followed or violated, appending to a local JSONL ledger. The judgement is a deterministic keyword/pattern heuristic: no model call, no network. At SessionEnd it renders a worst-first compliance scorecard (rule text, times relevant, times violated, compliance %, and a `⚠ promote→hook` flag for chronically-ignored rules) and persists it. You can also re-render on demand. ## Install ``` /plugin marketplace add karanb192/claude-code-hooks # once per machine /plugin install dead-rules-audit@claude-code-hooks ``` Restart Claude Code, done. (Or from a shell: `claude plugin install dead-rules-audit@claude-code-hooks`.) ## What it does | Event | Runs | What happens | |-------|------|--------------| | SessionStart | sync | Parse CLAUDE.md into numbered atomic rules; snapshot which rules loaded this session. | | PostToolUse (`Edit\|MultiEdit\|Write`) | async (zero added latency) | Score the change against each rule; update per-rule relevant/followed/violated tallies in the ledger. | | SessionEnd | sync | Render the worst-first compliance scorecard and persist it. | `/dead-rules-audit:scorecard` renders the worst-first compliance scorecard on demand, highlighting the worst offenders and any `promote→hook` rules. ## Configuration No configuration needed. There are no environment variables or settings. Tuning thresholds are hard-coded constants at the top of `dead-rules-audit.js`: the `promote→hook` flag fires at `PROMOTE_MIN_VIOLATIONS = 3` violations and `PROMOTE_RATE = 0.5` violation rate, with `MAX_CLAUDE_MD_BYTES = 256 * 1024` and `MAX_RULES = 200` guards. Tally state is stored in `~/.claude/dead-rules-audit/` (scorecard entries are also logged to `~/.claude/hooks-logs/<date>.jsonl`). ## Data & privacy It records your CLAUDE.md rule text and per-rule relevant/followed/violated tallies. Everything stays on the local machine: the source requires only `fs`, `path`, `os`, and `crypto`, makes zero network calls, and is fully deterministic. ## Uninstall ``` /plugin uninstall dead-rules-audit@claude-code-hooks ```
© Karan Bansal · MIT · karanb192/claude-code-hooks