π’ Send system notifications when Claude Code requests permissions or completes tasks
A cross-platform notification script that integrates with Claude Code to show system notifications for various events like session completions and permission requests.
brew install terminal-notifier
curl -o ~/.claude/claude-code-notifier.sh https://raw.githubusercontent.com/hta218/claude-code-notifier/main/claude-code-notifier.sh
chmod +x ~/.claude/claude-code-notifier.sh
Note: Windows users can skip this step.
Make sure notifications are enabled for Terminal/your shell application in your system settings.
Create or edit ~/.claude/settings.json
and add:
{
"hooks": {
"Notification": [
{
"hooks": [
{
"type": "command",
"command": "~/.claude/claude-code-notifier.sh"
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "~/.claude/claude-code-notifier.sh"
}
]
}
],
"SessionEnd": [
{
"hooks": [
{
"type": "command",
"command": "~/.claude/claude-code-notifier.sh"
}
]
}
],
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "~/.claude/claude-code-notifier.sh"
}
]
}
]
}
}
Restart Claude Code to apply the changes then simply prompt 'Hello' to see notifications in action.
Once installed, the script will automatically trigger notifications with default System sounds when Claude Code:
- Starts sessions (SessionStart hook)
- Requests permissions or user input (Notification hook)
- Completes tasks or responses (Stop hook)
- Ends sessions (SessionEnd hook)
The script handles different notification types:
- SessionStart: Shows "Session started π"
- SessionEnd: Shows "Session completed β "
- Stop: Shows "Response finished π"
- Notification: Shows the original message from Claude
- Other events: Shows the event name with the message
terminal-notifier
for pushing notificationsjq
for JSON processing- Install:
brew install terminal-notifier jq
notify-send
(usually pre-installed)- Install if missing:
sudo apt install libnotify-bin
- PowerShell (built-in on modern Windows)
- Uses Windows Toast notifications
You can modify the script to:
- Change notification messages
- Add different sounds
- Log notifications to a file (uncomment the last line)
- Customize notification appearance
Feel free to submit issues and pull requests to improve the script!