By mahi97
Patched Telegram channel plugin for Claude Code — PID lock, reply-to context, improved error handling
npx claudepluginhub mahi97/claude-telegram-plugin --plugin telegramManage Telegram channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed, or change policy for the Telegram channel.
Set up the Telegram channel — save the bot token and review access policy. Use when the user pastes a Telegram bot token, asks to configure Telegram, asks "how do I set this up" or "who can reach me," or wants to check channel status.
Patched fork of telegram@claude-plugins-official with fixes for multi-session stability and reply-to context.
| Feature | Official | This Fork |
|---|---|---|
| Multiple sessions | Compete for messages, random delivery | PID lock — first instance polls, others serve tools only |
| Agent Team support | Teammates spawn competing bots | PID lock prevents conflicts automatically |
| Reply-to context | Not passed to Claude | reply_to_message_id + reply_to_text included in channel meta |
| Network errors | 409-only retry (fixed in v0.0.6) | All-error retry (inherited from v0.0.6) |
| State directory | Always ~/.claude/channels/telegram/ | Auto-detects project-level .claude/telegram/ |
| First-run setup | Manual dir creation + file editing | Auto-creates dirs, guides with /telegram:configure |
Based on official v0.0.6. See upstream issues: #38098, #39876.
curl -fsSL https://bun.sh/install | bash1. Create a bot with @BotFather.
Send /newbot, pick a name and username. Copy the token (123456789:AAH...).
2. Add the marketplace to your project.
In your project's .claude/settings.json:
{
"extraKnownMarketplaces": {
"mahi97-telegram": {
"source": {
"source": "github",
"repo": "mahi97/claude-telegram-plugin"
}
}
},
"enabledPlugins": {
"telegram@mahi97-telegram": true
}
}
Or add it globally in ~/.claude/settings.json if you want it in all projects.
3. Start Claude Code with the channel flag.
claude --channels plugin:telegram@mahi97-telegram
The plugin auto-creates .claude/telegram/ in your project. On first run it prints:
telegram channel: TELEGRAM_BOT_TOKEN required
Run: /telegram:configure <token>
4. Configure the token.
/telegram:configure 123456789:AAHfiqksKZ8...
This saves the token to .claude/telegram/.env and adds .claude/telegram/ to .gitignore.
5. Restart and pair.
claude --channels plugin:telegram@mahi97-telegram
DM your bot on Telegram — it replies with a 6-character pairing code:
/telegram:access pair <code>
6. Lock it down.
/telegram:access policy allowlist
Done. Your bot only responds to approved users.
Each project can have its own bot (or share one). The plugin auto-detects:
.claude/ → uses .claude/telegram/ (project-scoped).claude/ → falls back to ~/.claude/channels/telegram/ (user-scoped)TELEGRAM_STATE_DIR env var → overrides both (explicit path)Different tokens = different bots. Same token = same bot, separate access control per project.
If you previously had telegram@claude-plugins-official enabled, disable it in ~/.claude/settings.json:
{
"enabledPlugins": {
"telegram@claude-plugins-official": false
}
}
This prevents the official plugin from spawning competing instances.
| Tool | Purpose |
|---|---|
reply | Send to a chat. Supports reply_to for threading and files for attachments. |
react | Add an emoji reaction (Telegram whitelist only). |
edit_message | Edit a bot message. Useful for progress updates. |
download_attachment | Download file attachments from inbound messages. |
When a user replies to a specific message in Telegram, the inbound channel notification includes:
reply_to_message_id — ID of the message being replied toreply_to_text — first 200 characters of that messageThis lets Claude understand which message the user is referring to.
See ACCESS.md for DM policies, groups, mention detection, and the full access.json schema.
Apache 2.0 (same as the official plugin).
Telegram user-account messaging via MTProto (Telethon) - send messages as yourself, list dialogs, 1Password credentials
Share bugs, ideas, or general feedback.
Persistent memory system for Claude Code - seamlessly preserve context across sessions
Standalone image generation plugin using Nano Banana MCP server. Generates and edits images, icons, diagrams, patterns, and visual assets via Gemini image models. No Gemini CLI dependency required.
Streamline people operations — recruiting, onboarding, performance reviews, compensation analysis, and policy guidance. Maintain compliance and keep your team running smoothly.