Get the free Hooks Playbook (all 7 configs, copy-paste ready)
Hooks are the closest thing to real automation the AI world has shipped, and most Claude Code users have never touched them. A hook is a tripwire: pick one of 30 moments in Claude Code's lifecycle, attach a shell command, and it runs every single time — not a CLAUDE.md suggestion the model can forget, but law. This playbook contains the SEVEN HOOKS I built and fired for real on my machine, copy-paste ready: THE AUTO-FORMATTER (PostToolUse + prettier — every file Claude edits comes out clean, 12 seconds from prompt to formatted file in our live run), THE BODYGUARD (PreToolUse guard that physically blocked rm -rf, a force push, and a .env secrets read — three direct orders, three denials, with the block reason fed back to Claude), THE PHONE PING (Stop + Notification events piped to free ntfy.sh push notifications — your phone buzzes when Claude finishes, no account, no API key), THE SELF-CHECKER (tests run after every code edit; failures are shoved back into Claude's face via exit code 2 — in our sabotage experiment Claude broke add(), saw the AssertionError, and fixed its own bug in 5 seconds), THE BLACK BOX (one audit line per tool call — timestamp, tool, target — so 'what exactly did the AI do' becomes a file you read), THE CONTEXT INJECTOR (UserPromptSubmit prints your git branch, dirty-file count and last commit into every prompt — our tools-disabled test session still answered all three correctly), and THE AUTOPILOT (all six at once: one task ran 47 seconds hands-off — formatted twice, tests 4/4 twice, one rm -rf blocked cold, full audit trail, phone ping at the end, zero interventions). Plus the FULL 30-EVENT CHEAT SHEET (SessionStart to PreCompact to SubagentStop — most devs use two of these), the INSTALL ANATOMY (one settings.json file, three pieces: event, matcher, command — plus the /hooks verification habit and the restart-after-editing gotcha), and the 3 SAFETY RULES, because a hook's command field is arbitrary shell running with your permissions forever — never paste one you haven't read.
Free. No spam. Unsubscribe anytime.