Self-hosted · MIT · Claude Agent SDK

Drive your local Claude Code
from Telegram.

A standalone TypeScript bot that bridges a Telegram chat to your locally-active Claude Code sessions — streaming Markdown replies, cron-scheduled tasks, multimodal input, guardrails, and a built-in admin console. Your code never leaves your machine.

Runtime · Node ≥20 · ESM Stack · grammY · Agent SDK · SQLite Tests · 226 passing
Why CoBot

Claude Code is powerful — but it lives in your terminal.

CoBot puts it in your pocket: from any phone, a Telegram message starts or resumes a session in your project directory and streams the work back. Self-hosted, with the guardrails an autonomous code-executing agent needs.

Anywhere, any device

Your dev machine stays on; you drive it from a phone in line at the coffee shop.

Real-time streaming

Markdown renders live in chat — tables, code, LaTeX — via progressive Rich Message edits.

Self-hosted & private

Source, prompts, and session state stay on the host. Only chat traffic traverses the network.

Guardrails built-in

Turn caps, daily cost/token quotas, an audit log, and interactive tool approval keep autonomy in check.

How it works

Three steps from Telegram to running code

1

Bind a chat to a project

/projects lists whitelisted dirs (your devRoots); tap one to bind this Telegram chat to it.

2

Send a message

Plain text, a photo, a PDF — CoBot starts (or resumes) a Claude Code session in that dir via the Agent SDK.

3

Watch it stream back

The assistant's output streams into the chat as Markdown. A per-chat FIFO queue keeps tasks serial; /stop interrupts.

install & run
# clone, install, link the `cobot` CLI
git clone https://github.com/zaneven/CoBot.git && cd CoBot
./scripts/cobot.sh install

# set your bot token + Telegram user id, whitelist your dev roots
cp .env.example .env          # then edit
cp config.example.yaml config.yaml

# start the background service
cobot start
Features

Everything an on-the-go coding agent needs

🌊

Streaming Markdown

Progressive Rich Message edits, tables, code, LaTeX, HTML→plain fallback.

🗂️

Session management

List, resume, and switch sessions across all your projects.

📋

Task queue

Per-chat FIFO. /stop interrupts, /drop clears the queue.

⏰

Cron-scheduled tasks

"Every morning, run the suite and report." List/enable/disable.

🖼️

Multimodal input

Send photos, PDFs, or log files alongside your prompt.

🧩

Skill browser

/skills lists available Skills; tap to fill the input bar.

📊

Context usage

/context shows the last turn's context-window % with a visual bar.

➕

Project scaffolding

Tap ➕ to create a new dir with git init from chat.

🖥️

Web admin console

Live tasks, costs, tool usage, logs, and config editing.

🛡️

Guardrails

Turn cap, daily cost/token caps, audit log, interactive approval.

Safety & guardrails

An agent with code-execution power, kept in check

CoBot ships the controls that make unattended use controllable and observable.

User allowlist

TELEGRAM_ALLOWED_USERS gates access; unauthorized users are ignored.

Path whitelist

/bind only accepts dirs under your devRoots — no escaping the sandbox.

Per-task turn cap

DEFAULT_MAX_TURNS = 50 bounds a runaway tool loop.

Daily cost/token quotas

dailyCostCapUsd / dailyTokenCap reject new tasks when exceeded.

Audit log

Every task is recorded — cost, duration, tools, status — for forensics.

Interactive approval

/approve interactive prompts before mutating tools; cron auto-approves.

Ready to code from anywhere?

Clone the repo, run one install command, and message your bot.