$ ls ~/.claude/rules/*.md | wc -l → 17
/rules engine
Load-bearing rules survive every context compaction. Topic rules live in ~/.claude/rules/*.md and are linked from the umbrella CLAUDE.md. Each rule has a written lock date and is enforced by 0–2 hooks.
RULE -1 — No Downgrade / Constructive Only
On any problem: never just state it — return with a solution path.
RULE 0.2 — Rust First
Rust is the default. Other languages need an explicit architectural reason BEFORE writing code.
RULE 0.4 — No Hallucination / Citation Verify
Never fabricate numbers, links, or results. Not verified — say so.
RULE 0.5 — Plan Mode First
Non-trivial task → written plan BEFORE code. Approval → then Edit/Write.
RULE ZERO — Constructor Pattern
Cube = 1 file, 1 class, 1 pattern — self-contained, readable, reproducible.
KARPATHY — Karpathy Behavioral Primitives
Three primitives: Think Before Coding / Surgical Changes / Goal-Driven Execution.
RULE 0.6 — Observable Classification
Classify the observable as classical-noise vs amplitude-only BEFORE applying statistics.
RULE 0.7 — Manifold-SDE Tangent Sanity
Before committing an SDE drift on a manifold: verify the drift is not in the normal space.
RULE 0.8 — Secrets Single Source
Every token lives in ONE file: ~/.claude/secrets/.env (+ per-project secrets/*.env).
RULE 0.9 — Math-First Gate
Pure-theory experiments: ask "provable?" — if YES derive first, run ONCE to confirm.
RULE 0.10 — Recurrence Escalate
Same mistake ≥2× per session → invoke /escalate-recurrence skill (rule + wiki + hook).
RULE 0.12 — Agent Git Model
Every non-trivial Agent invocation = forked git branch + 6-file artefact bundle + ledger row.
RULE 0.13 — Orchestrator Branch First
Orchestrator owns branch + commits + push. Agent writes files only (sandbox denies Bash inside worktree).
RULE 0.14 — Session Self-Audit
Stop / milestone-commit / error-spike → kei-memory analyze + patterns → AskUserQuestion to triage.
RULE 0.15 — Sleep Layer
Nightly REM consolidation via cloud-agent trigger. A:incubation → B:REM → C:NREM (deep-sleep weekly).
RULE 0.16 — Shipped-vs-Functional Drift
STATUS-TRUTH MARKER agent footer + stub-scan hook + orchestrator pre-commit cargo gate.
guard — API Cost Guard
Pre-launch cost verification for Modal / AWS / GCP / fal.ai / Apify / ElevenLabs.