README.md

notification-hook #

Linux-only desktop notification plugin for Claude Code. Plays a sound and shows a desktop notification when Claude Code fires a notification event (e.g. waiting for input, permission prompt).

Platform: Linux (X11) only.

Hook #

Registered as a Notification hook with an empty matcher, so it fires on every notification Claude Code emits (permission prompts, idle-input waits, and so on). There is no per-type filtering.

Features #

  • Desktop notification via notify-send with project name and session context
  • Sound playback via ffplay
  • tmux integration: notification includes the tmux pane label, and clicking "Focus" activates the correct window/pane
  • Session name extraction from the transcript file

Sound file resolution #

The script resolves the notification sound in this order:

  1. CLAUDE_NOTIFY_SOUND environment variable (absolute path to any audio file)
  2. Bundled resources/bell.oga (freedesktop bell, shipped with the plugin)
  3. /usr/share/sounds/freedesktop/stereo/bell.oga (system fallback)

Dependencies #

These must be in PATH at runtime:

Binary Package (NixOS) Purpose
ffplay ffmpeg Sound playback
jq jq JSON parsing of hook input
notify-send libnotify Desktop notifications
tmux tmux Session/pane label (optional, only used inside tmux)
xdotool xdotool Window focus on notification click (optional)
xprop xorg.xprop Window name verification for focus (optional)

On NixOS, ensure these are in home.packages or environment.systemPackages.

Installation #

/plugin install notification-hook@jcmuller-plugins