Back to Hooks
Desktop Notification
StopSend a desktop notification when Claude Code finishes a task
notificationproductivitymacos
By Claude Code Community
Hook Script
#!/bin/bash
# Desktop Notification Hook
# Sends a notification when Claude Code stops
# macOS notification
if command -v osascript &> /dev/null; then
osascript -e 'display notification "Claude Code has finished the task" with title "Claude Code"'
fi
# Linux notification (if notify-send is available)
if command -v notify-send &> /dev/null; then
notify-send "Claude Code" "Claude Code has finished the task"
fi
Settings Configuration
{
"hooks": {
"Stop": [
{
"command": "./hooks/notify-on-complete.sh"
}
]
}
}How to use
- Create a hooks directory in your project: mkdir hooks
- Save the hook script as hooks/notify-on-complete.sh
- Make it executable: chmod +x hooks/notify-on-complete.sh
- Add the configuration to your Claude Code settings
- Restart Claude Code to apply changes