{"version":"2.1.333","anchor":"sessionend-shutdown-hook-aware-waiting","canonical_anchor":"sessionend-shutdown-hook-aware-waiting","heading":"Shutdown now takes SessionEnd hooks into account when waiting","tier":"internal","area":"Hooks","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.333\/e\/sessionend-shutdown-hook-aware-waiting","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.333","markdown":"### Shutdown now takes `SessionEnd` hooks into account when waiting\n\nOn exit, Claude Code now checks for a `SessionEnd` hook in settings and adjusts how it waits, and waits for one more step before removing a worktree\n\n**Unclear.** Whether exit becomes faster or slower when a `SessionEnd` hook is set is not clear.\n\n**What**\n\nA `SessionEnd` hook is a command you can set to run when a session ends. When Claude Code shuts down, it now checks whether one is set in your settings and uses that to decide how its cleanup handles messages still being sent.\n\nIt also now waits for one extra step to finish before removing a worktree (a separate working copy of your project that Claude Code may create).\n\n**Why**\n\nThis can change how long Claude Code takes to exit.\n\n- Area: Hooks\n- Names: `SessionEnd`\n- Tier: Under the hood\n- Useful: 1\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}