Hook: Notification System

Script: notify.sh

Purpose: This optional hook provides pleasant, non-blocking audio feedback to let you know when Claude Code has completed a task or requires your input. This is a quality-of-life feature that allows you to multitask without having to constantly check the terminal.

Triggers: - Notification: Fires for all notifications, including when Claude is waiting for user input. - Stop: Fires when the main task completes.

Features

  • Cross-Platform Support: The script automatically detects your operating system (macOS, Linux, Windows via WSL) and uses the appropriate command-line audio player.
  • Multiple Fallbacks: It tries several common audio players on Linux (paplay, aplay, pw-play) to maximize compatibility.
  • Non-Blocking: Audio is played in the background, so it doesn't interrupt your workflow or the AI's operation.
  • Customizable Sounds: The sound files are located in .claude/hooks/sounds/. You can replace input-needed.wav and complete.wav with your own audio files.

How to Enable

During the interactive setup (setup.sh), you will be asked if you want to set up notification hooks. Answering yes (y) will configure this hook for you in .claude/settings.local.json.

Testing the Notifications

After installation, you can test the audio playback directly from your terminal:

# Test the 'input needed' sound
bash .claude/hooks/notify.sh input

# Test the 'task complete' sound
bash .claude/hooks/notify.sh complete

If you don't hear a sound, ensure your system volume is up and that you have a compatible command-line audio player installed.