hookify: PreToolUse 会加载所有规则 (包括 event: stop) 用于非 Bash/Write/Edit 工具 — event=None 会绕过事件过滤器,拒绝 MCP 工具

作者: fegome90-cmd创建于 2026年8月27日更新于 2026年9月27日

`plugins/hookify/hooks/pretooluse.py` derives the rule event from the tool name (`Bash` → `bash`, `Edit|Write|MultiEdit` → `file`) and leaves `event = None` for **every other tool** — including all `mcp__*` tools. `load_rules(event=None)` then skips the event filter entirely (`core/config_loader.py`, `if event:` guard), so rules authored for **other events** (e.g. `event: stop`) are loaded and evaluated during `PreToolUse`. A stop rule using the legacy `pattern` field becomes a `content` condition; any MCP tool whose `tool_input` contains a matching field (e.g. `content`) gets **denied** — with no `permissionDecisionReason`, so the client surfaces only the generic `Blocked by PreToolUse hook` message.

内容来源: anthropics/claude-plugins-official