Telegram Claude brings the full power of Claude Code CLI to Telegram, enabling remote code assistance from any device. Instead of SSH-ing into a VPS, you simply send a message in Telegram and get streamed responses with full context awareness.
The bot spawns Claude Code processes in your project directories, maintains session continuity for follow-up conversations, and handles everything from voice transcription to plan mode approval — all through Telegram's chat interface.
Key Features
Real-Time Streaming
- Spawns Claude Code CLI as child processes
- Streams responses back to Telegram in real-time
- Auto-splits long responses at Telegram's 4000 character limit
- Preserves markdown formatting in chat
Project Switching
- Inline keyboard for quick project selection
- Configurable project directories
- Each project maintains its own Claude Code session
- Shows current project context in responses
Voice Messages
- Transcribes voice messages via Groq Whisper API
- Sends transcribed text directly to Claude Code
- Enables hands-free coding assistance
- Fast transcription with minimal latency
Plan Mode
- Intercepts Claude Code plan mode requests
- Presents plans for approval via Telegram buttons
- Approve or reject implementation plans remotely
- Full control over code changes from mobile
Architecture
The bot is built as a single TypeScript application running on Bun, designed for deployment on a VPS alongside the projects it manages.
Message Processing Pipeline
Messages flow through a sequential queue to prevent race conditions when multiple messages arrive simultaneously. Each message is processed in order:
- Receive — Telegram message or voice note arrives
- Transcribe — Voice messages are converted to text via Groq Whisper
- Route — Message is directed to the active project's Claude Code session
- Stream — Claude Code output is streamed back as Telegram message edits
- Complete — Final response is sent, session remains active for follow-ups
Session Management
- Sessions persist across messages for natural conversational flow
- Automatic cleanup of idle sessions
- Git branch and PR status shown in responses
- Session state tracks current project, working directory, and conversation history
Deployment
- Runs as a systemd service for automatic restart and boot persistence
- Environment-based configuration for bot tokens and project paths
- Lightweight resource footprint — only spawns Claude Code when needed
Technology Stack
- TypeScript + Bun — Fast runtime with native TypeScript support
- grammy — Modern Telegram bot framework with middleware support
- Claude Code CLI — Anthropic's CLI tool for AI-assisted development
- Groq SDK — Fast voice transcription via Whisper API
- systemd — Process management and auto-restart on Linux