Skip to main content
plugin

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

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add karanb192/claude-code-hooks
/plugin install dead-rules-audit@claude-code-hooks
Open on GitHub

What 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-hooks

Step 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

Similar plugins

All plugins for Agent setup: memory, context, orchestration →

From the same set28

The whole set →
protect-secrets protect-secrets — a PreToolUse hook that checks every Read, Edit, Write, Bash and Grep call and blocks .env, SSH keys or cloud credentials — or asks you first. ★ 586repo stars bounty-board bounty-board turns TODO and FIXME comments into bounties that grow in XP value as they age. Scans your repo, prices each debt marker by git-blame age, and feeds the top 3 into your session as side quests. ★ 586repo stars dead-end-registry dead-end-registry stores reverted code changes and alerts you before retrying failed ideas. Keeps track of discarded approaches and detour token costs per repository. ★ 586repo stars standup-autopilot The standup-autopilot plugin turns agent session transcripts into a daily standup card with tasks, tests, PRs, and blockers. Open blockers carry into the next session. ★ 586repo stars pr-provenance-stamp pr-provenance-stamp appends a provenance receipt to your pull request body: prompts, estimated spend, test exit codes and an agent-versus-human line split. ★ 586repo stars nerf-receipts The nerf-receipts plugin tracks tool failures, repeated edits to the same file, and tokens per task. Use it to see whether those signals shift when the model changes. ★ 586repo stars cache-tax cache-tax prices a cold return to a session before you send the next message, so a lapsed 1-hour prompt cache does not quietly re-write the whole context. ★ 586repo stars context-hogs context-hogs tracks per-file context usage and highlights which repo files drive up token spend. ★ 586repo stars

Project sponsors

Companies that keep this analytics open