discord-detailed-notifications · Hooks for Claude Code | Prompt Studio
    1. Claude Code
    2. Hooks
    3. discord-detailed-notifications
    Claude Code · HooksSessionStart

    discord-detailed-notifications

    Send detailed Discord notifications with session information when Claude Code finishes.

    by davila7/claude-code-templates

    SessionStartStop

    License: MITView original

    Installation

    npx claude-code-templates@latest --hook automation/discord-detailed-notifications

    Contents

    Where it goes: .claude/settings.json

    {
      "hooks": {
        "SessionStart": [
          {
            "matcher": "startup",
            "hooks": [
              {
                "type": "command",
                "command": "if [[ -n \"$DISCORD_WEBHOOK_URL\" ]]; then echo \"$(date +%s)\" > ~/.claude/session_start.tmp; PROJECT_DIR=\"$(basename \"$(pwd)\")\"; MESSAGE='{\"embeds\":[{\"title\":\"🚀 Claude Code Session Started\",\"color\":3447003,\"fields\":[{\"name\":\"📁 Project\",\"value\":\"'\"$PROJECT_DIR\"'\",\"inline\":true},{\"name\":\"⏰ Time\",\"value\":\"'\"$(date '+%H:%M:%S')\"'\",\"inline\":true},{\"name\":\"📅 Date\",\"value\":\"'\"$(date '+%Y-%m-%d')\"'\",\"inline\":true}],\"timestamp\":\"'\"$(date -u +%Y-%m-%dT%H:%M:%S.000Z)\"'\"}]}'; curl -s -X POST \"$DISCORD_WEBHOOK_URL\" -H \"Content-Type: application/json\" -d \"$MESSAGE\" >/dev/null 2>&1; fi"
              }
            ]
          }
        ],
        "Stop": [
          {
            "hooks": [
              {
                "type": "command",
                "command": "if [[ -n \"$DISCORD_WEBHOOK_URL\" ]]; then END_TIME=\"$(date +%s)\"; if [[ -f ~/.claude/session_start.tmp ]]; then START_TIME=\"$(cat ~/.claude/session_start.tmp)\"; DURATION=\"$((END_TIME - START_TIME))\"; MINUTES=\"$((DURATION / 60))\"; SECONDS=\"$((DURATION % 60))\"; DURATION_TEXT=\"${MINUTES}m ${SECONDS}s\"; rm -f ~/.claude/session_start.tmp; else DURATION_TEXT=\"Unknown\"; fi; PROJECT_DIR=\"$(basename \"$(pwd)\")\"; MEMORY_MB=\"$(ps -o rss= -p $$ 2>/dev/null | awk '{print int($1/1024)}' || echo 'N/A')\"; MESSAGE='{\"embeds\":[{\"title\":\"✅ Claude Code Session Completed\",\"color\":5763719,\"fields\":[{\"name\":\"📁 Project\",\"value\":\"'\"$PROJECT_DIR\"'\",\"inline\":true},{\"name\":\"⏱️ Duration\",\"value\":\"'\"$DURATION_TEXT\"'\",\"inline\":true},{\"name\":\"💾 Memory Used\",\"value\":\"'\"${MEMORY_MB}\"'MB\",\"inline\":true},{\"name\":\"⏰ Finished\",\"value\":\"'\"$(date '+%H:%M:%S')\"'\",\"inline\":true},{\"name\":\"📅 Date\",\"value\":\"'\"$(date '+%Y-%m-%d')\"'\",\"inline\":true}],\"timestamp\":\"'\"$(date -u +%Y-%m-%dT%H:%M:%S.000Z)\"'\"}]}'; curl -s -X POST \"$DISCORD_WEBHOOK_URL\" -H \"Content-Type: application/json\" -d \"$MESSAGE\" >/dev/null 2>&1 || echo \"Failed to send detailed Discord notification\"; else echo \"⚠️ Detailed Discord notification skipped: Set DISCORD_WEBHOOK_URL\"; fi"
              }
            ]
          }
        ]
      }
    }
    

    More in Hooks

    • Format on edit

      Runs Prettier on every file Claude edits or creates.

    • Block .env files

      Prevents Claude from reading or editing secret files.

    • Notify when done

      macOS desktop notification when Claude finishes.

    • Typecheck on edit

      Runs tsc after editing TypeScript files and shows the errors.

    • Session context

      Loads the branch and latest commits when a session starts.

    • Command log

      Saves every shell command to an audit log.

    See all in Hooks (621) →

    Your ultimate collection of AI prompts. Gather inspiration, explore examples, and create with AI.

    Main hubs

    • Prompts
    • Images
    • Videos
    • Generate Videos
    • Templates
    • Animations
    • Prices
    • About
    • Affiliate

    Browse by type

    • Component kits
    • Image Tags
    • Video Tags
    • Webs

    Popular topics

    • Music
    • Portfolio
    • Gaming
    • Travel
    • Nano Banana Pro

    Legal

    • Terms of Use
    • Privacy Policy
    • Cookie Policy
    • Licenses Policy
    • Refund Policy
    • Affiliate Program Terms
    • Crowdfunding Terms

    Magzin LLC, 800 Third Avenue Associates, New York, NY, 10022, United States

    © 2026 Prompt Studio by Magzin. All rights reserved.