← Browse by Chapter
Get the Book →
#54Chapter 09 — Hooks: Safety Net and Automation
Read the hook configuration that applies to this session: my user settings, this project's settings and local settings, and the skills and plugins they enable. For each hook on a tool event, propose one harmless action that must trigger it and one that must not, perform them one at a time, and after each one read the debug log at [the path from --debug-file or /debug] and tell me whether the hook fired and how it exited. For a hook whose job is to refuse something, do not attempt that thing: give me an input to pipe into its script instead, with the exit code it must return. For a hook on any other event, such as Stop or SessionStart, tell me how to trigger it and what to look for, and I will check it myself.

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