What
rulehook — Turn soft CLAUDE.md rules into enforced hooks using a three-layer architecture.
The problem
5+ open issues on anthropics/claude-code about CLAUDE.md rules being ignored. Rules are soft constraints with zero enforcement. The result: users burn credits, lose trust, and one paying subscriber (#29236) is considering legal action.
The approach
L1: SKILL.md prevention — insert mandatory pre-check before code generation
L2: Stop hook intercept — two-stage grep (scan transcript, warn on violation)
L3: SessionStart audit — read observations.jsonl, inject compliance rate
Three independent hooks connected via filesystem. No central coordinator. Zero token overhead (Node.js regex, no LLM call). Zero external deps.
Why this belongs here
Not a single-use tool — an architecture pattern. Extensible via a RULES object (add one JSON entry per rule). 10-rule stress test: 0.10ms/check, 100% pass.
Repo: https://github.com/wuykjl/rulehook
License: MIT
Install: Two files + two JSON config blocks
What
rulehook — Turn soft CLAUDE.md rules into enforced hooks using a three-layer architecture.
The problem
5+ open issues on
anthropics/claude-codeabout CLAUDE.md rules being ignored. Rules are soft constraints with zero enforcement. The result: users burn credits, lose trust, and one paying subscriber (#29236) is considering legal action.The approach
Three independent hooks connected via filesystem. No central coordinator. Zero token overhead (Node.js regex, no LLM call). Zero external deps.
Why this belongs here
Not a single-use tool — an architecture pattern. Extensible via a RULES object (add one JSON entry per rule). 10-rule stress test: 0.10ms/check, 100% pass.
Repo: https://github.com/wuykjl/rulehook
License: MIT
Install: Two files + two JSON config blocks