Claude Code alerts in Telegram, Slack or Discord

Updated

Quick answer

A hook can post Claude Code alerts to a chat you already read: a Telegram bot, a Slack incoming webhook or a Discord webhook each take one curl call. Claude Code’s channels feature also connects a session to Telegram or Discord through a plugin. A webhook alert is one-way: it tells you Claude is waiting, and you answer at the keyboard.

One script, three destinations

Claude Code runs a Stop hook each time Claude finishes responding, and a Notification hook when it waits for you. Both hand the hook a JSON object on standard input with the session’s folder, and either Claude’s last message or the reason it is waiting. One script can turn that into a line of text and post it wherever you keep a destination set up:

Save as ~/.claude/hooks/chat.sh, then chmod +x it

#!/bin/sh
# Claude Code hook: post an alert to Telegram, Slack and/or Discord. Reads the hook JSON on stdin.
. ~/.config/claude-alerts/env 2>/dev/null
input=$(cat)
project=$(basename "$(printf '%s' "$input" | jq -r '.cwd')")
if [ "$(printf '%s' "$input" | jq -r '.hook_event_name')" = "Stop" ]; then
  text="Claude Code finished in $project: $(printf '%s' "$input" | jq -r '.last_assistant_message // ""' | head -c 300)"
else
  text="Claude Code needs you in $project: $(printf '%s' "$input" | jq -r '.message // ""')"
fi
if [ -n "$TELEGRAM_TOKEN" ]; then
  curl -s -m 5 "https://api.telegram.org/bot$TELEGRAM_TOKEN/sendMessage" \
    --data-urlencode "chat_id=$TELEGRAM_CHAT_ID" --data-urlencode "text=$text" >/dev/null
fi
if [ -n "$SLACK_WEBHOOK" ]; then
  jq -nc --arg t "$text" '{text:$t}' | curl -s -m 5 -H 'content-type: application/json' -d @- "$SLACK_WEBHOOK" >/dev/null
fi
if [ -n "$DISCORD_WEBHOOK" ]; then
  jq -nc --arg t "$text" '{content:$t}' | curl -s -m 5 -H 'content-type: application/json' -d @- "$DISCORD_WEBHOOK" >/dev/null
fi
exit 0

Merge into ~/.claude/settings.json

{
  "hooks": {
    "Stop": [
      { "hooks": [{ "type": "command", "command": "~/.claude/hooks/chat.sh", "async": true }] }
    ],
    "Notification": [
      { "matcher": "permission_prompt|elicitation_dialog",
        "hooks": [{ "type": "command", "command": "~/.claude/hooks/chat.sh", "async": true }] }
    ]
  }
}

The secrets live in ~/.config/claude-alerts/env, outside any repository, readable by you only (chmod 600). Fill in the destinations you use and leave the others out:

~/.config/claude-alerts/env

TELEGRAM_TOKEN="paste the token from BotFather"
TELEGRAM_CHAT_ID="paste your chat id"
SLACK_WEBHOOK="paste the Slack webhook URL"
DISCORD_WEBHOOK="paste the Discord webhook URL"

Run /hooks in Claude Code to check both events list the script. async keeps Claude from waiting on the network.

A Telegram bot

In Telegram, open BotFather, send /newbot, and give the bot a name and a username ending in bot. BotFather replies with a token: that is TELEGRAM_TOKEN. Send any message to your new bot, then open https://api.telegram.org/bot<token>/getUpdates in a browser; the number under chat → id is TELEGRAM_CHAT_ID. The bot can now write to you, and only to chats that have written to it first.

The token lets anyone who has it send as your bot and read what is sent to it. Treat it like a password.

Slack and Discord webhooks

A webhook is a URL that posts into one channel. In Slack, create an app for your workspace, turn on Incoming Webhooks, add one for the channel you want, and copy its URL. In Discord, open the channel’s settings, then Integrations › Webhooks › New Webhook, and copy its URL. Slack expects a JSON body with text, Discord one with content; the script sends both shapes.

A webhook URL is a secret too: anyone who has it can post in that channel. A private channel of your own, or a direct message, keeps project details away from colleagues who don’t need them.

Claude Code channels

Channels go further than a webhook. A channel is an MCP server, installed as a plugin, that connects a running session to a chat: messages you send arrive in the session, and Claude can reply through the same chat. As of 17 November 2026, channels are a research preview with plugins for Telegram, Discord and iMessage, not Slack. The setup for Telegram, from Anthropic’s docs:

In Claude Code, then restart it with the channel

/plugin install telegram@claude-plugins-official
/telegram:configure <token>
claude --channels plugin:telegram@claude-plugins-official

You then pair your Telegram account with a code the bot sends you. A channel can also relay permission prompts, so you can approve or deny from the chat while the terminal dialog stays open; the first answer applies. The Telegram and Discord plugins declare that capability in their source. Anthropic’s docs warn that anyone allowed to reply through the channel can approve or deny tool use, so keep the allowlist to yourself.

The conditions: plugins need Bun; channels need Anthropic authentication through claude.ai or a Console API key and are not available on Amazon Bedrock, Google Cloud’s Agent Platform or Microsoft Foundry; Team and Enterprise organizations must enable them; and events reach only a session started with --channels and still open.

One-way or two-way

The webhook script is one-way: it tells you Claude finished or is waiting, and you go back to the keyboard to act. Channels are two-way, within the preview’s limits above. Monish is another two-way route, on the iPhone lock screen rather than in a chat: a permission request arrives with the exact command and Allow and Deny, a question with its options, and a reply to a finished turn becomes Claude’s next instruction. It runs through Claude Code’s hooks, so it works with any sign-in, including an API key or a cloud provider. Monish is free, needs no account, and pairs with curl -fsSL https://monish.cc/install.sh | sh -s and the 6-digit code from the app. Your chat alerts can stay alongside it.

Questions

Can I approve a Claude Code permission from Telegram?
Not with a webhook or a bot that only sends. With Claude Code’s Telegram channel plugin, yes: it relays permission prompts to the chat, and the first answer, from the terminal or from Telegram, applies.
Does Slack have a Claude Code channel?
Not in the channels research preview, which has plugins for Telegram, Discord and iMessage. For Slack, an incoming webhook from a hook is the way to get alerts.
Where should I keep the tokens and webhook URLs?
In a file outside your repositories, readable only by you, such as ~/.config/claude-alerts/env with chmod 600. Never in a project’s .claude/settings.json, which is often committed.
Will this post after every reply?
With a Stop hook, yes: it runs each time Claude finishes responding. Keep only the Notification hook if you want a message when Claude is blocked.

More guides

New to Monish? The home page shows what lands on your iPhone, and all guides are listed here.

Get Monish on your iPhone

Free, no account. Your 6-digit code is waiting in the app.

Download on the App Store