Hooks: the part of Claude Code that runs without being asked
If you have ever typed "always run the formatter after you edit" into your project instructions, you wrote a hook and filed it as a prompt.
A prompt is a request. It competes with everything else in context and it loses sometimes.
A hook is a shell command the harness runs automatically, whether Claude remembers or not.
Auto-format after every edit,
Run the fast tests after every write,
Block any edit to .env,
Refuse a force push before it happens,
Log every bash command that ran in your name,
Ping your desktop when the session finishes 🔔
Five event types. One config file. Roughly ten minutes of setup.
I wrote the cookbook: 12 complete configs you can paste, plus the security section nobody writes, because a hook you copy from the internet runs on your machine with your permissions.
Free. No email wall.
Comment "HOOKS" 👇 and I'll send it to your DMs.