Tick the guardrails you want, get a valid .claude/settings.json. No signup, nothing stored.
your-repo/
└── .claude/
└── settings.json <- paste here (checked in, shared with your team)
Use .claude/settings.local.json instead for hooks you don't want to commit. Both are merged; local wins.
A shell command Claude Code runs at a fixed point in the loop. It receives a JSON blob on stdin describing the event — which tool, which arguments — and its exit code decides what happens next:
exit 0 — allow, carry on.exit 2 — block the tool call. Whatever the hook wrote to stderr is shown to Claude, so it can correct itself.That exit-2 path is the whole point: it is the only way to make a rule Claude cannot talk itself out of. A line in CLAUDE.md is a request; a hook is enforcement.
PreToolUse — before a tool runs. The only place you can block.PostToolUse — after it succeeds. Formatters, linters, type checks.UserPromptSubmit — on every message you send. Inject context.Stop / SubagentStop — when the turn ends. Test suites, notifications.SessionStart / SessionEnd — bookend a session.Notification — Claude is waiting on you.PreCompact — before context gets summarized.The matcher field is a regex against the tool name, so "Edit|Write" catches both and an absent matcher catches everything.
These recipes are the safe subset. The $29 pack ships three complete presets — TDD guard, CI agent, safe defaults — plus a walkthrough of what each event actually fires on, five subagents and 30 workflow recipes.
Free tools: CLAUDE.md generator · Hooks / settings.json builder · Free 4-file sample
Claude Code Power Pack v1.0 · Home · I already paid
Not affiliated with Anthropic. “Claude” and “Claude Code” are trademarks of Anthropic, PBC.
Questions or refund: [email protected]