Plugin hooks (PreToolUse) not propagated to subagents spawned by Agent tool
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
- Configure a
PreToolUsehook in.claude/settings.json, e.g. aBashhook that validates commit messages include a Jira ID prefix:
``json``
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "/path/to/commit-jira-prefix.sh"
}
]
}
]
}
}
- Ask Claude Code to perform a task that it delegates to a subagent via the
Agenttool (e.g. "raise a PR for this change") - The subagent executes
Bashtool 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)
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗