filesnfolders.com
Est. 2006 · Still just text
The rule that doesn't forget

Claude Code Hooks: the rule that runs itself.

Every page about Claude Code hooks is written for somebody formatting code. You're not formatting code. You're an agency owner who keeps catching the same mistake by eye. A hook is the one part of the .claude folder that exists because instructions get forgotten.

The short answer

A hook makes something happen at a fixed moment, without the AI deciding to do it. You pick the moment. Before it edits a file. After it edits a file. When it stops working. Anthropic's own reference lists every moment available, and you'll use 1 of them.

Here's the part that matters, and it's the only sentence you need.

Instructions are a request. A hook is a rule.

You can write "never do X" into a file the AI reads. It'll read it. It'll follow it most of the time. Then it'll have a long session. The file falls out of view. It does X anyway.

A hook doesn't read anything. It just runs. That's why it exists, and it's the honest reason it was ever built.

The 2 I actually run

I have 2 hooks on my business. I counted them before I wrote this. Both fire at the same moment, when the work stops. Neither one has anything to do with code.

The first one reads for a price. I have prices that aren't final yet. A price landing on a public page before I've decided it is a real problem with a real cost. So a check runs when the work stops. It reads what was just written. If a price of mine shows up somewhere the public can see it, I hear about it while I'm still sitting at the desk.

The second one reads for my own voice. I have a list of words I don't say and punctuation I don't use. That list got broken over and over. It happened on pages that were about to go to real people. The AI knew the rule. It forgot the rule under load. Now a check runs on the words themselves. It doesn't rewrite anything. It tells me what it found.

Both of those are business rules, not technical ones. Neither would appear on any list of the 50 best anything you'll find for this tool. The people writing those lists have a different job than you do.

Claude Code hooks and when they run: before a file is edited, after a file is edited, and when the work stops, with the price check and voice check firing on stop

What most guides get right and skip past

The developer pages will tell you 3 things a hook can do. Auto-format your files. Block a dangerous command. Send you a notification when a long job finishes. All 3 are true. The notification one is worth having if you walk away from the machine.

What they skip is when you should reach for a hook at all, and the answer is narrower than it looks.

Most rules do not need one. A rule the AI can read at the start of the job belongs in the map file. It costs nothing there. It's easy to change there. That's where 9 out of 10 of your rules go, and I've written about where rules actually belong at length.

A hook is for the rules where forgetting once costs you something you can't take back.

When an agency owner needs one

Say you run a 6 person web design agency. Your AI drafts client proposals. You have 1 rule that cannot break: no proposal goes out with a number in it that you haven't signed off.

Written into a text file, that rule holds until the day it doesn't. Written as a hook, it runs on every draft. It runs whether anybody remembered it or not.

That's the trade. A staffing agency has the same one. Their rule is that a candidate's name never leaves the folder. A media buying agency has it too. Their rule is that a client's spend never shows up in a shared doc.

You may hear people call this deterministic control. It means the check happens whether or not the AI is having a good day.

One rule. One moment. That's the size of it when you start.

How to know it's time

You don't need a hook on day 1. You need the folders first, because a rule about work that isn't filed anywhere has nothing to guard.

The signal is simple, and it's the same one that made me build both of mine. You catch the same mistake twice by eye. Not a mistake, the same one. That's the moment the rule stops being an instruction and starts being a rule.

I got there the hard way. Both of my hooks exist because a rule I had already written down got broken anyway. In front of me. On something real. I built the check afterwards, which is the only order this ever happens in.

If you want the folders handed to you named and ready, that's the free kit. It's the working copy of Jake Van Clief's Interpretable Context Methodology (ICM), his arrangement, run by me in public.

The free kit

The kit is 6 files. It takes 20 minutes. A start page. A map. A desk file. The folder skeleton. A setup sheet. A list of what to cancel. No card. No call. No course to buy.

Send me the folder system

Semper Fi,

RyMac

Ryan “RyMac” McKinney · USMC · more about me