Back to Hooks

discord-detailed-notifications

NotificationsยทStop

Send detailed Discord notifications with session information and rich embeds

Matcher: *

Configuration

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.

Hook Details


discord-detailed-notifications


Send detailed Discord notifications with session information and rich embeds


Event Configuration


  • **Event Type**: `Stop`
  • **Tool Matcher**: `*`
  • **Category**: notifications

  • Environment Variables


  • `DISCORD_WEBHOOK_URL`

  • Requirements


  • DISCORD_WEBHOOK_URL environment variable

  • Script


    ```bash

    #!/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

    ```

    About Stop Hooks

    Stop hooks run when Claude Code finishes its response. They can perform cleanup or final actions.