Skip to content

Hook input should include context to distinguish agent vs subagent #36270

@sfriedenberg-etsy

Description

@sfriedenberg-etsy

PreToolUse hook input JSON currently contains hook_event_name, tool_name, tool_input, cwd, and session_id. There's no field indicating whether the tool call originates from the main agent or a subagent.

This matters for hook handlers that want to provide different guidance depending on context. For example, when denying a Bash call and redirecting to an MCP resource, the main agent can read the resource directly via ReadMcpResourceTool, but subagents must use a resource-read tool wrapper since they don't have access to MCP resources.

Currently we include both instructions in every denial message, which is noisy. A field like agent_type or is_subagent in the hook input would allow targeted messages.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions