← patterns

Rules that survive

A written rule for agents does not survive on its own. Sessions repeat the mistake while remembering the rule; you can watch one acknowledge the rule and do the thing anyway, because prose loses the fight against a model’s priors. The pattern that holds replaces prose with records that carry their own enforcement: a fixed anatomy, a runnable verify line, and a path from incident to hook. What follows is that anatomy; a measured rule of mine lasted 67 minutes as plain prose before a fresh session broke it.

The moving parts

Decision records are entries with seven fields, not essays:

## D-035 — 2026-08-02 — Stage explicit paths only, never add-all
**Decision:** one imperative sentence, no hedging.
**Why:** written for a stranger with no transcript.
**Invariant:** the line that must stay true for the rule to hold.
**Boundary:** the condition under which this rule stops applying.
**Rung:** law or practice, how hard it binds.
**Verify:** `grep -rn "git add -A" hooks/ scripts/` → nothing
**Scope:** which projects the entry covers.

Two fields do most of the work.

Why is written for a stranger with no transcript. Not “as discussed”, not a summary of a chat that no longer exists. If the reason cannot stand alone, the next session relitigates the decision and probably wins.

Verify is a runnable command with an expected output. A rule you can only read is checked by luck; a rule you can execute is checked by machines, on schedule, forever. When an entry drifts from reality, decay surfaces as a failing check instead of a surprise, and the fix is a one-line commit.

Rules graduate along one path, and the path is the system:

incident, noted where it happened      cheap, unstructured
        │  happens again

countable pattern                      a count, not a feeling
        │  graduates

record entry: invariant + verify       law
        │  wired into

hook that blocks instead of advising   enforcement

Skip the middle and you get rules nobody believes. Skip the end and you get beliefs nobody follows.

When it applies

  • You keep a rules or mistakes file for agents (the CLAUDE.md class) and rules still get broken by sessions that never lived the incident.
  • The same correction is being re-explained to every fresh session.
  • A rule’s truth can decay silently as the repo changes, so checking must not depend on anyone remembering to check.
  • It does not apply to taste or context the owner must judge case by case; that is what the Boundary field is for, and some rules never graduate to a verify line.

Bloat is the default outcome in the agent era: models write more than anyone reads, and a 3000-word decisions document is prose with a fancier name. The counterweights are mechanical. Index lines have a character budget and a hook rejects the commit that exceeds it. Files have word budgets checked on a schedule. A fact lives in exactly one document, and a decision recorded twice is treated as a defect, because two copies always drift.

- A rule you can run outlives the session that never read it.

The 67-minute rule, the auditor that checks claims against the repo, and the enforcement story are the rules’ own piece.

carried by Rules my agents actually follow