Rule Entropy banner
gkw77 gkw77

Rule Entropy

Testing community

Description

A self-testing rule router for AI agents — routes a query to relevant rules, with precision/recall receipts

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Rule Entropy: How many of your CLAUDE.md rules are just faith?

中文文档见 [README.zh.md](README.zh.md)

Every session your agent stuffs the entire CLAUDE.md / skills into context. Rules pile up, the agent gets dumber, and nobody knows which rule is actually helping vs. which is just "feels right" faith. The author turned the tool on his own rules: scanned 167 rule blocks - **87% are behavior rules with no metric, 12 claim metrics with zero receipt**. The tool is included; clone and run it on your own rules.

30 seconds: scan your own rules, see how many are "faith"

git clone https://github.com/gkw77/rule-entropy.git && cd rule-entropy
node reproducible/rule-evidence-audit.js corpus .                          # scan the repo's 13 rule snapshots, zero deps
node reproducible/rule-evidence-audit.js ~/.claude/rules "common,python"   # scan your own rules

Each rule block gets an evidence verdict: `behavior_NA` (behavior rule, no metric) / `claimNoMetric` (claims a metric, zero receipt) / `faith` (claims and unmeasured) / `secondhand_needsRepro` (cites someone else's number, needs reproduction) / `selftested_partial` (has self-testing). Most of your blocks will land in the first two - that's rule entropy: unverified, it only grows.

What it does

  1. Routing - on a query, load only the relevant rules, not all of them. The author's own 13 rule files (~60KB) get auto-loaded in full every session by default; after routing, only the 1-3 relevant ones load. Fixes context bloat.
  2. Self-testing - routing accuracy has real P/R numbers, not "feels right". Rule corpus: L0 P=0.511 -> L1 P=0.648 -> strict-judge P=0.861; skill corpus: L0 P=0.30 -> L1 P=0.785 / R=1.0 (cross-language rescue). Routing rules are rules too - by "unverified rule = faith" they must be tested.
  3. Dedup - score skills + find semantic duplicates, flag redundancy to merge. Of 325 skills, 22 are redundant (should merge), 3 are broken (should delete).

All three come with receipts