anthropics / anthropics/skills

rulehook — turn CLAUDE.md soft rules into enforced hooks (zero tokens, zero deps)

Ouverte
#1,309 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
176k
Forks
20.9k
Merge moyen
7 h 21 min
PR mergées (30 j)
5

Description

## 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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.