広告

Claude Code + Telegram:音声・スレッディングなどでAIアシスタントを強力にする方法

Dev.to / 2026/4/1

💬 オピニオンDeveloper Stack & InfrastructureTools & Practical Usage

要点

  • Claude Code の公式 Telegram プラグインはテキストのみのメッセージングに限られており、音声対応がありません。また、グループのスレッド管理、メディアの取り扱い、永続メモリ、堅牢なクラッシュ復旧も欠けています。
  • オープンソースの「claude-telegram-supercharged」は、置き換え可能な(ドロップイン)代替として位置付けられており、15+ の機能を追加します。特に重要なのは、Telegram のボイスノートを使った双方向の音声対応(文字起こし付き)と、オプションとしての音声返信です。
  • 返信チェーンに追従することでグループでの使いやすさを向上させ、最大3レベルのスレッディング(フォーラムのトピック分離を含む)に対応します。
  • 永続性も追加されます。チャットの履歴を消去する前に会話コンテキストをディスクへ要約して保存し、再起動時にそれを読み込むことで、クラッシュや再起動後も継続性を維持しやすくします。
  • 追加の強化として、メッセージのバッチ処理と自動要約、ダーモンの監督(オートリスタート/ウォッチドッグ機構)、ステッカー/GIF と MarkdownV2 の書式設定のより良い取り扱い、さらにドキュメント取り込み(PDF/DOCX/CSV)などが挙げられます。

The Problem with Claude Code's Official Telegram Plugin

Claude Code's official Telegram plugin does the basics: text messages in, text messages out. But if you've used it for more than a day, you've hit the walls:

  • No voice messages (talk to Claude from your phone? Nope)
  • No conversation threading in groups
  • No sticker/GIF support (Claude is confused by them)
  • No persistent memory across sessions
  • Crashes mean lost context

Enter claude-telegram-supercharged — a drop-in replacement that adds 15+ features without changing your existing bot setup.

What You Get

🎤 Voice Messages — Both Ways

This is the killer feature. Hold the mic button on Telegram, say "refactor the auth middleware to use JWT," and Claude gets it as text via Whisper transcription. It can even reply with voice via ElevenLabs TTS.

Think of it as Wispr Flow for Claude Code. Walk your dog, talk to your AI assistant. No typing needed.

Transcription uses a smart fallback chain: OpenAI Whisper API → Groq → Deepgram → local whisper-cli. Set one API key and forget it.

🧵 Conversation Threading

In group chats, the plugin follows reply chains — it knows who said what and responds in the correct thread. Up to 3 levels deep. Forum topics are fully supported too, with each topic isolated.

💬 Persistent Memory

When you clear chat history, Claude saves a summary to disk first. On restart, that memory loads back in. Your assistant never truly forgets — context survives crashes, restarts, and /clear commands.

📦 Message Batching

Forward 20+ messages at once and they're collected into one batch (5-second debounce), auto-summarized, then Claude responds to everything in one reply. Perfect for "summarize this group chat."

🔄 Daemon Mode with Auto-Restart

The supervisor script manages Claude as a child process with:

  • Exponential backoff restart (1s → 2s → 4s → max 30s)
  • Context watchdog — auto-restarts at 70% context usage
  • Single-instance lock (no duplicate bots competing)
  • Signal-file protocol for clean restarts from Telegram

Say "clear everything" in chat → Claude saves memory → supervisor restarts with fresh context. Zero downtime.

More Features

  • Stickers & GIFs — animated stickers become multi-frame collages Claude can actually see
  • MarkdownV2 auto-escaping — no more broken formatting
  • Document support — PDFs, DOCX, CSV up to 10MB
  • Inline keyboard buttons — tappable choices for confirmations
  • Reaction status — 👀 read → 🔥 working → 👍 done
  • Telegraph Instant View — long responses published as native Telegram articles
  • Two-tier model routing — fast model for simple queries, Opus for complex ones
  • Google Calendar integration — check schedule, create events from chat
  • Scheduled messages — reminders and recurring tasks

Setup in 5 Minutes

Prerequisites

  • Bun runtime (curl -fsSL https://bun.sh/install | bash)
  • A Telegram bot token from @BotFather
  • Claude Code installed

Step 1: Install the Official Plugin

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

Step 2: Clone & Apply the Supercharged Version

git clone https://github.com/k1p1l0/claude-telegram-supercharged.git

# Copy the enhanced server over the official one
cp claude-telegram-supercharged/server.ts \
   ~/.claude/plugins/cache/claude-plugins-official/telegram/0.0.1/server.ts

# Install the daemon supervisor
mkdir -p ~/.claude/scripts
cp claude-telegram-supercharged/supervisor.ts \
   ~/.claude/scripts/telegram-supervisor.ts

Step 3: Configure Your Bot Token

# Inside Claude Code
/telegram:configure YOUR_BOT_TOKEN_HERE

Step 4: Launch

# Option A: Standard (with Telegram channel)
claude --channels plugin:telegram@claude-plugins-official

# Option B: Daemon mode (recommended — auto-restarts)
bun ~/.claude/scripts/telegram-supervisor.ts

Step 5: Pair

DM your bot on Telegram. It replies with a 6-character code. In Claude Code:

/telegram:access pair <code>

Done. Your next message reaches Claude.

Step 6: Lock It Down

Switch to allowlist mode so strangers can't interact:

/telegram:access policy allowlist

Voice Setup (Optional but Worth It)

For the voice-to-Claude workflow, add your OpenAI key to ~/.claude/channels/telegram/.env:

OPENAI_API_KEY=sk-proj-...

That's it. The plugin handles format conversion, chunking, and transcription automatically. For fully offline transcription, install whisper.cpp instead.

Always-On with macOS launchd

If you're on a Mac and want the bot running 24/7 (surviving lid close, logout, and reboots), create a launchd plist:

# ~/Library/LaunchAgents/com.user.claude-telegram.plist

The repo's README has the full XML template. Key settings: RunAtLoad: true, KeepAlive: true, wrapped with caffeinate -s to prevent sleep.

Why This Matters

The gap between "AI assistant in a terminal" and "AI assistant in my pocket" is huge. Most developers I know have Claude Code running but only use it at their desk. Voice messages + Telegram means you can:

  • Debug on the go — describe the error, get a fix suggestion while walking
  • Manage tasks — "schedule a reminder to review PR #42 tomorrow at 10am"
  • Quick lookups — "what's the syntax for PostgreSQL UPSERT again?"
  • Group collaboration — add Claude to your team chat with proper threading

The supercharged plugin turns Telegram into a proper AI interface, not just a chat relay.

Links

Have you tried running Claude Code through Telegram? What's your setup? Drop a comment below.

広告