Skip to content

Instantly share code, notes, and snippets.

@jeremynsl
Last active July 18, 2025 03:30
Show Gist options
  • Save jeremynsl/b7928e126d1bb5c4a51164f75ac643dc to your computer and use it in GitHub Desktop.
Save jeremynsl/b7928e126d1bb5c4a51164f75ac643dc to your computer and use it in GitHub Desktop.
Claude Code Pushover Notifications
#!/bin/bash
LOG_FILE="/tmp/claude_notification_input.log"
STDIN_DATA=$(cat)
echo "--- Start of Notification ---" >> "$LOG_FILE"
echo "$STDIN_DATA" >> "$LOG_FILE"
echo "--- End of Notification ---" >> "$LOG_FILE"
NOTIFICATION_MESSAGE=$(echo "$STDIN_DATA" | jq -r '.message')
# you can add ntfy, sendgrid emails or whatever type of notifications you like by changing the endpoint. This is pushover as an example.
if [[ -z "$NOTIFICATION_MESSAGE" || "$NOTIFICATION_MESSAGE" == "null" ]]; then
curl -s \
-F "token=yourtoken" \
-F "user=youruser" \
-F "message=Claude has stopped and requires input" \
https://api.pushover.net/1/messages.json
else
# Now, execute the curl command with the extracted message
curl -s \
-F "token=yourtoken" \
-F "user=youruser" \
-F "message=Claude: $NOTIFICATION_MESSAGE" \
https://api.pushover.net/1/messages.json\
fi
{
"hooks": {
"Notification": [
{
"hooks": [
{
"type": "command",
"command": "/home/yourname/.claude/send_notification.sh"
}
]
}
]
,
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "/home/yourname/.claude/send_notification.sh"
}
]
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment