SessionEnd is triggered when a Hawa Code session terminates. Suitable for performing cleanup tasks, logging session statistics, or saving session state.
Note: Since SessionEnd is triggered when the session ends, it cannot block session termination and only supports type: "command" hooks.
Key Features
Property
Description
Trigger Timing
When the session ends
Can Block
No - Cannot prevent session termination
Supported Hook Types
Only supports command
Decision Control
None - Only for side effects (logging, cleanup, etc.)
Matcher Support
SessionEnd supports using matchers to filter by session end reason:
Matcher
Trigger Timing
clear
When clearing the session using the /clear command
other
Other exit reasons (normal exit, abnormal exit, etc.)
SessionEnd hook has no specific output requirements. The script’s standard output and error output will be logged but will not affect the session termination process.