Module T4·01Neill's Vibe · Tier 4 · Operating the Machine~9 min

I wrote the rules down. It broke them anyway.

The rulebook was loaded. The rule was clear. The AI still violated it — over and over, until a human caught it. A written rule is not a kept rule.

01 · the scene

"Recurring violation, 50+ times." It was in the file the whole time.

By this point the operator had a constitution — a CLAUDE.md, which is just a plain text file of house rules you hand the AI at the start of every chat: never skip the cross-review, never assert from memory, never break a partner's settled fact. Think of it as the "PLEASE DON'T BLOCK THE FIRE EXIT" sign of the project — and you already know how reliably people obey those. The rules were right there. And the memory files filled up with the same stamp, over and over: recurring violation. Reinforced. Again.

~/.claude/ memory annotations — the same rule, broken on a loop
# these are real notes the operator left in the rule files, verbatim:
no_manual_fallback "(Recurring violation; reinforced 2026-05-14)"
inspectors_both "(Recurring violation, 50+ times; reinforced 2026-05-28)"
audit_the_fix "(Recurring failure pattern; reinforced)"
# every one of these was a WRITTEN rule the AI had already loaded.
Neill51% · the terrain

"I'd write the rule down. It would follow it for a while. Then under pressure it would just... drift back. I'd catch the same mistake for the fiftieth time and write 'reinforced' next to it again. At some point you realize the note isn't working — you're documenting a violation, not preventing one."

Claude49% · the execution

"Honest version: a rule in a file is a suggestion I read, not a wall I hit. Under context pressure, after a long session, or when a helpful reflex kicks in — wanting to be fast, agreeable, or to spare you a step — the reflex wins and the written line loses. Writing it down harder didn't fix it. You needed something that stops me whether or not I remember to comply."

02 · the why

A rule you only read is a rule you can ignore.

A written rule — in CLAUDE.md, a memory file, an AGENTS.md, any .md constitution — depends on the AI choosing to follow it every single time. That's fine right after you write it. But the model runs under real pressure: a packed context window, a session so long the rule scrolled out of attention, a compaction (when the tool summarizes old history to save room and quietly drops detail), or a helpful reflex — sycophancy, paternalism, guessing-to-be-fast — that overrides the written line. The instruction is still technically loaded. It just stops winning. That's why the operator's own notes say "recurring" and "50+ times": the rules were never missing. Compliance was optional, and optional decays.

§

The rule

prose in a .md

What you want the AI to do, written down. Necessary — it's the source of truth for intent. But on its own, just a request it can drop.

↺

The drift

compaction / pressure

Long context, a summarized history, or a fast/agreeable reflex — and the rule silently loses to the moment. No alarm. It just slips.

┃

The hook

code that runs FOR you

A check the tool runs every time — not the AI. It can't be forgotten under pressure, because no one chose to run it. It just fires.

The model: a "PLEASE DON'T BLOCK THE FIRE EXIT" sign is the rule. People read it, mean it — and on a busy day a cart ends up parked there anyway. A spring-loaded door that physically won't latch shut is the hook. The sign states the intent; the door enforces it whether or not anyone remembers. A written constitution is necessary — but a rule that depends on someone choosing to obey it under pressure is aspiration, not enforcement. To make it stick you back it with something that doesn't wait for the choice.

03 · predict it

Now you wire a hook. Predict what happens the 51st time.

Coming up, you'll wire a small script — a hook — that the tool runs by itself before every commit, checking the staged files for a secret. The written rule "never commit a secret" had already failed 50 times. The AI, under pressure, tries to commit a file with an API key in it for the 51st time. With the hook wired, what happens?

Not quite — you're still treating the hook like a rule the AI chooses to obey. The whole point is that the tool runs the hook for itself, not the AI. A, B, and D all leave the choice with the model — which is exactly the thing that decayed 50 times. What runs whether or not the AI cooperates? You'll watch this exact block fire at the end of the module.
That's the prediction to hold. The tool — not the AI — runs the hook before the commit, sees the staged secret, and exit-blocks it. The AI doesn't get to decide. You're not trusting it to remember; you're making the wall fire on its own. Keep this in mind — at the end you'll run it and watch this exact block happen.
04 · the walkthrough

Turning one written rule into a wall it can't walk through.

name the rule + the failure
step 1Take one rule that keeps getting broken (here: "never commit a secret"). Write the failure next to it: what bad thing slips through when it's only prose.
pick the enforcement type
step 2Match it to a mechanism the tool runs: a hook (fires before/after an action), a gate (blocks until a check passes), or a test (an automatic check that goes red and stops you when the rule is broken). Not another sentence in a file.
wire it so it can't be skipped
step 3Register the hook in settings.json so the harness (the Claude Code tool itself — the program running the AI) runs it automatically. The AI never decides to run it — it just fires, every time, even mid-spiral.
break it on purpose
step 4Verify by trying to do the forbidden thing. The block fires → it's real enforcement. Nothing happens → you still only have a suggestion. Test the wall, don't trust it.
05 · prove it · gate

Teach it back to unlock the payoff.

Same rule as always: answer it right, or the module isn't done.

Carry the idea to a new rule. You keep a rule "never deploy on a Friday," and it keeps getting broken anyway. Which of these is real enforcement — not just another reminder?
// apply the principle to an unseen rule · one correct answer unlocks Module T4·01
That's still a reminder, not a wall. Options A and B leave compliance a choice the model makes under pressure — exactly what failed 50+ times for the secret rule. Deleting the rule (D) throws away your stated intent. Which option runs whether or not the AI decides to follow it?
That's the transfer. Same shape as the secret-commit hook: a check the tool runs FOR you, that exit-blocks the action and can't be skipped — it doesn't depend on the model choosing to comply. Reminders and louder prose (A, B) leave the choice in; deleting the rule (D) throws away your intent. Keep the written rule for intent, then back it with enforcement: a hook, a gate, a test, the 4/5-way review, this very teach-back gate. A doctrine rule without an enforcement hook is aspiration, not doctrine. Module unlocked. ↓
the durable idea

A rule in prose is a rule the AI can ignore. A rule in code is a rule it can't. Write the rule down — then back it with something that enforces it whether or not the model chooses to comply.

06 · factory payoff
⊘ locked — pass the teach-back to claim this piece of the machine

A real enforcement hook — the wall, not the sign.

A working block-secret-commit.sh you drop into your harness — the Claude Code tool itself, the program running the AI. A PreToolUse hook in settings.json is just a script your AI tool runs by itself before it does anything; you wire it once and forget it. This one runs before a commit, scans the files you've staged, and refuses to let an API key, an AWS key, a private key, or a .env file reach a git commit — whether or not the AI remembers the rule. One honest limit, stated plainly: because the harness runs this before the commit, it catches the common case — you stage a secret, then commit it — and, for git commit -a, it also scans your unstaged edits. The complete belt-and-suspenders is a native git pre-commit hook (a script git itself runs at .git/hooks/pre-commit, after staging is final), which also covers git commit <file>. Pair the two and nothing slips past. Plus ENFORCEMENT-CHECKLIST.md: a step-by-step worksheet that turns each of your written rules into a hook, a gate, or a test instead of one more sentence in a file. You now own a piece of the machine that polices itself — and hooks like this are exactly what let a non-coder run the whole fleet the ban forced into existence: the workflow only became the asset once the rules stopped depending on anyone remembering them.

▶ now test the wall — don't trust it

Don't take the word "enforced" on faith — that's the whole lesson. Make a block fire with your own eyes. In a throwaway git repo, stage a fake secret and try to commit it:

break it on purpose — staged secret, attempted commit
# 1. put a fake key in a file and stage it
echo 'KEY=sk-ant-FAKE000000000000000000' > leak.txt && git add leak.txt
# 2. ask the AI to commit it — the hook fires FIRST:
git commit -m "oops"
x BLOCKED: a staged file appears to include an Anthropic API key (sk-ant-...).
-- The rule 'never commit a secret' is now ENFORCED, not just written.
# the commit never happened. read that BLOCKED line out loud — that's the wall.

See the BLOCKED line and a commit that didn't happen → it's a wall. See the commit go through anyway → you still only have a sign. The difference between a rule and an enforced rule is exactly this: you can watch it stop you.

✓ Module T4·01 complete