Claude Code notifications to Discord with a webhook
Updated 2026-12-04
If you already live in Discord, a channel webhook is the quickest way to get Claude Code notifications on your phone: the Discord app pushes every message. You create a webhook, then a hook posts to it with curl.
Step 1: create a webhook
In Discord, open the channel's settings, go to Integrations, then Webhooks, and create a new webhook. Copy its URL. It looks like https://discord.com/api/webhooks/ID/TOKEN. Treat it as a secret: anyone with the URL can post to your channel.
Step 2: add the hooks
Put this in your user settings file, ~/.claude/settings.json, not in a project file you commit to git. Replace the URL with yours.
{
"hooks": {
"Stop": [
{ "hooks": [ { "type": "command", "command": "curl -s -H 'Content-Type: application/json' -d '{\"content\":\"Claude Code is done\"}' https://discord.com/api/webhooks/ID/TOKEN" } ] }
]
}
}
Add the same block under "Notification" with the message "Claude Code is waiting for you" to also hear about questions and permission requests. Restart your Claude Code session afterwards.
These commands assume a POSIX shell (macOS, Linux, WSL, Git Bash). On plain Windows, use curl.exe and put the JSON in a file: curl.exe -s -H "Content-Type: application/json" -d @payload.json URL.
The catches
- Every reply posts a message.
Stopfires after each response, so short tasks flood the channel. Skipping them needs a script that compares the prompt start time (theUserPromptSubmithook) with the finish time. - One channel is not a notifier. Discord does not tell "done" from "waiting" apart by sound, and notifications from a busy server can be muted or buried.
- The webhook URL is a password. Do not commit it. If it leaks, delete the webhook and make a new one.
Prefer a dedicated app that handles short tasks, quiet hours and per-type sounds? See InstantPing vs ntfy or the phone options compared.
Frequently asked questions
How do I send Claude Code notifications to Discord?
Create a webhook in a Discord channel, then add a Stop hook to ~/.claude/settings.json whose command posts JSON with a content field to the webhook URL using curl.
Is it safe to put a Discord webhook in Claude Code settings?
Only in your user settings file, never in a project file that goes to git. Anyone with the webhook URL can post to the channel, so delete and recreate it if it leaks.
Does it skip short Claude Code tasks?
No. The basic hook posts after every response. Skipping short tasks needs a script that records the prompt start time and compares it on Stop.