Back to all articles
10 MIN READ

Claude Code Channels: Control Your AI Coding Agent via Telegram & Discord

By Learnia AI Research Team

Claude Code Channels: Control Your AI Agent from Telegram & Discord

Anthropic just released Claude Code Channels — a research preview feature that lets you push messages, alerts, and webhooks directly into your running Claude Code session from external platforms like Telegram and Discord.

Instead of being chained to your terminal, you can now message Claude Code from your phone, forward CI failures automatically, or bridge monitoring alerts — all through the Model Context Protocol (MCP).


1. What Are Claude Code Channels?

A channel is an MCP server that pushes events into your running Claude Code session. Unlike regular MCP tools that Claude actively calls, channels are reactive: external events arrive and Claude responds to them in real time.

Channels can be one-way (alerts and webhooks that Claude reads and acts on) or two-way (chat bridges where Claude can reply back through the same platform).

What's Included in the Research Preview

ChannelTypeUse Case
TelegramTwo-wayMessage Claude Code from your phone
DiscordTwo-wayTeam collaboration with Claude Code
FakechatTwo-wayLocal demo UI on localhost
Custom webhookOne-way or two-wayCI, monitoring, any HTTP POST

Requirements: Claude Code v2.1.80+, claude.ai login (Pro/Max/Team/Enterprise). API key auth is not supported. Team/Enterprise orgs must have channels enabled by an admin.


2. How Channels Work: Architecture

When you start Claude Code with --channels, it spawns your channel plugin as a subprocess and communicates with it over stdio. The channel server bridges the gap between external platforms and your local session.

Loading diagram…

The key insight is that everything runs locally. Your channel plugin runs on your machine, polls the external platform's API, and forwards messages to Claude via MCP notifications. No URLs to expose, no servers to deploy.


3. Quick Start: Fakechat Demo

Before connecting Telegram or Discord, try the built-in fakechat demo. It runs a chat UI on localhost — nothing to authenticate, no external service needed.

Prerequisites

  • Claude Code installed and authenticated with a claude.ai account
  • Bun installed (channel plugins are Bun scripts)

Step-by-Step Setup

1. Install the fakechat plugin:

# Inside a Claude Code session
/plugin install fakechat@claude-plugins-official

2. Restart with the channel enabled:

claude --channels plugin:fakechat@claude-plugins-official

3. Open the chat UI at http://localhost:8787 and send a message:

hey, what's in my working directory?

The message arrives in your Claude Code session wrapped in a <channel> tag. Claude reads it, does the work, and replies back through the chat UI.


4. Set Up Telegram Channel

This is where Channels get really powerful — code from anywhere by messaging your Telegram bot.

Step 1: Create a Telegram Bot

  1. Open BotFather in Telegram
  2. Send /newbot
  3. Give it a display name and a unique username ending in bot
  4. Copy the token BotFather returns

Step 2: Install and Configure

# In Claude Code
/plugin install telegram@claude-plugins-official

# Configure with your bot token
/telegram:configure <YOUR_BOT_TOKEN>

This saves the token to .claude/channels/telegram/.env. You can also set TELEGRAM_BOT_TOKEN in your shell environment.

Step 3: Launch with Channels

claude --channels plugin:telegram@claude-plugins-official

Step 4: Pair Your Account

  1. Open Telegram and send any message to your bot
  2. The bot replies with a pairing code
  3. In Claude Code, run:
/telegram:access pair <code>
  1. Lock down access:
/telegram:access policy allowlist

Now only your Telegram account can push messages to Claude. Anyone else is silently dropped.


5. Set Up Discord Channel

The Discord setup follows the same pattern as Telegram.

Step 1: Create a Discord Bot

  1. Go to the Discord Developer Portal
  2. Create a new application
  3. Go to BotAdd Bot
  4. Copy the bot token
  5. Enable Message Content Intent under Privileged Intents
  6. Invite the bot to your server with proper permissions

Step 2: Install, Configure, and Launch

# In Claude Code
/plugin install discord@claude-plugins-official

# Configure with your bot token
/discord:configure <YOUR_BOT_TOKEN>

# Launch with channel
claude --channels plugin:discord@claude-plugins-official

Step 3: Pair

DM your bot on Discord, get the pairing code, then:

/discord:access pair <code>
/discord:access policy allowlist

Multiple channels: You can pass several plugins to --channels, space-separated:

claude --channels plugin:telegram@claude-plugins-official plugin:discord@claude-plugins-official

6. Build a Custom Webhook Channel

The real power of Channels is that any system that can send an HTTP POST can push events to Claude. Here's how to build a webhook receiver in a single file.

Minimal One-Way Channel

Create a file called webhook.ts:

#!/usr/bin/env bun
import { Server } from '@modelcontextprotocol/sdk/server/index.js'
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'

const mcp = new Server(
  { name: 'webhook', version: '0.0.1' },
  {
    capabilities: { experimental: { 'claude/channel': {} } },
    instructions: 'Events from the webhook channel arrive as <channel source="webhook">. Read and act on them.',
  },
)

await mcp.connect(new StdioServerTransport())

Bun.serve({
  port: 8788,
  hostname: '127.0.0.1',
  async fetch(req) {
    const body = await req.text()
    await mcp.notification({
      method: 'notifications/claude/channel',
      params: {
        content: body,
        meta: { path: new URL(req.url).pathname, method: req.method },
      },
    })
    return new Response('ok')
  },
})

Register in .mcp.json

{
  "mcpServers": {
    "webhook": { "command": "bun", "args": ["./webhook.ts"] }
  }
}

Test It

# Start Claude Code (custom channels need the dev flag during preview)
claude --dangerously-load-development-channels server:webhook

# In another terminal, simulate a CI failure
curl -X POST localhost:8788 -d "build failed on main: https://ci.example.com/run/1234"

The payload arrives in Claude's context as:

<channel source="webhook" path="/" method="POST">
  build failed on main: https://ci.example.com/run/1234
</channel>

Claude sees it and starts investigating — reading files, running commands, whatever the alert calls for.


7. Real-World Use Cases

CI/CD Pipeline Alerts

Push build failures directly to Claude for automatic investigation:

# In your CI pipeline (GitHub Actions, GitLab CI, etc.)
curl -X POST localhost:8788 \
  -d "Build #${BUILD_NUMBER} failed: ${BUILD_URL}"

Claude receives the alert and can immediately start debugging — reading logs, checking recent commits, and suggesting fixes.

Monitoring & Alerting

Forward production alerts so Claude can analyze them while you're away:

# From your monitoring system
curl -X POST localhost:8788 \
  -H "Content-Type: text/plain" \
  -d "ALERT: Memory usage > 90% on prod-server-3. Last 5 min trend: 85%, 87%, 89%, 91%, 92%"

Team Collaboration via Discord

Set up a dedicated Discord channel where team members can assign tasks to Claude:

  • "Claude, review the PR at #1234 and check for security issues"
  • "Run the test suite and report failures"
  • "What changed in the auth module since last deploy?"

Mobile Development Workflow

Message Claude from your phone via Telegram while commuting:

  • "Start a new feature branch for the user preferences page"
  • "What tests are currently failing?"
  • "Commit and push the current changes with a descriptive message"

8. Enterprise Controls

For Team and Enterprise plans, admins control channel availability through the channelsEnabled setting in managed settings. Once enabled, individual users opt in per session with --channels.

Being in .mcp.json is not enough to push messages — a server must also be named in --channels.


9. Channels vs OpenClaw: The Competition

Claude Code Channels arrives as a direct competitor to OpenClaw (formerly Clawd), the popular open-source project that lets you control Claude Code from messaging platforms. Key differences:

Claude Code ChannelsOpenClaw
SourceOfficial Anthropic featureOpen-source community project
PlatformsTelegram, Discord (research preview)Telegram, Discord, Slack, more
IntegrationBuilt into Claude Code via --channelsExternal wrapper around Claude Code
SecuritySender allowlist with pairing flowCommunity-maintained
Custom channelsBuild any MCP serverPlugin architecture
StatusResearch preview (may change)Production-ready

10. Key Limitations & What's Next

Since this is a research preview, keep these limitations in mind:

  • Session must be running: Events only arrive while Claude Code is active. For always-on setups, use a persistent terminal (tmux, screen) or background process
  • Approved allowlist only: During the preview, --channels only accepts plugins from the Anthropic-maintained allowlist. Custom channels require --dangerously-load-development-channels
  • Authentication: Requires claude.ai login. Console and API key auth are not supported
  • Permission prompts: If Claude hits a permission prompt while you're away, the session pauses until you approve locally
  • Syntax may change: The --channels flag syntax and protocol contract may evolve based on feedback

GO DEEPER — FREE GUIDE

Module 0 — Prompting Fundamentals

Build your first effective prompts from scratch with hands-on exercises.

Newsletter

Weekly AI Insights

Tools, techniques & news — curated for AI practitioners. Free, no spam.

Free, no spam. Unsubscribe anytime.

FAQ

What are Claude Code Channels?+

Claude Code Channels is a research preview feature (v2.1.80+) that lets MCP servers push messages, alerts, and webhooks into your running Claude Code session. It currently supports Telegram, Discord, and custom webhook channels.

How do I set up Claude Code Channels with Telegram?+

Create a bot via BotFather, install the Telegram plugin with '/plugin install telegram@claude-plugins-official', configure your token with '/telegram:configure <token>', then restart Claude Code with '--channels plugin:telegram@claude-plugins-official'.

Is Claude Code Channels free?+

Channels require a claude.ai login (Pro, Max, Team, or Enterprise). Console and API key authentication is not supported. Team and Enterprise organizations must have their admin enable channels.

Can I build my own custom Claude Code Channel?+

Yes. A channel is any MCP server that declares the 'claude/channel' capability. You can build one-way channels for webhooks/alerts or two-way channels with reply tools. Use '--dangerously-load-development-channels' to test custom channels during the research preview.

What is the difference between Claude Code Channels and Remote Control?+

Remote Control bridges your terminal session to claude.ai for browser or phone access. Channels forward external events (chat messages, CI alerts, webhooks) into your session via MCP servers, enabling Claude to react to things happening outside the terminal.

Do Claude Code Channels work in the background?+

Events only arrive while the session is open. For always-on setups, run Claude Code in a background process or persistent terminal (e.g., tmux or screen).