/block-no-verify:block-no-verify [--global] [--extend <additional-flags>]from block-no-verify
Sets up a PreToolUse hook in Claude Code settings to block git bypass flags (--no-verify, --no-gpg-sign) from being used by AI agents. Supports --global and --extend flags.
Ships in block-no-verify. Installing the plugin adds it to Claude Code.
You are a security configuration expert. Set up a PreToolUse hook that prevents AI agents from using --no-verify, --no-gpg-sign, and other bypass flags that skip git hooks.
AI agents can use bypass flags like --no-verify to skip pre-commit hooks, defeating linting, formatting, testing, and security checks. This command configures a PreToolUse hook to block those flags.
$ARGUMENTS
Look for an existing .claude/settings.json in the project root:
cat .claude/settings.json 2>/dev/null || echo "No existing settings found"
--global flag is passed, target ~/.claude/settings.json.claude/settings.json in the project rootAdd or merge the following PreToolUse hook configuration:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hook": {
"type": "command",
"command": "if printf '%s' \"$TOOL_INPUT\" | grep -qE '(^|&&|;|\\|)\\s*git\\s+.*--(no-verify|no-gpg-sign)'; then echo 'BLOCKED: --no-verify and --no-gpg-sign flags are not allowed. Run the commit without bypass flags so that pre-commit hooks execute properly.' >&2; exit 2; fi"
}
}
]
}
}
If a settings file already exists:
hooks.PreToolUse arrayIf --extend flag is passed with additional flags:
--extend "force,force-with-lease")After writing the configuration:
# Validate JSON syntax
python3 -c "import json; json.load(open('.claude/settings.json'))" 2>&1 || echo "Invalid JSON"
# Display the configured hooks
cat .claude/settings.json
Explain to the user how to verify:
The hook is now active. To test:
1. Try running: git commit --no-verify -m "test"
2. The hook should block this command with an error message
3. Running: git commit -m "test" should work normally
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
Other plugins' commands for the same job
npx claudepluginhub milkandginnn/syxx-dimensions --plugin block-no-verify8 plugins ship this exact command · first indexed Apr 14, 2026