Skip to content

feat: add rulehook — enforce CLAUDE.md rules via hooks#1310

Open
wuykjl wants to merge 1 commit into
anthropics:mainfrom
wuykjl:add-rulehook
Open

feat: add rulehook — enforce CLAUDE.md rules via hooks#1310
wuykjl wants to merge 1 commit into
anthropics:mainfrom
wuykjl:add-rulehook

Conversation

@wuykjl

@wuykjl wuykjl commented Jun 13, 2026

Copy link
Copy Markdown

Problem

CLAUDE.md rules lack enforcement — 5+ open issues on anthropics/claude-code about rules being ignored, including one paying subscriber (#29236) considering legal action. Rules are soft constraints with zero mechanism to prevent violations.

Solution

rulehook — three-layer architecture:

L1: SKILL.md injection (prevention before generation)
L2: Stop hook two-stage grep (transcript audit, zero-token)
L3: SessionStart compliance audit (historical rate injection)

Each layer independent. Connected via filesystem only. Zero LLM token overhead (Node.js regex). Zero external dependencies. Two files to install.

Tested

  • 16 scenarios + 4 verification items + 5 pressure scenarios: 100% pass
  • 10-rule stress test: 0.10ms per check
  • Threshold boundary test: 84% → warn, 85% → silent (exact)

Repo

https://github.com/wuykjl/rulehook (MIT license)

Three-layer architecture bridges soft rules to hard hooks.
Addresses systemic gap: 5+ open anthropics/claude-code issues
about CLAUDE.md rules being ignored, including #29236 (legal action).
Zero token cost, zero deps, two files to install.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant