anthropics / anthropics/skills
rulehook — turn CLAUDE.md soft rules into enforced hooks (zero tokens, zero deps)
- Ngôn ngữ chính
- Python
- Star
- 176k
- Fork
- 20.8k
- Merge trung bình
- 7 giờ 21 phút
- Pull request đã merge (30 ngày)
- 5
Mô tả
## 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
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.