Agent SDK / desktop-app sessions load 0 hooks despite settings declaring them — SessionStart/Stop/UserPromptSubmit/PostToolUse never fire
Summary
Sessions run through the Agent SDK from the Claude desktop app (cc_entrypoint=claude-desktop) load zero hooks: with /debug enabled, the log shows [DEBUG] Hooks: Found 0 total hooks in registry while the same machine's user settings (~/.claude/settings.json) declare four hooks (SessionStart, Stop, UserPromptSubmit, PostToolUse) and the project's settings declare two more. None load, none fire.
CLI-entrypoint sessions on the same machine, same settings files, load and fire all of the same hooks correctly (verified via the hooks' own logging).
Why it matters
Hook-based automation silently doesn't exist for a whole class of sessions — in our case a Stop/SessionStart-armed mail-watcher (async re-wake pattern) that never arms in desktop-app sessions, so those sessions never notice work queued for them. There is no error or warning anywhere — the hooks are simply absent from the registry, and the user only discovers it by enabling /debug and reading the registry line.
Repro
- Declare any hook (e.g., SessionStart running a logger) in ~/.claude/settings.json.
- Open a session in the Claude desktop app (Agent SDK entrypoint); run /debug.
- Observe
Hooks: Found 0 total hooks in registry; the hook never fires. - Open a CLI session in the same directory: hooks load and fire.
Environment
- Desktop app build 1.32352.1, macOS arm64
- CLI 2.1.234 (native); observed identically under 2.1.220
- Debug log also shows repeated "Fast mode is not available in the Agent SDK" for these sessions, which may help identify the entrypoint/code path
Related: #87641 (unattended message-triggered turns never start in the same session class — filed separately; the two may share a root in how the Agent SDK entrypoint initializes sessions).
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗