diff --git a/hooks/hooks.json b/hooks/hooks.json index 13224dcb..0ce2f4b7 100644 --- a/hooks/hooks.json +++ b/hooks/hooks.json @@ -128,7 +128,7 @@ "id": "pre:mcp-health-check" }, { - "matcher": "Edit|Write", + "matcher": "Edit|Write|MultiEdit", "hooks": [ { "type": "command", @@ -136,7 +136,7 @@ "timeout": 5 } ], - "description": "Fact-forcing gate: block first Edit/Write per file and demand investigation (importers, data schemas, user instruction) before allowing", + "description": "Fact-forcing gate: block first Edit/Write/MultiEdit per file and demand investigation (importers, data schemas, user instruction) before allowing", "id": "pre:edit-write:gateguard-fact-force" }, { diff --git a/scripts/hooks/gateguard-fact-force.js b/scripts/hooks/gateguard-fact-force.js index 79d219c4..76e1665e 100644 --- a/scripts/hooks/gateguard-fact-force.js +++ b/scripts/hooks/gateguard-fact-force.js @@ -165,7 +165,7 @@ function run(rawInput) { const toolName = data.tool_name || ''; const toolInput = data.tool_input || {}; - if (toolName === 'Edit' || toolName === 'Write') { + if (toolName === 'Edit' || toolName === 'MultiEdit' || toolName === 'Write') { const filePath = toolInput.file_path || ''; if (!filePath) { return rawInput; // allow @@ -173,7 +173,8 @@ function run(rawInput) { if (!isChecked(filePath)) { markChecked(filePath); - const msg = toolName === 'Edit' ? editGateMsg(filePath) : writeGateMsg(filePath); + const msg = (toolName === 'Edit' || toolName === 'MultiEdit') + ? editGateMsg(filePath) : writeGateMsg(filePath); return denyResult(msg); }