Unclear The condition that sends the failure to the debug log is not known.
What
A SessionEnd hook is a command Claude Code runs when a session ends. When one fails, its output used to be written to the error output every time. Under a certain condition it now goes to the debug log, a file of detailed records, instead.
Why
Less error text appears when Claude Code exits. If a SessionEnd hook seems to fail silently, look in the debug log.
Names in the bundleSessionEnd
The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.
Confirmed since
Anthropic's documentation has since written up SessionEnd, on Intercept and control agent behavior with hooks.
Claude Code runs each callback with a timeout, which you set in seconds with the `timeout` field on its `HookMatcher`. When you don't set one, Claude Code uses the event's default: 600 seconds for most events, 30 seconds for `UserPromptSub…agent-sdk/hooks see the edit
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubt
The condition that sends the failure to the debug log is not known.
Anthropic's documentation agrees
Anthropic's documentation has since written up SessionEnd, on Intercept and control agent behavior with hooks.