Skip to content
The Daily Repo

Claude Code hooks: open-source examples and tools (2026)

Our pick

Start with CC Safety Net if you want a hook that stops Claude Code from running destructive commands. One command installs it (npx -y cc-safety-net@latest install), it is MIT licensed, and it blocks things like git reset --hard, git push --force and rm -rf on dangerous targets, plus access to .env files and SSH keys, before the tool call runs. The table shows how the other hook tools compare.

Best for

The repos compared

Checked on Nov 27, 2026: the oldest day any repo in the table was last read from GitHub.

Claude Code hooks: open-source examples and tools (2026): repos compared
RepoStarsLast commitLatest releaseLicenceNeeds
kenryu42 / cc-safety-net

Blocks destructive commands and access to secrets before an agent's tool call runs.

2,148
GitHub (opens in new tab)
Active Dec 1, 2026v2.9.0, Nov 28, 2026MIT
FailproofAI / failproofai

Policy enforcement and run tracking for coding agents, built on their hook events.

10,487
GitHub (opens in new tab)
Active Dec 1, 2026v1.0.18, Dec 1, 2026Custom
alexfazio / plankton

Runs formatting and linting on every file edit Claude Code makes, using hooks.

380
GitHub (opens in new tab)
Inactive Mar 8, 2026-MIT
heardlabs / heard

Reads your agent's progress aloud when it finishes, fails or needs approval.

793
GitHub (opens in new tab)
Active Nov 28, 2026v2.0.16, Nov 8, 2026Apache-2.0
shanraisshan / claude-code-hooks

Example hooks that play a sound on Claude Code events, with a changelog of hook events.

575
GitHub (opens in new tab)
Active Jun 4, 2026-MIT
sangrokjung / claude-forge

A Claude Code setup that bundles agents, commands, skills and safety hooks in one install.

888
GitHub (opens in new tab)
Active Sep 3, 2026v4.1.0, Aug 25, 2026MIT
W17ant / Claude-Office

A pixel-art office that shows Claude Code agents at work, fed by hooks and the status line.

428
GitHub (opens in new tab)
Active Nov 18, 2026v1.3.0, Nov 16, 2026MIT

Install commands

Copied from each repo. Read its setup steps before you run anything.

kenryu42/cc-safety-net

npx -y cc-safety-net@latest install
npx -y cc-safety-net@latest doctor

FailproofAI/failproofai

npm install -g failproofai
failproofai config
# hook your agents, connect to Failproof Cloud (free)
failproofai backfill --since 7d
# bring in the last week of runs already on disk

Questions

What are Claude Code hooks?

Hooks are commands or other handlers you configure to run automatically at set points in a Claude Code session, such as when a session starts, a prompt is sent, a tool is about to run or has run, a subagent starts, context is compacted, or the agent stops. A hook that runs before a tool call can block that call, which is how CC Safety Net stops a destructive command.

What are good examples of Claude Code hooks?

CC Safety Net blocks destructive commands before they run. Plankton formats and lints each file Claude Code edits. Heard speaks a summary when the agent finishes or needs approval. The shanraisshan/claude-code-hooks repo is a runnable example that plays a sound on each hook event.

Do these hooks only work with Claude Code?

No. CC Safety Net supports Claude Code, Codex, Cursor, OpenCode and other coding CLIs. FailproofAI works with Claude Code, Codex, Cursor, Hermes, OpenClaw and more. Heard covers Claude Code and Codex. Plankton is built on Claude Code hooks and does not support Windows.

Where can I find more hooks to copy?

Claude Code Templates is a catalog and CLI that lists hooks next to agents, skills and settings, and installs a hook by name. Claude Forge is a Claude Code setup that ships a set of safety hooks together with agents, commands and skills.

More

Type to search.

Try