[DOCS] Discrepancy in Subagent hook support and missing type definitions in Python SDK
Documentation Type
Unclear/confusing documentation
Documentation Location
https://platform.claude.com/docs/en/agent-sdk/hooks
Section/Topic
The Available hooks table.
Current Documentation
The table under the "Available hooks" section lists the following:
| Hook Event | Python SDK | TypeScript SDK | What triggers it | Example use case |
| :--- | :--- | :--- | :--- | :--- |
| SubagentStart | No | Yes | Subagent initialization | Track parallel task spawning |
| SubagentStop | Yes | Yes | Subagent completion | Aggregate results from parallel tasks |
What's Wrong or Missing?
There is an inconsistency between the documentation and the actual Python SDK implementation found in the claude-agent-sdk repository:
- Code/Doc Mismatch: The documentation states that
SubagentStopis supported in Python ("Yes"). While the typeSubagentStopHookInputexists insrc/claude_agent_sdk/types.py, the correspondingSubagentStartis marked as "No" in the docs and is completely missing from the codebase. - Missing Types: In
src/claude_agent_sdk/types.py, theHookInputunion and theHookEventliteral includeSubagentStopbut excludeSubagentStart. - Logical Gap: It is confusing for users to have a hook for a subagent stopping without a corresponding hook for it starting. If the Python SDK cannot support
SubagentStartdue to transport or architectural limitations, havingSubagentStopremains half-implemented and potentially unreachable or "phantom" code.
Suggested Improvement
- Clarification: If
SubagentStartis intentionally omitted from the Python SDK, the documentation should provide a brief note explaining whySubagentStopis supported butSubagentStartis not. - Code Realignment: If the feature is not yet implemented for Python, consider adding a "Coming Soon" or "Planned" status instead of a flat "No" if parity is expected.
- Type Cleanup: If
SubagentStartis never coming to Python, theSubagentStoptypes should be scrutinized to ensure they aren't misleading developers into expecting full subagent lifecycle management.
Suggested text for the table if parity is planned:
SubagentStart | Pending | Yes | Subagent initialization | Track parallel task spawning
Impact
High - Prevents users from using a feature
Additional Context
In the current Python SDK src/claude_agent_sdk/types.py:
# HookEvent is missing SubagentStart
HookEvent = (
Literal["PreToolUse"]
| Literal["PostToolUse"]
| Literal["UserPromptSubmit"]
| Literal["Stop"]
| Literal["SubagentStop"] # Stop exists
| Literal["PreCompact"]
)
# SubagentStopHookInput exists, but no SubagentStartHookInput
class SubagentStopHookInput(BaseHookInput):
"""Input data for SubagentStop hook events."""
hook_event_name: Literal["SubagentStop"]
stop_hook_active: bool
Comparatively, the TypeScript SDK at https://platform.claude.com/docs/en/agent-sdk/typescript lists both as fully functional, highlighting the lack of parity in the Python environment.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗