Skip to content

Instantly share code, notes, and snippets.

@runekaagaard
Created August 14, 2025 11:50
Show Gist options
  • Save runekaagaard/a98ff7a1cca44021a043027c1b28b42e to your computer and use it in GitHub Desktop.
Save runekaagaard/a98ff7a1cca44021a043027c1b28b42e to your computer and use it in GitHub Desktop.
Claude Code Terminator Notification Hooks - Pleasant sounds and tab title updates with emoji indicators
#!/bin/bash
# Notification script for Claude Code - sounds and tab title via remotinator
# Emojis: πŸ”΄ (running), 🟒 (stopped), πŸ”¨ (needs approval)
# Exit early if TERMINATOR_UUID is not set
if [ -z "$TERMINATOR_UUID" ]; then
exit 0
fi
HOOK_TYPE="$1"
# Function to update tab title
update_title() {
local emoji="$1"
# Use remotinator to update tab title
CURRENT_TITLE=$(remotinator --uuid "$TERMINATOR_UUID" get_tab_title 2>/dev/null | head -n 1)
CLEAN_TITLE=$(printf "%s" "$CURRENT_TITLE" | sed -E 's/^(πŸ”΄|🟒|πŸ”¨) //')
remotinator --uuid "$TERMINATOR_UUID" set_tab_title -t "$emoji $CLEAN_TITLE" >/dev/null 2>&1
}
case "$HOOK_TYPE" in
"UserPromptSubmit")
# Claude is running/processing
paplay /usr/share/sounds/freedesktop/stereo/message.oga 2>/dev/null &
update_title "πŸ”΄"
;;
"Stop")
# Claude finished responding
paplay /usr/share/sounds/freedesktop/stereo/complete.oga 2>/dev/null &
update_title "🟒"
;;
"Notification")
# Tool approval needed
paplay /usr/share/sounds/freedesktop/stereo/dialog-information.oga 2>/dev/null &
update_title "πŸ”¨"
;;
esac
exit 0
{
"env": {},
"includeCoAuthoredBy": false,
"permissions": {
"allow": [],
"deny": []
},
"hooks": {
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/notify.sh UserPromptSubmit"
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/notify.sh Stop"
}
]
}
],
"Notification": [
{
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/notify.sh Notification"
}
]
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment