๐Ÿš€ We're launching on Product Hunt โ€” April 21! Follow us โ†’

Stop Claude Code from deleting your files

Claude Code is Anthropic's AI coding agent that runs commands in your terminal. Without guardrails, it can delete files, leak secrets, or force-push to production.

One command installs safety hooks that block destructive commands before they execute. 727 hooks, 9,200+ tests, 30K+ total installs.

npx cc-safe-setup

8 core safety hooks installed in under 30 seconds. No config needed.

View on GitHub Try Live Demo Opus 4.7 Survival Guide (66 sections)

Real incidents from GitHub Issues: 50GB data loss, $1,446 unauthorized transfer, production server destroyed

๐Ÿ”ฅ New: Attack Simulator (10 scenarios) ยท Risk Assessment ยท Incident Tracker (90 incidents)

GitHub Stars Weekly installs

1

Install

Run npx cc-safe-setup. 8 hooks installed in 30 seconds.

2

Protect

Hooks intercept rm -rf, force-push, credential leaks before they execute.

3

Monitor

Track token consumption, detect quota drain, get alerts before it's too late.

โšก Safety AND Convenience โ€” our most popular hook auto-approves safe git commands, reducing clicks while blocking dangerous ones.

ONE-TIME ยท CUT YOUR TOKENS IN HALF

Token Book โ€” $17

800+ hours of data. 48 token drain symptoms. Copy-paste templates.

MONTHLY ยท STAY AHEAD OF INCIDENTS

CC Safety Lab โ€” ยฅ500/mo

Monthly digest: 4-8 incidents, hooks, token-saving techniques. Founder price locked.

Tokens disappearing? Take the free Token Checkup โ€” 5 questions, 30 seconds. Find out what's draining your quota. | Token Book โ€” $17 800h of data, copy-paste templates | Safety Lab โ€” ยฅ500/mo monthly incident digest

Safety Audit

Paste your ~/.claude/settings.json. Nothing leaves your browser.

Hook Builder

Build a custom hook without writing code.

Hooks Cookbook

Copy-paste recipes from real GitHub Issues.

Ecosystem Comparison

All major Claude Code hook projects compared.

ProjectLangHooksInstall
safety-netTS5npx
cc-safe-setupBash707+npx
karanb192JS5+copy
masteryPython12copy
lassoPython1install.sh

Feature Matrix

Featuresafety-netcc-safe-setupkaranb192mastery
rm -rf blockerโœ“โœ“โœ“โœ“
Branch guardโœ“โœ“--
Secret guard-โœ“โœ“-
Syntax check-โœ“--
Context monitor-โœ“--
Hook generator-โœ“--
Dashboard-โœ“--
GitHub Action-โœ“--

Hooks Cheat Sheet

Print this page (Ctrl+P) for a quick reference.

Lifecycle

Prompt โ†’ PreToolUse โ†’ Tool โ†’ PostToolUse โ†’ Stop

Exit Codes

CodeMeaning
0Allow
2Block

Minimal Block Hook

#!/bin/bash
CMD=$(cat | jq -r '.tool_input.command // empty')
[ -z "$CMD" ] && exit 0
echo "$CMD" | grep -qE 'PATTERN' && echo "BLOCKED" >&2 && exit 2
exit 0

Auto-Approve Hook

#!/bin/bash
CMD=$(cat | jq -r '.tool_input.command // empty')
[ -z "$CMD" ] && exit 0
echo "$CMD" | grep -qE '^git\s+(status|log|diff)' && \
  jq -n '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"allow"}}'
exit 0

Quick Commands

npx cc-safe-setupInstall 8 hooks
--create "desc"Generate hook
--auditScore 0-100
--dashboardLive status
--doctorDiagnose
--benchmarkSpeed test

How healthy is your Claude Code setup?

Run a free 20-check diagnostic. Takes 2 seconds, nothing leaves your machine.

npx cc-health-check

30K+ total installs ยท 727 example hooks ยท Production Guide (Zenn Book)

Prevent real incidents:

rm -rf disasters Force-push to main Secret leaks git reset --hard Cascading syntax errors Dependency bloat Temp file buildup Auto Mode safety Hook if field (v2.1.85) Shell variable trap Session drift Token waste Cost explosion bash -x debug leak Post-compact push Hook testing guide Autonomous safety CLAUDE.md best practices Co-Authored-By control Fix git show --no-stat Disable auto-compaction WebFetch domain fix Pipe mode safety Session degradation Denied action retry Background agent writes