A Python bot that bridges Telegram to the Claude Code CLI. Message your bot, it runs Claude on your server, streams results back. Manage your entire VPS from your phone. Inspired by @levelsio.
Your message takes this path:
Message @BotFather on Telegram, run /newbot, and save the token it gives you.
Pull the repo onto your server and set up the environment.
git clone https://github.com/RichardAtCT/claude-code-telegram.git
cd claude-code-telegram
cp .env.example .env
Edit .env with your bot token, your Telegram user ID, and the path to your claude CLI binary.
# Your Telegram bot token from BotFather
TELEGRAM_BOT_TOKEN=your_token_here
# Your Telegram user ID (only you can use it)
ALLOWED_USERS=your_telegram_id
# Where Claude can operate
APPROVED_DIRECTORY=/root
# Path to claude CLI binary
CLAUDE_CLI_PATH=/root/.local/bin/claude
# Use CLI mode (not SDK)
USE_SDK=false
AGENTIC_MODE=true
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python -m src.main
For production, run it as a systemd service so it survives reboots.
Open Telegram, find your bot, and start giving it instructions. It resumes sessions automatically — your conversation context persists across messages.
This page was built, deployed, and SSL'd by Claude Code — via Telegram.
Get the code on GitHub