[DOCS] Hooks docs are outdated for `SessionEnd` timeout override behavior
Documentation Type
Incorrect/outdated documentation
Documentation Location
https://code.claude.com/docs/en/hooks
Section/Topic
SessionEnd timeout semantics and CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS.
Current Documentation
The general hook reference currently says:
| timeout | no | Seconds before canceling. Defaults: 600 for command, 30 for prompt, 60 for agent |
The hooks guide also says:
Hook timeout is 10 minutes by default, configurable per hook with the timeout field (in seconds).
The SessionEnd section says the hook can perform cleanup tasks, but no documentation currently mentions a separate exit-time limit or the CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS environment variable.
What's Wrong or Missing?
Release v2.1.74 says SessionEnd hooks were previously killed after 1.5 seconds on exit regardless of hook.timeout, and that exit budget is now configurable via CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS.
Current docs imply the normal per-hook timeout field governs SessionEnd behavior, which is now outdated and incomplete for anyone using SessionEnd for cleanup, uploads, or logging.
Suggested Improvement
Update the hooks docs to explain:
SessionEnduses a dedicated exit-time budget.- How
hook.timeoutdiffers fromCLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS. - The units and default behavior for the new environment variable.
- A short example of increasing the timeout for longer cleanup tasks.
Impact
High - Prevents users from using a feature
Additional Context
Affected Pages:
| Page | Line(s) | Context |
|------|---------|---------|
| https://code.claude.com/docs/en/hooks | 261, 1541-1571 | Generic timeout docs and SessionEnd section omit the dedicated exit-time behavior |
| https://code.claude.com/docs/en/hooks-guide | 628 | Troubleshooting says timeout is controlled by the per-hook timeout field |
| https://code.claude.com/docs/en/settings | 790-869 | Environment variable table does not list CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS |
Total scope: 3 pages affected
Source: Release v2.1.74
- Fixed
SessionEndhooks being killed after 1.5 s on exit regardless ofhook.timeout— now configurable viaCLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗