Event
Hook lifecycle events that can trigger registered hooks.
Usage
EventCombinable with | to match multiple events in a single hook registration.
Example
hook(Event.Stop | Event.SubagentStop, message=“review first”, block=True)
Attributes
| Name | Description |
|---|---|
| Notification | Hook lifecycle events that can trigger registered hooks. |
| PostToolUse | Hook lifecycle events that can trigger registered hooks. |
| PostToolUseFailure | Hook lifecycle events that can trigger registered hooks. |
| PreCompact | Hook lifecycle events that can trigger registered hooks. |
| PreToolUse | Hook lifecycle events that can trigger registered hooks. |
| Stop | Hook lifecycle events that can trigger registered hooks. |
| SubagentStart | Hook lifecycle events that can trigger registered hooks. |
| SubagentStop | Hook lifecycle events that can trigger registered hooks. |
| UserPromptSubmit | Hook lifecycle events that can trigger registered hooks. |
Notification
Hook lifecycle events that can trigger registered hooks.
Notification=auto()
Combinable with | to match multiple events in a single hook registration.
Examples
>>> hook(Event.Stop | Event.SubagentStop, message=“review first”, block=True)PostToolUse
Hook lifecycle events that can trigger registered hooks.
PostToolUse=auto()
Combinable with | to match multiple events in a single hook registration.
Examples
>>> hook(Event.Stop | Event.SubagentStop, message=“review first”, block=True)PostToolUseFailure
Hook lifecycle events that can trigger registered hooks.
PostToolUseFailure=auto()
Combinable with | to match multiple events in a single hook registration.
Examples
>>> hook(Event.Stop | Event.SubagentStop, message=“review first”, block=True)PreCompact
Hook lifecycle events that can trigger registered hooks.
PreCompact=auto()
Combinable with | to match multiple events in a single hook registration.
Examples
>>> hook(Event.Stop | Event.SubagentStop, message=“review first”, block=True)PreToolUse
Hook lifecycle events that can trigger registered hooks.
PreToolUse=auto()
Combinable with | to match multiple events in a single hook registration.
Examples
>>> hook(Event.Stop | Event.SubagentStop, message=“review first”, block=True)Stop
Hook lifecycle events that can trigger registered hooks.
Stop=auto()
Combinable with | to match multiple events in a single hook registration.
Examples
>>> hook(Event.Stop | Event.SubagentStop, message=“review first”, block=True)SubagentStart
Hook lifecycle events that can trigger registered hooks.
SubagentStart=auto()
Combinable with | to match multiple events in a single hook registration.
Examples
>>> hook(Event.Stop | Event.SubagentStop, message=“review first”, block=True)SubagentStop
Hook lifecycle events that can trigger registered hooks.
SubagentStop=auto()
Combinable with | to match multiple events in a single hook registration.
Examples
>>> hook(Event.Stop | Event.SubagentStop, message=“review first”, block=True)UserPromptSubmit
Hook lifecycle events that can trigger registered hooks.
UserPromptSubmit=auto()
Combinable with | to match multiple events in a single hook registration.
Examples
>>> hook(Event.Stop | Event.SubagentStop, message=“review first”, block=True)