Too many approval prompts are tiring, and too much freedom is risky. Many people fear that the assistant will delete their files. A safety hook blocks destructive commands, whatever the assistant decides.
Free picks (tested by us)
Most useful first. Each one was installed on a clean test system; start with the first, try it, then add the next.
Stops the assistant before it runs a command that could delete your files.
Test: installs cleanly; its main features need an account we did not use. Not yet used on real work.
EveryoneWatch outThe install command changes your agent's hook settings. It runs a program on every shell command, so a bug in the tool could block normal work.
Anthropic's plugin turns a plain request such as 'warn me before rm -rf' into a rule that warns or blocks Claude before it runs a command or edits a file.
Test: installs cleanly and works without an account. Not yet used on real work.
EveryoneWatch outRuns a Python script before and after every tool use, on every prompt and at every stop, so Python 3 must be installed (hooks.json, README)
Free MIT hook that won't let your assistant say it's finished after changing code until a test has passed, or until it tells you plainly why it can't.
Test: installs cleanly; its main features need an account we did not use. Not yet used on real work.
EveryoneWatch outAdds five Claude Code hooks (hooks/hooks.json): UserPromptSubmit, PostToolUse (Edit, Write, MultiEdit, NotebookEdit, Bash, PowerShell and every MCP tool), PostToolUseFailure, Stop and SubagentStop. Each one runs node gate.cjs on your computer with a 10-second limit, so every MCP tool call adds a little delay
For Claude CodeAlso works with Codex CLI — see all steps
Claude Code hook that blocks rm -rf on unquoted variables, your home folder, a repo root or .git, also inside scripts, even in bypassPermissions mode.
Test: installs cleanly; its main features need an account we did not use. Not yet used on real work.
EveryoneWatch outThe install line downloads the latest release file from GitHub and runs it. --install copies it to ~/.claude/hooks/recursive_delete_guard.py, runs its self-test (temporary folders only), backs up ~/.claude/settings.json if it exists and adds one PreToolUse entry (matcher Bash|Monitor|Write|Edit|MultiEdit, timeout 10 s)