[DOCS] Hooks docs are outdated for `SessionEnd` timeout override behavior

Resolved 💬 2 comments Opened Mar 12, 2026 by coygeek Closed Mar 18, 2026

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:

  1. SessionEnd uses a dedicated exit-time budget.
  2. How hook.timeout differs from CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS.
  3. The units and default behavior for the new environment variable.
  4. 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 SessionEnd hooks being killed after 1.5 s on exit regardless of hook.timeout — now configurable via CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗