Prompts tagged "hooks" in the PromptCraft library.
A PostToolUse hook that makes Claude Code automatically run a formatter (Prettier/Black/gofmt) plus a linter every time it edits or writes a file—permanently removing 'inconsistent formatting' as a code review chore.
A PreToolUse Bash hook that intercepts destructive commands like rm -rf, fork bombs, and curl|sh before the AI executes them—a last line of defense that holds even against --dangerously-skip-permissions.
A Stop hook that fires a desktop notification and plays a sound the moment Claude Code finishes running. You can freely switch to other windows—the AI will call you back when it's done, no need to keep staring at the terminal.
After Claude Code removed its built-in output style feature, this uses a SessionStart hook to automatically inject a custom response style (tone / format / rules) into every session, with a local marketplace for managing, activating, and applying multiple styles.
Uses hooks in .claude/settings.json to automatically run formatting, linting, type-checking, or tests at specific Claude Code lifecycle events (PostToolUse after an edit, PreToolUse before running a command, Stop when wrapping up)—producing correct JSON config plus an executable hook script, with exit code 2 hard-blocking dangerous actions.