From b162a7a83af158ad618e80b1d91ef5e6e6faaaee Mon Sep 17 00:00:00 2001 From: Stefano Baghino Date: Thu, 21 May 2026 10:29:54 +0200 Subject: [PATCH] agents: scope git hygiene hook to `git add` commands The `PreToolUse:Bash` hook invoked `enforce-git-hygiene.sh` on every Bash tool call, even though the script only blocks `git add . / -A / --all`. Add `"if": "Bash(git add *)"` so the script only runs when the command actually contains `git add`. --- .agents/settings.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.agents/settings.json b/.agents/settings.json index c4ca54815989..f9a81de3a2e3 100644 --- a/.agents/settings.json +++ b/.agents/settings.json @@ -16,6 +16,7 @@ "hooks": [ { "type": "command", + "if": "Bash(git add *)", "command": "bash .agents/hooks/enforce-git-hygiene.sh" } ],