Essential Hooks for Auto Mode

Auto Mode removes the confirmation step. Every tool call executes immediately. Without hooks, there is nothing between Claude and rm -rf /.

Minimum Safety Setup

npx cc-safe-setup

This installs 8 hooks that catch the most dangerous operations:

HookBlocks
destructive-guardrm -rf, git reset --hard, chmod 777
branch-guardgit push origin main, --force
secret-guardgit add .env, credential files
syntax-checkSaves with syntax errors (Python/JS/JSON)
context-monitorWarns at 70% context usage
npm-publish-guardAccidental npm publish
response-budgetRunaway sessions (max responses)
commit-msg-qualityEmpty/low-quality commit messages

Maximum Safety for Auto Mode

npx cc-safe-setup --shield

Adds project-specific protections detected by scanning your codebase (database guards, Docker guards, framework-specific hooks).

Why CLAUDE.md Isn't Enough

CLAUDE.md rules are prompt-level suggestions. In Auto Mode with a full context window, Claude can and does ignore them. Hooks run at the process level — the model cannot bypass a hook that returns exit 2.

Install Before Enabling Auto Mode

npx cc-safe-setup

667 hooks. 9,200+ tests. Works with Auto Mode.

cc-safe-setup · GitHub · rm -rf protection · force-push protection