Notification hook fires ~8 seconds after permission prompt appears
Summary
The Notification hook event fires approximately 8 seconds after the permission prompt is displayed in the terminal. This makes it impractical for desktop notification workflows where users expect near-instant alerts.
Environment
- Claude Code version: 2.1.89
- OS: NixOS (Linux 6.18.20, Wayland/niri)
- Terminal: Ghostty
Steps to reproduce
- Configure a Notification hook in
~/.claude/settings.json:
``json``
{
"hooks": {
"Notification": [
{
"matcher": "permission_prompt",
"hooks": [
{
"type": "command",
"command": "bash ~/notification-hook.sh"
}
]
}
]
}
}
- Have the hook script log timestamps
- Trigger any tool use that requires permission
- Observe the permission prompt in the terminal
- Wait for the hook to fire
Observed behavior
The hook script itself executes in ~100ms, but there is a consistent ~8 second delay between the permission prompt appearing in the terminal and Claude Code firing the Notification event.
Profiling evidence
T+0ms: hook started
T+12ms: stdin read
T+33ms: jq parsed (type=permission_prompt)
T+94ms: window resolved
T+97ms: launching notification
T+101ms: hook done
The bottleneck is entirely internal to Claude Code — the hook runs fast once invoked.
Expected behavior
The Notification hook should fire within ~500ms of the permission prompt being displayed. The primary use case for this hook is desktop notifications (e.g. via dunst/libnotify) to alert the user that Claude needs input. An 8-second delay defeats the purpose.
Additional context
The Stop hook has a similar delay (~4-8 seconds after Claude finishes its turn). Both delays appear to be caused by the same internal processing pipeline.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗