Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Our plugin registers a sessionEnd command hook (“node dist/src/index.js --hook session-end”) to generate a session recap. Registration, ${CLAUDE_PLUGIN_ROOT} expansion, and the stdin payload shape (session_id, reason, duration_ms, workspace_roots, transcript_path) all work — but the hook process can never actually run:
- sessionEnd fires ONLY with reason: “window_close” — never when a chat/agent session actually ends.
- By window close, the shell-exec bridge is already torn down, so every execution fails with “MainThreadShellExec not initialized”. Reproduced 5 out of 5 attempts.
Net effect: a sessionEnd command hook is currently unusable for any plugin, with no plugin-side workaround.
Steps to Reproduce
- Install a plugin with a SessionEnd command hook into ~/.cursor/plugins/local/ (real directory copy — symlinks are rejected).
- Note the hook only registers with the Claude-Code-style schema (PascalCase “SessionEnd”, nested “hooks” array, “type”: “command”). The camelCase flat format from the docs silently never registers.
- Open a project and run a short agent session with a few file edits.
- End the chat/session → the hook does not fire at all.
- Close the window → the Hooks output channel shows “Executing hook … from claude-plugin config” followed by “MainThreadShellExec not initialized”. The hook process never spawns.
Expected Behavior
sessionEnd should fire when a session ends (not only on window close) — or at minimum, hook commands fired at window close should execute before the shell-exec bridge is destroyed, so the spawned process can run.
Operating System
MacOS
Version Information
Bug originally validated on Cursor 3.11.13 (2026-07-11), 5/5 reproducible.
For AI issues: which model did you use?
Two related issues found during validation:
- The documented hooks schema silently fails to register. Only the Claude-Code-style schema works (PascalCase “SessionEnd”, nested “hooks” array, “type”: “command”). The Hooks channel’s “Loaded N user hook(s)” line also doesn’t count plugin hooks, which hides registration status and made this expensive to diagnose.
- Symlinked local plugin installs are rejected, contrary to the local-install docs — only real directory copies into ~/.cursor/plugins/local load.
Impact: automatic session capture is our plugin’s core feature. We shipped with a manual slash command as the sole trigger and can’t promise auto-capture until this is fixed.
Only validated on local installs — marketplace installs may use a different exec path (untested). Verbatim Hooks output channel logs available on request.
Does this stop you from using Cursor
No - Cursor works, but with this issue