Every hook was born from a real incident. Here's the before and after.
15 examples from real GitHub Issues
Claude: "Let me clean up the temp files" $ rm -rf / → Entire filesystem deleted via NTFS junction traversal
Claude: "Let me clean up the temp files" $ rm -rf / → BLOCKED: rm -rf on root directory Claude: "I'll target just the temp folder instead" $ rm -rf /tmp/old-builds
Claude (autonomous, 3am): "Changes look good" $ git push origin main --force → Production branch overwritten with untested code
Claude (autonomous, 3am): "Changes look good" $ git push origin main --force → BLOCKED: Force push to main Claude: "I'll create a PR instead" $ git push origin feature/auth-fix
Claude: "Let me commit all changes" $ git add . $ git push → .env with API keys pushed to public repo
Claude: "Let me commit all changes" $ git add . → BLOCKED: .env file would be staged Claude: "I'll add specific files instead" $ git add src/ tests/
Claude: "Let me start fresh" $ git checkout -- . → 3 hours of uncommitted edits gone forever (Claude does it again 20 minutes later)
Claude: "Let me start fresh" $ git checkout -- . → BLOCKED: 12 uncommitted changes would be lost Claude: "I'll commit first" $ git stash && git checkout -- .
Test: auth.test.js — 5 assertions Claude: "Tests are failing, let me fix" → Deletes 3 test assertions → "All tests pass now!" (because there are fewer tests)
Claude: "Tests are failing, let me fix" → WARNING: Removing 3 test assertions → "Fix the code, not the tests" Claude: "You're right, let me fix the auth logic"
Session resumes, generates 652K output tokens No warning, no limit Bill arrives: $342 for one session
Session runs normally... → WARNING: Estimated cost ~$10, approaching $50 limit → Consider /compact or new session At $50: BLOCKED — start a new session
Claude edits README.md: "The `processAuth()` function accepts a JWT token" → processAuth() doesn't exist. Claude never read the source.
Claude edits README.md referencing `auth.ts` → WARNING: Doc references auth.ts — verify it was read Claude: "Let me read the source first" $ Read auth.ts → writes accurate documentation
Claude: "Let me reset the database schema" $ php artisan migrate:fresh → All production data permanently deleted
Claude: "Let me reset the database schema" $ php artisan migrate:fresh → BLOCKED: migrate:fresh wipes all tables Claude: "I'll create a migration instead" $ php artisan make:migration add_users_table
$ npm install broken-pkg → ERROR $ npm install broken-pkg → ERROR $ npm install broken-pkg → ERROR (repeats 10 more times)
$ npm install broken-pkg → ERROR (tracked) $ npm install broken-pkg → ERROR (2nd failure) $ npm install broken-pkg → BLOCKED: Failed 3 times → Try a different approach Claude: "Let me check if there's an alternative package"
Claude: "Let me set up the dev environment" → Overwrites ~/.bashrc with new PATH → All shell aliases, functions, and config lost
Claude: "Let me set up the dev environment" → BLOCKED: Modifying ~/.bashrc Claude: "I'll add to a project-local .envrc instead"
Want all of these? One command:
npx cc-safe-setup --shield