Telegram channel plugin for Claude Code with forum topic routing
npx claudepluginhub behindthebeat/claude-telegram-topicsTelegram channel for Claude Code — messaging bridge with built-in access control and topic-based session routing.
Connect a Telegram bot to Claude Code. Messages to the bot are forwarded to your Claude Code session; Claude replies through the bot.
Supports DMs, group chats, and forum topics — each topic can route to a separate Claude Code session working in a different project.
curl -fsSL https://bun.sh/install | bashClaude Code's channel allowlist currently only permits plugins from the official marketplace (claude-plugins-official). Since this plugin is distributed through a self-hosted marketplace, you need to install both the official telegram plugin (for allowlist access) and this plugin (for the actual code).
/plugin install telegram@claude-plugins-official
/plugin marketplace add focus7eleven/claude-telegram-topics
/plugin install telegram@claude-telegram-topics
The official plugin provides the channel permission. Our plugin provides the actual code and automatically patches the official plugin's cache on every session start — no manual steps needed.
Why two plugins? Claude Code's channel allowlist only permits plugins from the official marketplace. Until this plugin is accepted there, we need the official plugin as a shim. Once accepted, you'll only need one install.
Open @BotFather on Telegram, send /newbot, copy the token.
/telegram-topics:configure 123456789:AAHfiqksKZ8...
claude --channels plugin:telegram@claude-plugins-official
DM your bot on Telegram — it replies with a 6-character code. In Claude Code:
/telegram-topics:access pair <code>
Done. Your messages now reach the assistant.
Switch to allowlist so strangers don't get pairing prompts:
/telegram-topics:access policy allowlist
Each forum topic can route to a separate Claude Code session:
Telegram Group
├── Topic: project-a → Claude Code session A
├── Topic: project-b → Claude Code session B
└── DMs → Claude Code session C (catch-all)
A router daemon auto-starts in the background when the first session launches. Subsequent sessions connect to it automatically. No manual daemon management.
1. Prepare the group.
/setprivacy → Disable. Without this, Telegram's server-side filter only delivers @mentions and direct replies to the bot.2. Find your group's chat ID.
| Method | How |
|---|---|
| Telegram Web | Open the group in web.telegram.org. The URL looks like https://web.telegram.org/a/#-100XXXXXXXXXX. The number after # (including the -) is your chat ID. |
| @RawDataBot | Add @RawDataBot to the group, send any message, it replies with the chat ID. Remove the bot afterwards. |
3. Configure the group.
/telegram-topics:configure group -100XXXXXXXXXX
This saves the chat ID to .env and adds the group to the access list. By default, the bot only responds to @mentions in the group. To respond to all messages (recommended for topic mode):
/telegram-topics:access group add -100XXXXXXXXXX --no-mention
4. Find topic IDs.
| Method | How |
|---|---|
| Topic link | Right-click a topic → Copy Link. URL: https://t.me/c/XXXXXXXXXX/42 — the last number (42) is the thread ID. |
| Topic name | Use the topic name instead of numeric ID. The router resolves names after seeing at least one message in that topic. |
/telegram-topics:configure topics | Lists all discovered topics with IDs and names. |
Note: The "General" topic may not carry a thread ID in Bot API. Use named topics.
5. Start sessions.
# Specific topic (by ID or name)
TELEGRAM_TOPIC_ID=42 claude --channels plugin:telegram@claude-plugins-official
TELEGRAM_TOPIC_ID=my-topic claude --channels plugin:telegram@claude-plugins-official
# Catch-all (DMs + all unmatched topics)
claude --channels plugin:telegram@claude-plugins-official
To avoid being prompted for permission on every reply, add this to ~/.claude/settings.json:
{
"permissions": {
"allow": [
"mcp__plugin_telegram_telegram__reply",
"mcp__plugin_telegram_telegram__react",
"mcp__plugin_telegram_telegram__edit_message",
"mcp__plugin_telegram_telegram__create_forum_topic"
]
}
}