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

  1. Register a PreToolUse hook in a plugin's hooks/hooks.json with matcher: "Read|Write|Edit" (or matcher: "Edit" alone)
  2. Add a write to a temp file at the very start of the hook script's main() to confirm invocation
  3. Trigger a Read → hook fires ✅
  4. 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.json with 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.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗