Hooks
settings.json hooks that run shell commands on Claude Code lifecycle events.
- Auto-format on edit formattingprettierposttooluse
A PostToolUse hook that runs your formatter (Prettier/Black/gofmt) on every file Claude edits — so you never review unformatted diffs.
settings.json → hooks.PostToolUse - Block edits to secret files securitysecretsguardrail
A PreToolUse hook that denies any read or write to .env, credentials, and key files — a guardrail against leaking secrets into context or commits.
settings.json → hooks.PreToolUse - Notify when Claude finishes notificationstopproductivity
Fires a desktop notification when Claude stops — so you can switch tasks during a long run and get pulled back when it's done.
settings.json → hooks.Stop