Claude Code Hooks Cookbook — Testing skill for Claude Code
Copy-paste Claude Code hooks that actually do something — auto-format, block dangerous commands, test gates, notifications.
How to install Claude Code Hooks Cookbook
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open rongtnt/claude-code-hooks-cookbook and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Claude Code Hooks Cookbook does
Copy-paste Claude Code hooks that actually do something — auto-format, block dangerous commands, test gates, notifications. Dependency-free, current schema.
Alternatives in Testing
- Sentient — Test prompt to showcase claude code hook blocking a dangerous rm -rf command 3.4k ★
- Create Test Repo — Create a new ArcKit test repo with full scaffolding, auto-detecting the next version number 2.2k ★
- Spec Kitty — Spec-Driven Development for serious software developers 1.6k ★
README
Claude Code Hooks Cookbook
Copy-paste [Claude Code](https://code.claude.com) hooks that actually do something useful — auto-format on edit, block dangerous commands, notify you when a run finishes, gate on tests, and cut permission prompts. Every recipe is real, dependency-free, and current with the latest hook schema.
Hooks are shell commands Claude Code runs **automatically** at points in its loop — before a tool runs, after a file is edited, when a session starts, when the turn ends. They're how you turn "an agent that asks nicely" into "an agent that physically can't `rm -rf` your repo and always leaves the code formatted." Most examples online are stale; this repo tracks the current schema (the `if:` conditions, `permissionDecision`, `updatedInput`, and the full event list).
Quickstart
# drop the scripts into your project
git clone https://github.com/rongtnt/claude-code-hooks-cookbook /tmp/cc-hooks
mkdir -p .claude/hooks && cp /tmp/cc-hooks/hooks/* .claude/hooks/ && chmod +x .claude/hooks/*
Then add the recipes you want to `.claude/settings.json` (commit it to share with your team) or `~/.claude/settings.json` (all projects, just you). Restart Claude Code or run `/hooks` to reload. That's it.
`$CLAUDE_PROJECT_DIR` is set by Claude Code to your project root, so the paths below work from any subdirectory.
Recipes
| # | Recipe | Event | What it does |
|---|---|---|---|
| 1 | Auto-format on edit | PostToolUse |
Formats every file Claude writes |
| 2 | [Block dangerous commands](#2-block-dangerous-command |
Related Skills
Nereus
An opinionated development harness for Claude Code — interview → spec → TDD build → parallel review → finish,
Mda
MDA Open Spec — a Markdown superset for agent-facing documents. One .mda source compiles to drop-in SKILL.md,
Fia Harness
Local, dependency-free spec-driven development harness for AI agents: spec-first, machine-validated state and
Frontend Test Pattern Skill
Claude Code skill for React + Vite projects — auto-generates Vitest & Testing Library tests for utils, compone
J Debug
Systematic bug investigation — root cause analysis, not random fixes. Use when a test fails, a bug appears, or
Contract Version Bump
Classify and apply a version bump to a machine-readable contract (JSON Schema, API spec, config schema) — vers
Related Agents
Gantry Verifier
Runs the readiness gate. Use to execute the project's lint/test/build from its own .claude/gates.sh, the check
Content Designer
The Content Designer writes UX copy: button labels, headers, microcopy, empty states, error strings, push noti
App Tester
Builds and exercises Heron end-to-end on this machine — starts the dev app, starts and stops real claude CLI s