Safety hooks for Claude Code that block destructive operations at the tool boundary and surface silent failures.
SKILL.md
--- name: cc-safe-setup description: Safety hooks for Claude Code — 700 pre-built hooks that prevent file deletion, credential leaks, git disasters, and token waste during autonomous AI coding sessions. 9,200+ tests. Install with npx cc-safe-setup. --- # cc-safe-setup Safety-first configuration for Claude Code. Prevents the accidents that happen when AI writes code autonomously. ## What it does Installs pre-built safety hooks into your Claude Code environment. These hooks run automatically before/after tool calls to block dangerous operations. **Categories:** - **File protection**: Block `rm -rf`, prevent overwriting files outside project - **Git safety**: Prevent force-push to main, block `reset --hard` - **Credential guards**: Stop `.env` files from being committed or read by AI - **Token optimization**: Warn on large file reads, limit subagent spawning - **Quality gates**: Detect lazy rewrites, verify claims before committing ## Quick start ```bash npx cc-safe-setup ``` This runs an interactive wizard that configures hooks based on your risk profile. ## Install individual hooks ```bash npx cc-safe-setup --install-example large-read-guard npx cc-safe-setup --install-example prevent-rm-rf npx cc-safe-setup --install-example git-force-push-block ``` ## Why hooks instead of CLAUDE.md rules Rules in CLAUDE.md are suggestions — Claude can forget them. Hooks are enforced at the system level. A hook that blocks `rm -rf` cannot be overridden by the AI. From 800+ hours of autonomous operation: the hooks that matter most are the ones you don't notice until something goes wrong. ## Resources - Repository: https://github.com/yurukusa/cc-safe-setup - Hook Selector (find hooks for your setup): https://yurukusa.github.io/cc-safe-setup/hook-selector.html - Token Checkup (diagnose waste): https://yurukusa.github.io/cc-safe-setup/token-checkup.html
README
Listed on Product Hunt since April 21, 2026.
One command to make Claude Code safe for autonomous operation. 892 example hooks · 73+ Anthropic Issues addressed by hook · 213 test files · 30K+ npm downloads (cumulative) · 日本語
npx cc-safe-setup
Installs 8 safety hooks in ~10 seconds. Blocks rm -rf /, prevents pushes to main, catches secret leaks, validates syntax after every edit. Zero npm dependencies. Hooks use jq at runtime (brew install jq / apt install jq).
What's a hook? A checkpoint that runs before Claude executes a command. Like airport security, it inspects what's about to happen and blocks anything dangerous before it reaches the gate.
What problem are you solving today? — routing informed by the 6 readers who actually bought the books on the right column
| Your situation | Start here (free) | Go deeper (¥800-$19) |
|---|---|---|
| Stop destructive ops (rm -rf, force-push, prod commands) | Live Demo → npx cc-safe-setup | 事故防止本 (¥800) — the 6-buyer entry book |
| Claude merged or deployed to production without your approval — gh pr merge --admin bypassed branch protection, or a deploy fired autonomously (#68676) | gh-cli-destructive-guard + [deploy-guard](https://