Back to Hooks

Force Push Blocker

Hooks security 147

Block git force push commands using the if condition for efficient filtering. Prevents accidental force pushes that can overwrite remote history. Covers --force, --force-with-lease, and the -f shorthand.

Install Command
npx claude-code-templates@latest --hook security/force-push-blocker
View on GitHub
claude-code — force-push-blocker

Content

JSON
{
"description": "Block git force push commands using the if condition for efficient filtering. Pr..."
"hooks": {
"PreToolUse": [1 item]
}
}

Stack Builder

0 components

Your stack is empty

Browse components and click the + button to add them to your stack for easy installation.