[DOCS] Python SDK HookEvent enum missing 4 documented hook events
Documentation Type
Incorrect/outdated documentation
Documentation Location
https://platform.claude.com/docs/en/agent-sdk/python
Section/Topic
"Hooks" section, HookEvent enum definition
Current Documentation
The Python SDK documentation shows HookEvent with 8 events:
``python class HookEvent(str, Enum): TOOL_START = "tool_start" TOOL_END = "tool_end" AGENT_START = "agent_start" AGENT_END = "agent_end" MODEL_RESPONSE = "model_response" USER_INPUT = "user_input" SESSION_START = "session_start" SESSION_END = "session_end" ``
However, the Claude Code hooks documentation lists 12 hook events:
PreToolUsePostToolUseNotificationStopSubagentStopSubagentStart← Missing from Python SDKPermissionRequest← Missing from Python SDKSessionStartSessionPausePostToolUseFailure← Missing from Python SDKSetup← Missing from Python SDK
What's Wrong or Missing?
The Python SDK HookEvent enum is missing 4 events that are documented in the hooks reference:
- PermissionRequest - Triggered when permission is needed
- PostToolUseFailure - Triggered when a tool use fails
- SubagentStart - Triggered when a subagent starts
- Setup - Triggered during setup/initialization
Additionally, the naming convention differs between the SDK (snake_case: tool_start) and the hooks docs (PascalCase: PreToolUse), which may cause confusion.
Suggested Improvement
Update the HookEvent enum to include all documented events:
class HookEvent(str, Enum):
TOOL_START = "tool_start"
TOOL_END = "tool_end"
AGENT_START = "agent_start"
AGENT_END = "agent_end"
MODEL_RESPONSE = "model_response"
USER_INPUT = "user_input"
SESSION_START = "session_start"
SESSION_END = "session_end"
PERMISSION_REQUEST = "permission_request"
POST_TOOL_USE_FAILURE = "post_tool_use_failure"
SUBAGENT_START = "subagent_start"
SETUP = "setup"
Or add a note explaining why certain events are not available in the SDK.
Impact
Medium - Makes feature difficult to understand
Additional Context
Affected Pages:
| Page | Section | Issue |
|------|---------|-------|
| https://platform.claude.com/docs/en/agent-sdk/python | Hooks | HookEvent missing 4 events |
| https://code.claude.com/docs/en/hooks | Hook events | Lists all 12 events |
Total scope: 1 page needs update (agent-sdk/python)
Cross-reference: The complete hook event list is at https://code.claude.com/docs/en/hooks
4 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Issue #20911 Verification
Title: [DOCS] Python SDK HookEvent enum missing 4 documented hook events
Issue Date: Unknown
Verification Date: 2026-02-01
Status: RESOLVED
---
Issue Summary
This issue reports that the Python SDK's
HookEventenum was missing 4 hook events documented in the Claude Code hooks reference:SubagentStart,PermissionRequest,PostToolUseFailure, andSetup. Additionally, it noted a naming convention discrepancy between the SDK (snake_case liketool_start) and the hooks docs (PascalCase likePreToolUse).---
Verification Results
Claim 1: Python SDK showed HookEvent with 8 events using snake_case naming
Status: RESOLVED
The issue claimed the Python SDK documentation showed:
The current documentation now shows:
Verdict: The enum has been completely restructured. It now uses a
Literaltype with PascalCase naming that matches the Claude Code hooks reference. The old snake_case naming (tool_start,tool_end, etc.) no longer exists.---
Claim 2: Four events missing from Python SDK (SubagentStart, PermissionRequest, PostToolUseFailure, Setup)
Status: RESOLVED
The current Agent SDK hooks guide now includes an explicit compatibility table:
| Hook Event | Python SDK | TypeScript SDK |
|------------|------------|----------------|
|
PreToolUse| Yes | Yes ||
PostToolUse| Yes | Yes ||
PostToolUseFailure| No | Yes ||
UserPromptSubmit| Yes | Yes ||
Stop| Yes | Yes ||
SubagentStart| No | Yes ||
SubagentStop| Yes | Yes ||
PreCompact| Yes | Yes ||
PermissionRequest| No | Yes ||
SessionStart| No | Yes ||
SessionEnd| No | Yes ||
Notification| No | Yes |Additionally, the Python SDK reference states:
Verdict: The documentation now explicitly documents which events are supported in each SDK. The "missing" events (
SubagentStart,PermissionRequest,PostToolUseFailure) are now clearly marked as "Python SDK: No" in the table. TheSetupevent mentioned in the issue does not exist in the Claude Code hooks reference—this appears to have been a misreading of the original documentation.---
Claim 3: Naming convention discrepancy (snake_case vs PascalCase)
Status: RESOLVED
The Python SDK now uses PascalCase (
"PreToolUse","PostToolUse", etc.) that matches the Claude Code hooks reference exactly. The old snake_case values (tool_start,tool_end, etc.) are no longer present.Verdict: Naming is now consistent across both documentation sources.
---
Current State
| Claim | Status |
|-------|--------|
| HookEvent showed wrong 8 events with snake_case | RESOLVED - Now shows 6 events with correct PascalCase |
| SubagentStart missing without explanation | RESOLVED - Explicitly documented as "Python SDK: No" |
| PermissionRequest missing without explanation | RESOLVED - Explicitly documented as "Python SDK: No" |
| PostToolUseFailure missing without explanation | RESOLVED - Explicitly documented as "Python SDK: No" |
| Setup event missing | RESOLVED - This event never existed; was a misreading |
| Naming convention inconsistency | RESOLVED - Both now use PascalCase |
---
Suggested Fix
N/A - issue has been resolved.
---
References
HookEventdefinition usingLiteraltype with PascalCase---
Conclusion & Recommendation
Primary Concern: The Python SDK's HookEvent enum was missing events and used inconsistent naming compared to the Claude Code hooks documentation.
Resolution Status: RESOLVED
Recommendation: CLOSE
The documentation has been comprehensively restructured. The HookEvent type now uses correct PascalCase naming matching Claude Code's hooks, and an explicit compatibility table clearly documents which events are available in Python vs TypeScript SDKs with explanatory notes about SDK limitations.
Closing as resolved - the HookEvent type has been restructured with correct PascalCase naming, and a compatibility table now clearly documents SDK-specific event support.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.