Plugin hooks (PreToolUse) not propagated to subagents spawned by Agent tool

Resolved 💬 2 comments Opened Mar 6, 2026 by claudio-scandura Closed Mar 6, 2026

Description

Plugin hooks configured via PreToolUse (and likely other hook types) do not propagate to subagents spawned by the Agent tool. This means safety checks are silently bypassed when work is delegated to a subagent.

Steps to Reproduce

  1. Configure a PreToolUse hook in .claude/settings.json, e.g. a Bash hook that validates commit messages include a Jira ID prefix:

``json
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "/path/to/commit-jira-prefix.sh"
}
]
}
]
}
}
``

  1. Ask Claude Code to perform a task that it delegates to a subagent via the Agent tool (e.g. "raise a PR for this change")
  2. The subagent executes Bash tool calls (git commit, gh pr create) without the hook firing

Expected Behaviour

Subagents should inherit the parent session's hook configuration. A PreToolUse:Bash hook should fire regardless of whether the Bash tool is called from the main session or from a subagent.

Actual Behaviour

Subagents run in a separate execution context and do not inherit plugin hooks. The hook never fires, so validation is silently skipped.

Impact

  • Commit message conventions (e.g. Jira ID prefix) bypassed
  • PR template validation skipped
  • Any other safety/quality gate implemented via hooks is ineffective when work is delegated

Workaround

Run hook-sensitive operations (commits, PRs) in the main session rather than delegating to subagents, or manually verify outputs after subagent work completes.

Environment

  • Claude Code CLI
  • macOS (Darwin 25.3.0)

View original on GitHub ↗

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