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.1.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.1-py3-none-any.whl (15.3 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ccbot-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 780a6190b77a67f34ab7b2ef790f91cae46358e1a91520ff1088f5417ecc3468
MD5 89bde145a6934ee7d96aced0df1e23a9
BLAKE2b-256 1a6ca253ea8910ddc7c3c61bc4eedc86d342963c67d1b77d4d6b7597a711fbad

See more details on using hashes here.

Provenance

The following attestation bundles were made for ccbot-0.2.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: ccbot-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e14402070de55ef2dbb27e8169aa176f88b38c76ae8f168282d4177bb1a2efcf
MD5 7425d507f29f7b4672ad555cdb588e85
BLAKE2b-256 f37d605bdd19cf698703e3122af65c924db3a284017d5f9dd666372a86cff653

See more details on using hashes here.

Provenance

The following attestation bundles were made for ccbot-0.2.1-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