This hook fires on the PreToolUse event, inspecting each Bash command before it runs. It applies several layers of safety checks.
It blocks destructive operations like rm -rf /, dd and mkfs, protects sensitive directories such as .claude/, .git/ and node_modules/, and warns about suspicious patterns with detailed messages.
When to use
- When you want a safety net against accidental or dangerous commands.
- When there are critical folders that the agent should never delete.
How to use
After installing, it inspects every command automatically. Safe commands pass through; dangerous ones are stopped with an explanation.