verification: Confirm PreToolUse hook applies to subagent tool calls

Resolved 💬 3 comments Opened Feb 7, 2026 by shuhei0866 Closed Feb 10, 2026

Need to verify: Do PreToolUse hooks fire for tool calls made by subagents (Task tool)?

Context: learning_with implementing worktree guards via PreToolUse hook:

  • Hook should block Write/Edit on main worktree
  • Needed for both parent agent AND subagents (via Task tool)

Question:

  • When a subagent calls Write tool, does PreToolUse hook execute?
  • Or do subagent tool calls bypass parent hooks?

This affects architecture of guardrail system. If subagents bypass hooks, need different strategy (SubagentStart hook injection, or hooks in subagent environment).

Test case provided: learning_with R1-R3 implementation will verify empirically and report results.

View original on GitHub ↗

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