Reading the Windows notification database is a clever side door. Per the Claude Code docs, the Notification hook already fires on permission prompts and after 60 s of idle input, so I'm curious what pushed you to the database: the 60 s delay, or sessions running outside the hooks?
Neither, strictly speaking. The main reason is sessions where the hook hasn’t been picked up yet. Claude Code reads hooks at session start, so an already-running session won’t have them until it’s restarted. Reading the notification database catches those sessions without a restart: Windows writes every toast from the Claude desktop app into wpndatabase.db, and a new row means “Claude is waiting for you”.
The second point is that the desktop app asks for permissions and asks questions without firing a Notification event. So I also hook PermissionRequest and PreToolUse for AskUserQuestion|ExitPlanMode.
So hooks are the primary path and the database is a fallback for older sessions. If the hook is set up from the start, you can do without it.
That restart gap is the part most hook setups miss, thanks for spelling it out. Hooking PreToolUse on AskUserQuestion|ExitPlanMode is a neat catch too. Does the database fallback still fire if the desktop app's toasts are muted in Focus mode?
Vic Moreno
Reading the Windows notification database is a clever side door. Per the Claude Code docs, the Notification hook already fires on permission prompts and after 60 s of idle input, so I'm curious what pushed you to the database: the 60 s delay, or sessions running outside the hooks?