Andrey Markin
BlogServicesProjectsReviewsPricingContact
Meet
BlogServicesProjectsReviewsPricingContact
Meet

Mark Life Ltd

BG208147965

HomeContactPrivacyLLM-friendly
Back to Projects

Telegram Claude: Remote Claude Code via Telegram

TypeScriptBunTelegram BotClaude CodeAIgrammyGroq

A Telegram bot that runs Claude Code CLI on your VPS and streams responses back to chat. Supports project switching, session continuity, voice messages, plan mode, and message queuing.

Telegram Claude: Remote Claude Code via Telegram

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:

  1. Receive — Telegram message or voice note arrives
  2. Transcribe — Voice messages are converted to text via Groq Whisper
  3. Route — Message is directed to the active project's Claude Code session
  4. Stream — Claude Code output is streamed back as Telegram message edits
  5. 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
grammy
Claude
Groq
  • 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

Want to build an AI-powered automation tool?

Let's Discuss Your Project