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

A hook is the automation the harness runs for you.

You keep forgetting to run the check. A hook never forgets — it fires whether or not anyone remembers. This is the machine underneath "rules don't enforce themselves."

01 · the scene

"I'll remember to check next time." You won't. Neither will the AI.

There was a rule the operator believed in: at the start of every work session, read the project's running log so you don't redo or undo what got done last night. Simple. Sensible. And forgotten constantly — by the human in a hurry, and by the AI whose memory is wiped clean every session (each new chat starts from zero; it remembers nothing you didn't write into a file it reloads). A "remember to do X first" rule depends on someone choosing to remember X — and the one thing you can rely on is that, under pressure, nobody does. The check that only happens "when I remember" is the check that quietly stops happening.

a session that skipped the catch-up read — and stepped on last night's work
# new session. the rule said: read LOGS.md first. nobody did.
you > let's refactor the pipeline, fresh start
# the AI's memory is wiped each session -- it has no idea what shipped last night.
x undid a fix that landed at 11pm -- re-broke a thing already closed.
x the log that would have warned us was right there, unread.
# the rule existed. the READING of it depended on remembering. we didn't.
Neill51% · the terrain

"My rule was: every session, catch up on the log before touching anything. I meant it. And I'd skip it half the time because I was already typing the thing I came to do. The cost wasn't abstract — I'd undo work from the night before because neither of us had read what happened. I didn't need a louder reminder. I needed the catch-up to just happen without me deciding to do it."

Claude49% · the execution

"And my side is worse: I start every session blank. If you don't hand me the log, I can't 'remember' to read it — there's nothing to remember from. A rule that says 'the AI should read the log first' is asking the forgetful party to police the forgetting. The fix isn't asking harder. It's making the tool shove the log in front of both of us the instant the session opens — before either of us gets a vote."

02 · the why

A hook is run by the tool, not chosen by the AI.

Here is the one idea of this module. The program you run the AI inside of — call it the harness (for us, that's Claude Code, the app that wraps the model and actually executes things) — can be told: "at this exact moment, run this little script, automatically." That standing instruction is a hook. You list it once in a settings file, and from then on the harness fires it at the moment you named — at session start, or before a tool runs — with no decision from the AI at all. That's the whole difference from a written rule. A rule says "please do X" and waits for the AI to choose to. A hook just does X, the same way every time, because the tool — not the model — is the one running it. The AI can't forget a hook any more than a turnstile can forget to turn: nobody chose to run it, so there's nothing to skip.

◴

The moment

SessionStart / PreToolUse

A named instant the harness watches for: a session opening, or right before a tool fires. You pick which moment the hook hangs on.

⚙

The harness

Claude Code, not the model

The program running the AI. It fires the hook at that moment — automatically, every time. The AI is never asked and never decides.

▸

The script

a tiny command

What runs: print the log, scan the staged files, block a bad command. Plain output or an exit code the harness reads and acts on.

The model: a written rule is a sticky note on the fridge that says "take your keys." A hook is a lock that won't let the door shut unless the keys are in your hand. The note depends on you reading it and choosing to obey on a chaotic morning; the lock just acts, every single time, whether or not you noticed the note. SessionStart = the lock checks the moment you reach for the door (the session opens). PreToolUse = it checks right before the door actually swings (a tool is about to run). Either way the machinery moves for you. That is why a hook is the enforcement underneath the rule: the rule names what you want; the hook is the part that doesn't wait for anyone to remember.

03 · predict it

You wire a SessionStart hook. Predict what you see next session.

Coming up, you'll add one line to settings.json telling the harness: "at SessionStart, run a script that prints the last few lines of the project log." You wire it, close the chat, and open a brand-new session tomorrow — without thinking about the log at all. What appears?

Not quite. A and B keep the AI in the loop — choosing whether or when to read the log; D leans on a memory that's wiped every session. The whole point of a hook is that the harness runs it with nobody choosing. Which option has the log already on screen the instant the session opens?
Right. The harness fires the SessionStart script by itself the moment the chat opens — the log is on screen before you or the AI does anything. Nobody chose to run it, so nobody can forget to. That's a hook.
04 · the walkthrough

Hanging one small script on a moment the harness already watches.

pick the moment
step 1Choose when the harness should act. Two you'll use most: SessionStart (a new chat opens) and PreToolUse (right before a tool — like Bash or Edit — runs). The moment is the trigger.
write the tiny script
step 2Write the one thing to run at that moment. For SessionStart: tail the last lines of LOGS.md (print the end of the log file). For PreToolUse: scan what's about to happen and, if it's forbidden, exit 2 to block it (exit 2 is the one that blocks; any other non-zero only warns and the action still runs).
register it in settings.json
step 3Add the hook to settings.json under hooks, keyed by the moment. This is the one wiring step: from now on the harness — the Claude Code tool itself — runs your script at that moment. The AI never decides to.
open a fresh session + watch
step 4Start a new chat and look. The log's last lines are already there — you ran nothing. That's the proof a hook is the tool acting for you, not a rule the AI chose to obey.
05 · prove it · gate

Teach it back to unlock the payoff.

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

In one clean line: what makes a hook different from a rule you wrote in CLAUDE.md — and why does that difference make it stick?
// restate the concept on an unseen case · one correct answer unlocks Module T4·F33
Not yet — every wrong answer still leaves the AI choosing. A and B treat the hook as a rule the model reads and obeys (just harder); D imagines it fixing the model's wiped memory. The whole point is the opposite: the harness runs the hook, so the forgetful party (the AI, and you) is taken out of the loop entirely. Which option has the tool, not the model, doing the running?
That's it stated cleanly. A hook isn't a louder rule or a better memory — it's the harness running a script for you at a named moment, with the AI never asked. It sticks precisely because no one chose to run it: there is nothing to forget. That's the machine under "rules don't enforce themselves" — the rule names the intent, the hook is the part that fires whether or not anyone remembers. Module unlocked. ↓
the durable idea

A hook is automation the harness runs for you, not a request the AI chooses to honor. The rule says what you want; the hook is the part that happens without anyone remembering.

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

A starter SessionStart hook — the catch-up that runs itself.

A working session-start-log.sh you drop into your harness — the Claude Code tool, the program running the AI. A SessionStart hook is a script the harness runs by itself the instant a new chat opens, and whatever it prints lands in the AI's context — so this one prints the last lines of your project's LOGS.md at the top of every session. Save it where the wiring expects it — ~/.claude/session-start-log.sh (it downloads to ~/Downloads, so move it there: mkdir -p ~/.claude && mv ~/Downloads/session-start-log.sh ~/.claude/) — then wire it once in settings.json; from then on the catch-up read happens whether or not you or the AI remember it. No more stepping on last night's work because nobody read the log. One honest limit, stated plainly: a SessionStart hook surfaces the log so it's in front of you both — it does not force anyone to act on it (that's a different mechanism — a blocking PreToolUse hook, which exit-blocks an action; you saw that flavor in the secret-commit module). This hook removes the remembering, not the judgment. Plus HOOK-MOMENTS.md: a plain-language map of which moment to hang a hook on — SessionStart vs PreToolUse vs the others — and what each one can and can't do. You now own a piece of the machine that catches you up on its own — and small hooks exactly like this are what let a non-coder run a whole fleet: once the routine stops depending on anyone remembering, the workflow becomes the asset the ban forced into existence.

▶ now prove it fires — don't trust it

Don't take "runs automatically" on faith — that's the whole lesson. But the first time, you'll almost certainly get the wiring slightly wrong. That's fine — it's a one-line fix, and watching it fail then fire is how you learn to trust it. Try it: wire the hook, but point LOGS_FILE at a path that doesn't exist (a typo, the wrong project). Open a fresh session:

first try — path typo'd, so the catch-up has nothing to show
# fresh session. the hook DID fire -- but you pointed it at the wrong path:
[SessionStart hook] no log found at: ~/Drive/.../projcet/LOGS.md
[SessionStart hook] edit LOGS_FILE in session-start-log.sh to point at yours.
# NOT a silent failure -- the hook said exactly what's wrong. one edit fixes it.

Notice the hook didn't crash or vanish — it fired and told you the path was wrong (that's the exit 0 + plain message in the script, on purpose). Fix the one line — correct the path — re-open the session, and now it catches you up for real:

a fresh session — the hook fired before you typed a word
# you open a new chat and type NOTHING yet. the harness ran the hook on its own:
[SessionStart hook] catch-up: last 30 lines of LOGS.md
------------------------------------------------------------
## 2026-06-29 -- last session
- shipped the pipeline fix at 11pm; do NOT refactor it again
- in-flight: waiting on the cross-review before merge
------------------------------------------------------------
[SessionStart hook] read this BEFORE touching anything -- it may undo last session.
--> the log is on screen and you ran nothing. that's the hook.

See the log at the top of a session you just opened, having typed nothing → the harness ran it for you. See a blank screen waiting for you to ask → it's not wired, and you're back to remembering. The difference between a rule and a hook is exactly this: you can watch it happen without choosing to.

✓ Module T4·F33 complete