Free book · 33 pages · PDF
The Claude Code Safety Kit
Put a human in front of the write, in about ten minutes
A coding agent will run a destructive command without asking, because the two steps that touch your files have nobody in them. This is a short book about one control that fixes that: a hook that sits in front of the write, refuses the few commands you can't take back, and hands them to you to run yourself. It is about ten lines of configuration and a script short enough to read in full.
Get the PDF
Leave your email and I’ll send you the next one, plus anything I publish on running agents in production. Nothing else, and one reply unsubscribes you.
No thanks — just download it · 1.6 MB PDF
What is in it
- 1 The loop with nothing in front of it An agent’s loop has two human checkpoints and they are both in the wrong place.
- 2 The gate A pre-tool-use hook, a twenty-line script, and what belongs behind it.
- 3 The file the agent actually reads Why most CLAUDE.md files describe when they should instruct.
- 4 The ten-minute audit Fourteen checks against a repository an agent is already working in.
Honest notes
- Hook configuration changes between releases. Where a detail depends on a vendor’s current release rather than on the shape of the idea, the book says so and points at their documentation.
- Read every script before you run it. They are short on purpose.
- Found something wrong or stale? Tell me and the next version will say so.
Errata
Fixed in version 0.2 (November 2026). If you downloaded 0.1, these are the changes that matter:
- The hook settings now set
"onFailure": "block"(Claude Code 2.1.295 or later). Without it, a renamed, missing or timed-out script lets the command go on to the normal permission flow, so the "rename the script and confirm you are refused" check would not refuse. A live test in Claude Code 2.1.312 confirmed both behaviours. - The gate script now refuses a newline or a single
&between commands, which 0.1 let through. - The delete and force-push rules match flags, not one spelling:
rm -Rf,rm -r -f,git push -fandgit push origin +mainare now refused. The SQL rule is case-insensitive, andfind -deleteis refused. - The audit chapter counts its fourteen checks consistently.
- The last page describes the paid companion actually in preparation, which is narrower than the one 0.1 described.
The figures are drawn by the same code that draws the explainer videos, so a figure in the book and the shot in the video cannot drift apart.