Support argument patterns in hook matchers (like permissions system)
Resolved 💬 3 comments Opened Jan 28, 2026 by lucharo Closed Feb 1, 2026
Problem
The permissions system supports argument patterns like Bash(git commit*) to match specific commands. Hook matchers only match tool names, so "matcher": "Bash(git commit*)" doesn't work — you have to use "matcher": "Bash" and filter inside your script.
This means hooks fire on every Bash invocation, even when they only care about specific commands.
Current workaround
{ "matcher": "Bash" }
INPUT=$(cat)
if ! echo "$INPUT" | grep -q "git commit"; then
exit 0
fi
Proposed
Allow argument patterns in hook matchers, consistent with permissions:
{ "matcher": "Bash(git commit*)" }
This would let Claude Code filter before spawning the hook process.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗