Claude Code desktop notifications
When using Claude Code in a terminal, it's easy to switch to another workspace and forget that Claude is waiting for input.
Using Claude Code's hooks and notify-send, any freedesktop-compatible notification daemon (dunst, mako, swaync, fnott, ...) can notify you.
The Notification hook supports matchers for different event types.
Using two Notification hooks with separate matchers covers two cases:
idle_prompt— Claude finished and is waiting at the main prompt (fires roughly after 60 seconds of inactivity)permission_prompt— Claude needs permission to run a tool (fires immediately, which may be too frequent if you're already at the terminal)
Add them to ~/.claude/settings.json:
{ "hooks": { "Notification": [ { "matcher": "idle_prompt", "hooks": [ { "type": "command", "command": "notify-send -u normal -a 'Claude Code' 'Claude Code idle' \"Waiting in $(basename \"$PWD\")\"" } ] }, { "matcher": "permission_prompt", "hooks": [ { "type": "command", "command": "notify-send -u normal -a 'Claude Code' 'Claude needs permission' \"Approve action in $(basename \"$PWD\")\"" } ] } ] } }
Both use "normal" priority, so that the notification vanishes after a little while without the need for me to click anything.
Restart Claude Code sessions after changing the hook config.
Use /hooks in a session to verify the hooks are loaded.
Example for idle message:

There are more hooks, but I decided to start with only Notification.
Limitations
This does not notify when Claude asks an interactive question mid-response (AskUserQuestion). There is no hook for this yet — see this feature request.