You leave Claude Code running while you do something else. You come back and something is gone. That is the moment this manual is written against.
Hooks can stop the common ways it happens: a recursive delete, a hard reset, a secret going into a commit. Installing them takes about thirty seconds. But an installed guard and a working guard look identical from the outside, and almost nobody checks which one they have.
This is the short version of that check.
Chapter 1 — the pre-flight checklist. Four stages you can copy into your project: before the first session, before letting it run unattended, during, and after.
Chapter 2 — measure before installing. The audit is read-only. Nine findings on an empty project is a baseline, not a crisis; what matters is which of them are still there a week later.
Chapter 3 — what the guards actually refuse. The block messages, taken from the shipped hook definitions rather than from the documentation, followed by a section on what a hook cannot see at all.
Chapter 4 — prove they fire. Feed a guard the input it is supposed to refuse, and watch what comes back.
Chapter 5 — the npm package is the wrong one. It is frozen at 29.8.0 and lets three destructive commands through that the current code blocks. The obvious install command is the one that gets you that version.
Chapter 6 — after the session. An empty log of blocked commands means either that nothing dangerous was attempted or that nothing is matching, and from the outside those look the same.
Every command output printed in this book was run against a clean sandbox before publication, failures included, because a check that cannot fail is not a check.
It is the companion to cc-safe-setup, an MIT-licensed tool, and everything in it is also in that repository. You are not paying for secrets — and at a minimum price of zero, you are not paying at all. What you get is the parts that matter, in the order you need them.
What it is not: a guarantee. A hook sees one tool call at a time; it does not see intent. Chapter 3 says where the floor ends. If you want a book that tells you your agent is now safe, this is not that book.