Skip to main content

Telegram bot that bridges Telegram Forum topics to Claude Code sessions via tmux

Project description

CCBot

CI PyPI Python License: MIT Ruff

Control Claude Code sessions remotely via Telegram — monitor, interact, and manage AI coding sessions running in tmux.

Contents

Why CCBot?

Claude Code runs in your terminal. When you step away from your computer — commuting, on the couch, or just away from your desk — the session keeps working, but you lose visibility and control.

CCBot solves this by letting you seamlessly continue the same session from Telegram. The key insight is that it operates on tmux, not the Claude Code SDK. Your Claude Code process stays exactly where it is, in a tmux window on your machine. CCBot simply reads its output and sends keystrokes to it. This means:

  • Switch from desktop to phone mid-conversation — Claude is working on a refactor? Walk away, keep monitoring and responding from Telegram.
  • Switch back to desktop anytime — Since the tmux session was never interrupted, just tmux attach and you're back in the terminal with full scrollback and context.
  • Run multiple sessions in parallel — Each Telegram topic maps to a separate tmux window, so you can juggle multiple projects from one chat group.

Other Telegram bots for Claude Code typically wrap the Claude Code SDK to create separate API sessions. Those sessions are isolated — you can't resume them in your terminal. CCBot takes a different approach: it's just a thin control layer over tmux, so the terminal remains the source of truth and you never lose the ability to switch back.

Features

  • Topic-based sessions — Each Telegram topic maps 1:1 to a tmux window and Claude session
  • Real-time notifications — Assistant responses, thinking content, tool use/result, and local command output
  • Interactive UI — Navigate AskUserQuestion, ExitPlanMode, and Permission Prompts via inline keyboard
  • Send messages — Forward text to Claude Code via tmux keystrokes
  • Slash command forwarding — Any /command is forwarded to Claude Code (e.g. /clear, /compact, /cost)
  • Sessions dashboard — Overview of all active sessions with status and quick actions
  • Message history — Browse conversation history with pagination (newest first)
  • Auto-sync tmux windows — Create a tmux window and start Claude manually; the bot auto-creates a matching Telegram topic
  • Auto-discovery — Claude Code skills and custom commands appear in the Telegram menu automatically
  • Persistent state — Thread bindings and read offsets survive restarts

Quick Start

1. Prerequisites

  • tmux — must be installed and available in PATH
  • Claude Code — the CLI tool (claude) must be installed

2. Install

# Using Homebrew (macOS)
brew install alexei-led/tap/ccbot

# From PyPI (recommended for Linux)
uv tool install ccbot

# Or using pipx
pipx install ccbot

# Or from source
uv tool install git+https://github.com/alexei-led/ccbot.git

3. Configure

Create a Telegram bot via @BotFather, then enable Threaded Mode (BotFather > your bot > Settings > Bot Settings).

Create ~/.ccbot/.env:

TELEGRAM_BOT_TOKEN=your_bot_token_here
ALLOWED_USERS=your_telegram_user_id

4. Install the session hook

ccbot hook --install

This lets the bot auto-track which Claude session runs in each tmux window.

5. Run

ccbot

Open your Telegram group, create a new topic, send a message — a directory browser appears. Pick a project directory and you're connected to Claude Code.

Documentation

Guide Description
Guides Multi-instance setup, manual tmux usage, data storage

Credits

CCBot is a maintained fork of ccbot by six-ddc. See FORK.md for details on the fork history and divergences.

License

MIT — see LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ccbot-0.2.0.tar.gz (15.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ccbot-0.2.0-py3-none-any.whl (15.3 MB view details)

Uploaded Python 3

File details

Details for the file ccbot-0.2.0.tar.gz.

File metadata

  • Download URL: ccbot-0.2.0.tar.gz
  • Upload date:
  • Size: 15.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ccbot-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2476736e4422b73e56637c0ba2939aa3c4b241c41c6543decef01ea87c417543
MD5 1de0709e448e0c8c166aa596d37e9e31
BLAKE2b-256 dade9819f492cb444750c5e6ccb4ee980fc7e57e88de6df8a5475947223acd83

See more details on using hashes here.

Provenance

The following attestation bundles were made for ccbot-0.2.0.tar.gz:

Publisher: release.yml on alexei-led/ccbot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ccbot-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ccbot-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ccbot-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 169865bf43a51c062b7b4c6cc978c6e9f502caa07c62c880df814ad246dcf6f3
MD5 eebd53edb8f010235c6aa8ead36eb954
BLAKE2b-256 ee7a908f124173f1f5ddf499dc80b448a62d961f59cf05fd7de808178a6def42

See more details on using hashes here.

Provenance

The following attestation bundles were made for ccbot-0.2.0-py3-none-any.whl:

Publisher: release.yml on alexei-led/ccbot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page