Send detailed Discord notifications with session information and rich embeds
*Add to your .claude/settings.json:
{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "command",
"command": ".claude/hooks/discord-detailed-notifications.sh"
}
]
}
]
}
}This hook includes a script file. Download the ZIP bundle for complete installation with script and instructions.
Send detailed Discord notifications with session information and rich embeds
#!/bin/bash
if [[ -z "$DISCORD_WEBHOOK_URL" ]]; then
exit 0
fi
session_id="${CLAUDE_SESSION_ID:-unknown}"
timestamp=$(date '+%Y-%m-%d %H:%M:%S')
payload=$(jq -n \
--arg title "Claude Code Session Complete" \
--arg desc "Session finished at $timestamp" \
--arg session "Session: $session_id" \
'{
"embeds": [{
"title": $title,
"description": $desc,
"color": 5814783,
"fields": [{"name": "Session ID", "value": $session, "inline": true}],
"timestamp": (now | todate)
}]
}')
curl -s -X POST "$DISCORD_WEBHOOK_URL" \
-H "Content-Type: application/json" \
-d "$payload" >/dev/null 2>&1
Stop hooks run when Claude Code finishes its response. They can perform cleanup or final actions.