C4D Practice
← Browse by Chapter
#52Chapter 09 — Hooks: Safety Net and Automation
Before writing anything, read the hooks reference in the Claude Code documentation. Then write a Claude Code hook that [what it must refuse or do], as a script plus its entry in the settings file. Use only the field names, exit codes and JSON keys you found in the reference, and mark `[VERIFY]` on each one you could not find there. Then give me three inputs to pipe into the script: one it must refuse, one it must let through, and one with a Windows path. For each, give the exit code and the output it must produce.
Mastering Claude Code
Mastering Claude Code

These prompts are excerpts from the book. Get the full collection with explanations and use cases.

Get the Book →