?
What exactly is a Claude Code hook?
A script Claude Code runs at a fixed point in its loop. A PreToolUse hook runs before a tool call and can refuse it. A PostToolUse hook runs after and can feed a problem back. A Stop hook runs when Claude thinks it's finished and can decide the turn isn't over. The hook receives a JSON payload on stdin describing what's about to happen, and its exit code decides what happens next. It's the difference between asking the model to follow a rule and enforcing it.
?
How is this different from putting rules in CLAUDE.md?
CLAUDE.md is instruction — it shapes what the model tends to do. A hook is enforcement — it runs regardless of what the model decided. If you tell Claude in CLAUDE.md not to commit secrets, it will usually comply. block-secrets.sh makes it structurally unable to. Use both: CLAUDE.md for conventions and taste, hooks for the handful of things that must never happen.
?
Which Claude Code version is this built against?
The contract was verified against Claude Code 2.1.232 by running live sessions with instrumented hooks and capturing the actual stdin payloads, exit-code behaviour, and matcher semantics — rather than transcribing documentation. The hooks use the long-stable core of the API (PreToolUse, PostToolUse, Stop; tool_name and tool_input; exit 0 and exit 2), so they are not tied to a narrow version window. If the contract changes, the pack is updated and you re-download.
?
Will these slow my sessions down?
The guardrails and observability hooks are pattern matches and a file append — the cost is not noticeable. Two hooks genuinely cost time because they run real commands: run-related-tests runs your test file after an edit, and typecheck-gate runs your typechecker before a turn can end. That's the point of them, but it is a real trade. Both have configurable timeouts, and the QUICKSTART recommends turning them on last, after the cheap hooks feel natural.
?
What happens if jq or a formatter isn't installed?
The hook exits 0 and does nothing. Every script in the pack degrades safely: a missing jq, formatter, test runner, typechecker, or notifier is treated as 'not my job today', never as a failure. A guardrail that breaks your session is worse than no guardrail. jq is the only thing you need for the guardrails to actually guard, so the QUICKSTART checks for it first.
?
Can I customise which paths and commands are blocked?
Yes, and you should. protect-paths reads a deny-list from .claude/protected-paths, one glob per line — point it at your production config. block-dangerous-shell takes your protected branch names. block-secrets takes an allowlist file of regexes for false positives. Every hook lists its environment variables in its own header comment, and every blocking hook has a warn mode that reports without refusing, so you can see what it would catch before you let it catch anything.
?
Do these work on macOS, Linux, and WSL?
Yes. Every hook is bash with jq and standard POSIX utilities. notify-on-finish detects its environment and uses notify-send on Linux, Notification Center on macOS, a toast on WSL, or the terminal bell as a fallback. format-on-write and run-related-tests use whichever tools you already have installed and skip the rest. Native Windows without WSL is not supported — the scripts assume a bash shell.
?
Are the guardrails a security boundary?
No, and the license says so plainly. They are a safety net that catches the common, expensive mistakes — a key pasted into a config file, a force-push to main, a DELETE with no WHERE. A determined bypass is always possible, and a pattern matcher will never catch every credential shape. Treat them as one control among several, not as your only defence around credentials or production systems.
?
Can I use these in client projects?
Yes. The commercial license covers unlimited use in your personal projects, internal company projects, and unlimited client work — and you can commit the hook scripts straight into the repos you build. The one thing you can't do is resell the pack itself or repackage it into a competing hooks pack, plugin, or course.
?
What if a hook misfires on my codebase?
Switch that hook to warn mode first so you're unblocked immediately, then narrow it — the header comment in each script explains its configuration. If it's a genuine pattern bug rather than a tuning issue, email hello@buycoded.com and we'll fix it and reissue. There's also a 14-day no-questions refund if the pack doesn't deliver.