Hook
Pre-Bash Git Safety
Block dangerous git operations without explicit confirmation.
Install
manual
add to ~/.claude/settings.json hooks.PreToolUse
Add this to your Claude Code MCP settings or run via the CLI.
About
PreToolUse hook on Bash. Blocks force push without --force-with-lease, reset --hard, branch -D, and rm -rf in dangerous paths.
Common use cases
- •Prevent destroying main
- •Catch reset --hard
- •Block rm -rf home
Tags
securitygitsafety