Development record
Closing a Claude Code session shows: SessionEnd hook [sh "${CLAUDE_PLUGIN_ROOT}/hooks/session-end.sh"] failed: Hook cancelled. Seen by the person on 28 Oct 2026 while closing several sessions at a 1-minute load near 290 on 10 cores, with the plugin still at 0.13.3. Each cancelled hook means that session's transcript was not staged. The fix for the cancellation is on fix/session-end-stage (iss-2610241519088123: the hook runs no git and only stages the raw transcript), but it reaches this person only after a release and a plugin update, because the installed plugin is 0.13.3 while v0.15.1 is released (iss-2610241228359748, which copy runs).
Closing a Claude Code session shows: SessionEnd hook [sh "${CLAUDE_PLUGIN_ROOT}/hooks/session-end.sh"] failed: Hook cancelled. Seen by the person on 28 Oct 2026 while closing several sessions at a 1-minute load near 290 on 10 cores, with the plugin still at 0.13.3. Each cancelled hook means that session's transcript was not staged. The fix for the cancellation is on fix/session-end-stage (iss-2610241519088123: the hook runs no git and only stages the raw transcript), but it reaches this person only after a release and a plugin update, because the installed plugin is 0.13.3 while v0.15.1 is released (iss-2610241228359748, which copy runs).
Grounds
- pursued: closing a session under heavy load no longer shows the SessionEnd hook as cancelled once the plugin carries this release; shown wrong if a cancellation is seen on a plugin that includes it
Frontmatter
| id | iss-2610281259462058 |
|---|---|
| type | issue |
| lifecycle | resolved |
| severity | major |
.abcd/work/issues/resolved/iss-2610281259462058-closing-a-claude-code-session-shows.md
open on GitHub ↗ · commit history ↗
mentions2
- iss-2610241228359748Which abcd runs is confusing because several installs coexist and nothing says which one wins: the plugin can be installed at user scope and at project scope at once, each with its own plugin-root binary, and there is also a PATH binary (ahoy install) and, in abcd's own checkout, a source build (go run). Observed 2026-10-24: the person updated the plugin to v0.15.1, but the update landed as a new project-scope install for this repository while the user-scope install stayed at 0.13.3, and the session went on loading the user-scope copy (command pages still named .../abcd/0.13.3/abcd, its hooks bootstrapped there at 14:23); the 0.15.1 directory had never bootstrapped and held no binary; and the binary inside the 0.13.3 directory reported v0.14.1, so even the directory name did not say which version ran. Nothing in the board, ahoy or the command pages surfaced any of this. The person wants it unified (for example: does a repository-scope plugin win over a user-scope one, and how does the CLI on PATH relate to either?). Earlier rulings each settled one rung on its own (dcn-2609080000000001 the owned-only PATH rung for the hook shims, adr-2609151706587280 the cache-to-PATH attestation, iss-2610070547057816 dogfooding a source build in abcd's own checkout) without addressing the underlying problem: no single, stated precedence across plugin scopes, the plugin-root binary, the PATH binary and a source build.
- iss-2610241519088123The host still cancels abcd's SessionEnd hook on a loaded machine, so the session's transcript is neither staged nor stored, and nothing says so. On 2026-10-24, at a load average of about 21 on 10 cores, session ad158fbf ended with 'SessionEnd hook [sh .../hooks/session-end.sh] failed: Hook cancelled' under the 0.15.1 plugin, whose hook is identical to the current source; its 559 KB transcript reached neither the staging area nor the store, though the host's own copy is still on disk. The host gives a SessionEnd hook 1.5 seconds in all, and a timeout set in a plugin's hooks.json does not raise it (the host's hooks reference, read 2026-10-24). Before it stages anything, hook session-end detects the repository through ahoy.Detect and git, with up to two retries inside a 1.2-second budget; under this load starting the binary alone takes about 0.36 s and each git call about 0.15 s. The August fix (iss-2608230817034768) took redaction off the exit path but left this lookup on it, and the comment at internal/surface/cli/hook_subagent.go:95-110 says the hook could ask the host for more time, which the reference says a plugin hook cannot.