Claude Code Channels: How to Connect Your AI Agent to Telegram and Discord
Claude Code Channels adds native Telegram and Discord support so you can text your AI agents like you text people. Here's the setup guide.
Why Keeping Tabs on Your AI Agent Matters
Running Claude Code on a complex task — a full repo audit, a multi-file refactor, a test suite — means waiting. Waiting at a terminal window is wasted time. You want to be doing other things, and hear from the agent when something actually needs your attention.
Claude Code Channels makes that possible. It adds native Telegram and Discord support to Claude Code, so your AI agent can send you updates, ask questions when it gets stuck, and report back when it finishes — through the same apps you already use to message people.
This guide covers how to connect Claude Code to both platforms, from creating the bots to getting your first message through.
What Claude Code Channels Actually Does
Claude Code is Anthropic’s terminal-based AI coding agent. It reads and writes files, runs shell commands, executes tests, and works through multi-step engineering tasks without constant hand-holding.
Claude Code Channels extends this with a messaging layer. Instead of communicating only through a terminal prompt, Claude Code can send and receive messages through Telegram or Discord natively.
A few things this makes easier:
- Long-running tasks — Kick off work and get pinged when it’s done, rather than monitoring a terminal session.
- Team visibility — Route agent output to a shared Discord channel so your whole team sees what the agent is working on.
- Mobile check-ins — Use Telegram to follow along from your phone without touching your laptop.
- Interactive control — In some configurations, you can reply to redirect the agent mid-task, not just receive notifications passively.
The word “channels” here refers to message channels — not separate product tiers or pricing plans.
Prerequisites
Before starting, make sure you have:
- Claude Code installed — Available via npm:
npm install -g @anthropic-ai/claude-code. Use a recent version that includes channel support. - An Anthropic account with Claude Code access enabled.
- A Telegram account if you’re setting up Telegram, or Discord with server admin access if you’re going the Discord route.
- Comfort running commands in a terminal and setting environment variables.
No coding required. The setup is almost entirely configuration.
Set Up the Telegram Integration
Telegram’s bot system is well-documented and straightforward. You’ll create a bot, grab a token, and point Claude Code at it.
Create a Bot with BotFather
Open Telegram and search for @BotFather — Telegram’s official bot management account. Start a conversation and send:
/newbot
BotFather asks for two things: a display name for your bot (like “My Claude Agent”) and a username that ends in bot (like my_claude_agent_bot). Once done, it gives you an API token that looks like this:
110201543:AAHdqTcvCH1vGWJxfSeofSs4tFQHMPOJAoI
Save that. You’ll use it in a moment.
Find Your Chat ID
For Claude Code to message you specifically, it needs your chat ID — not just the bot token.
Start a conversation with your new bot in Telegram (send it any message), then visit this URL in your browser — swapping in your actual token:
https://api.telegram.org/botYOUR_BOT_TOKEN/getUpdates
You’ll see a JSON response. Look for "chat" and then "id" inside it. That number is your chat ID. Write it down.
Configure Claude Code
Set these as environment variables — add them to your .bashrc, .zshrc, or a .env file at your project root:
export CLAUDE_TELEGRAM_TOKEN="your_bot_token_here"
export CLAUDE_TELEGRAM_CHAT_ID="your_chat_id_here"
Variable names and the exact flag syntax for enabling a channel can vary by Claude Code version, so cross-reference these against the current Claude Code documentation from Anthropic. The general pattern for running with a channel specified looks like:
claude --channel telegram "Audit the authentication module and list any security issues"
Test the Connection
Send a simple task. You should get a Telegram message from your bot within seconds. If nothing arrives:
- Confirm the bot token is correct (no extra spaces or line breaks)
- Make sure you sent the bot a message first — Telegram won’t deliver to a chat that hasn’t been initialized by the user
- Double-check that the chat ID matches what appeared in
getUpdates
Set Up the Discord Integration
Discord’s setup has a few more steps, but it’s more flexible — particularly if you want your whole team to see agent activity in a shared channel.
Create a Discord Application
Go to the Discord Developer Portal and click New Application. Name it and click Create. This is the container for your bot.
Add a Bot to the Application
In the left sidebar, go to Bot and click Add Bot. Confirm when prompted.
On the Bot settings page:
- Give it a username if you want a custom name
- Click Reset Token and copy the token it shows you
Treat that token like a password. You won’t be able to see it again after navigating away.
Invite the Bot to Your Server
Go to OAuth2 → URL Generator. Under Scopes, select bot. Under Bot Permissions, enable at minimum:
- Send Messages
- Read Message History
- View Channels
Copy the generated invite URL, paste it into your browser, and add the bot to whichever server you want to use.
Get the Channel ID
In Discord, go to User Settings → Advanced and enable Developer Mode. Now right-click any channel and choose Copy ID. That’s the channel ID Claude Code will post to.
Configure Claude Code
Set these environment variables:
export CLAUDE_DISCORD_TOKEN="your_discord_bot_token"
export CLAUDE_DISCORD_CHANNEL_ID="your_channel_id"
Then run Claude Code pointing at Discord:
claude --channel discord "Review the open pull requests and summarize what each one changes"
Again, check the current Claude Code release notes for exact flag syntax if you run into issues — the channel flag format has been iterated on across versions.
Test It
Watch for a message in your Discord channel. If nothing appears after 30 seconds:
- Confirm the bot was actually invited to the server, not just created in the portal
- Make sure Developer Mode is enabled and the channel ID is right
- Verify the bot has permission to post in that specific channel (channel-level permissions override server-level ones)
Practical Ways to Use This
Once the connection is live, a handful of workflows become genuinely useful.
Async Code Review
Start a review task before a meeting and get the results in Telegram when you’re done:
claude --channel telegram "Review the last 15 commits and flag anything that looks like a bug or a security issue"
You come back to a structured summary, not an open terminal.
Team-Wide Agent Logs
Set up a #claude-updates Discord channel. Route all agent activity there so anyone on the team can see what the agent has been doing — useful for distributed teams running Claude Code against shared repositories or staging environments.
Mobile Check-ins
Telegram is genuinely good on mobile. If you’re running a long infrastructure task — setting up an environment, running a migration, generating documentation — you can step away and get pinged when it needs input or finishes. No laptop needed.
Alert-Only Notifications
Rather than sending constant progress updates, configure Claude Code to only message the channel when it completes a task or hits an error. Less noise. You stay informed when it actually matters.
Common Issues and How to Fix Them
Bot not sending messages in Telegram
Almost always a chat ID issue, or the chat hasn’t been initialized. Send your bot any message in Telegram first, then re-run getUpdates to confirm the chat ID.
Discord bot appears offline or absent Creating the application in the Developer Portal is not the same as inviting the bot to your server. You must complete the OAuth invite step. Re-run the URL Generator flow and authorize for your specific server.
Messages arrive but Claude doesn’t respond to replies One-way notification mode (Claude sends, you receive) is the default simpler setup. Bidirectional control — where your replies redirect the agent — requires additional configuration. Check the Claude Code docs for interactive channel mode.
Environment variables not being picked up
If you added variables to .bashrc or .zshrc, restart your terminal or run source ~/.zshrc to reload without restarting. Variables set in a .env file also need to be explicitly loaded if you’re not using a tool that does this automatically.
Rate limit errors on either platform Both Telegram and Discord enforce API rate limits. For tasks that generate very frequent updates, Claude Code may queue or drop messages. Lower the update frequency in your configuration if this becomes a problem.
How MindStudio Approaches the Same Problem
Claude Code Channels is a developer-oriented setup. It assumes you’re comfortable with the terminal, environment variables, and bot registration. For teams who want similar agent-to-messaging functionality without the configuration overhead — or who want to extend it further — MindStudio offers a different angle.
MindStudio is a no-code platform for building and deploying AI agents. You can connect agents to Discord, Slack, and other messaging platforms through its integration layer, without manually managing bot tokens or writing shell scripts. The platform handles authentication, retries, and message routing.
The practical difference: Claude Code Channels adds a messaging layer to an existing CLI agent. MindStudio lets you build a standalone agent — one that monitors a GitHub repo, reviews PRs, and posts summaries to a Discord channel — as a complete, self-contained workflow.
If you’re already using Claude Code and want to extend it with external capabilities (sending emails, searching the web, calling CRMs, generating images), the MindStudio Agent Skills Plugin gives Claude Code access to 120+ typed capabilities as simple method calls like agent.sendEmail() or agent.searchGoogle(). It handles the infrastructure layer so Claude Code can stay focused on reasoning.
For teams building AI agents that go beyond code review — customer support bots, content pipelines, automated reporting — MindStudio’s visual builder is worth a look. You can try it free at mindstudio.ai.
Frequently Asked Questions
Does Claude Code support messaging platforms other than Telegram and Discord?
Natively, no. The Claude Code Channels feature ships with Telegram and Discord support. For platforms like Slack or Microsoft Teams, you’d need a custom integration via Claude Code’s API layer, or a tool like MindStudio that has pre-built connectors for those services.
Can I reply to Claude through Telegram or Discord to redirect it mid-task?
It depends on your configuration. One-way mode — Claude sends, you receive — works with the basic setup. Bidirectional mode, where your replies are treated as new instructions, requires additional configuration and is outlined in the Claude Code documentation. Most users start with one-way notifications.
Are bot tokens secure? What should I be careful about?
Bot tokens are credentials — treat them like passwords. Never commit them to a public repository. Store them in environment variables or a secrets manager, not in plaintext files. If a Telegram token is exposed, regenerate it via BotFather. Discord tokens can be reset in the Developer Portal. Both are immediate and simple to do.
Do I need a paid Anthropic plan to use Claude Code Channels?
Claude Code uses the Anthropic API, which is usage-based. Claude Code Channels is part of Claude Code’s standard feature set, not a separate paid add-on. That said, long-running or frequent tasks will consume API credits — check current Anthropic pricing for the model you’re running.
Can I run Telegram and Discord at the same time?
Yes. You can configure both sets of environment variables and run separate tasks through each channel concurrently. Routing the same task to both channels simultaneously is technically possible but rarely useful. More common is using each channel for different types of tasks or different team audiences.
What happens to messages if the connection drops mid-task?
Claude Code continues executing the task on your local machine (or wherever you’re running it), but message delivery may fail during a connection drop. Messages don’t automatically queue and re-send in all cases — behavior depends on your Claude Code version and network handling. For critical tasks, set up a fallback logging mechanism in addition to the channel integration.
Key Takeaways
- Claude Code Channels adds native Telegram and Discord support, so you get agent updates through messaging apps rather than a terminal.
- Telegram setup requires BotFather to create a bot, a
getUpdatescall to find your chat ID, and two environment variables. - Discord setup involves the Developer Portal, a bot invite via OAuth, and grabbing a channel ID with Developer Mode enabled.
- Use cases include async code review, team-wide agent logs, mobile check-ins, and error-only alert notifications.
- Most issues come down to wrong tokens, skipped bot invite steps, or chats that haven’t been initialized.
- For no-code agent-to-messaging workflows, or to extend Claude Code with additional capabilities, MindStudio provides a ready-built integration layer that handles the infrastructure for you.