Plugin PreToolUse hooks not invoked for Edit tool
Resolved 💬 2 comments Opened Apr 9, 2026 by i-dedova Closed Apr 13, 2026
Description
Plugin-level PreToolUse hooks configured in a plugin's hooks/hooks.json are not invoked for the Edit tool. The same hook fires correctly for Read and Write. Global settings.json PreToolUse hooks (no matcher) fire for Edit as expected — this is plugin-specific.
Related: #34573
Environment
- Platform: Windows 11 Pro 25H2
- Shell: Git Bash (VS Code terminal)
Steps to Reproduce
- Register a PreToolUse hook in a plugin's
hooks/hooks.jsonwithmatcher: "Read|Write|Edit"(ormatcher: "Edit"alone) - Add a write to a temp file at the very start of the hook script's
main()to confirm invocation - Trigger a
Read→ hook fires ✅ - Trigger an
Edit→ hook does not fire ❌
Validation
- Invocation log: Debug write at line 1 of
main(). After a live Edit call — zero entries. After a Read call — entry present. - Output test: Running the hook script directly via subprocess with Edit input produces correct JSON, confirming the script itself is not the issue.
- Global hook: A PreToolUse hook in
settings.jsonwith no matcher processes Edit correctly — the gap is plugin-specific.
Expected Behavior
Plugin PreToolUse hooks with matcher: "Edit" should be invoked for Edit tool calls, consistent with Read and Write.
Workaround
Move Edit handling to a global settings.json PreToolUse hook. Works but breaks plugin encapsulation.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗