# Repository Briefing: Imolatte/claude-cli-telegram
> Source: https://repoforai.com/repo/Imolatte/claude-cli-telegram (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/Imolatte/claude-cli-telegram
- **Official Docs / Website**: https://github.com/Imolatte/tg-claude#readme
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: JavaScript
- **License**: MIT
- **Engineering Health**: B (62/100 · Maintenance 20/35 · Adoption 11/25 · Releases 11/20 · License 20/20)
- **Latest Release**: v1.0.0 (2026-03-20) — https://github.com/Imolatte/claude-cli-telegram/releases
- **Review Snapshot**: 2026-12-01
- **Deployment / Stack Signals**: Self-Hosted, CLI, MCP
- **Momentum**: 37 ★ total (+0 24h / +0 7d) · 5 forks
- **Topics**: `claude-ai`, `claude-code`, `mcp`, `remote-terminal`, `self-hosted`, `telegram-bot`, `ai-agent`, `anthropic`, `automation`, `cli`, `developer-tools`, `nodejs`
- **When to Use**: Best for: Developers and small teams that want to monitor, resume, or approve Claude Code work from a phone on a trusted Mac or Linux host. Skip if: You need offline operation, strong isolation between untrusted users, or seamless session migration between hosts.

## Overview
```text
### Architecture & Core Mechanics
A single Node.js ESM worker polls Telegram. `worker/index.mjs` handles commands, queues tasks, and relays progress. `worker/executor.mjs` starts the installed Claude Code CLI and parses its `stream-json` events. The CLI operates on the host's working tree with its native tools; the worker is not an Anthropic API wrapper. `worker/sessions.mjs` manages session state and supports continuing conversations with `--resume`.

`approval-hook.mjs` and `stop-hook.mjs` connect Claude Code's `PreToolUse` and `Stop` events to approval forwarding and completion notices. Hooks and the worker communicate through files under `/tmp/`. The separate `worker/mcp-telegram.mjs` module exposes outbound text and file delivery to Claude; MCP is not the inbound command path.

### Key Capabilities & Differentiators
The bot accepts text, forwarded messages, photos, files, and voice. Voice input goes through Groq Whisper speech-to-text, with a local Whisper fallback. While Claude runs, the bot reports tool activity, can show inline edit diffs, and reports token usage. Sessions can be named, switched, or detached; the working directory can be changed, and the model selector lists Sonnet, Opus, and Haiku.

The Git panel covers status, diff, log, staging, commits, push, and pull. Some commands bypass Claude entirely, including shell execution and clipboard or file access. Terminal, hybrid, and Telegram modes route replies and approvals differently. The approval timeout defaults to five minutes, and a Claude task has a default limit of 30 minutes. The bot UI supports English and Russian.

### Trade-offs & Limitations
Compared with Anthropic's official three-tool Telegram MCP bridge, this bot adds persistent sessions, live tool activity, approval routing, and Git controls. That breadth also makes it a remote operations surface: shell commands, file downloads, and clipboard access cross the chat-to-host boundary. The owner ID and group allowlist restrict who can interact, and selected dangerous operations are gated, but neither replaces OS-level isolation. Use a narrowly privileged account and limit which files and credentials it can reach.

Terminal handoff works best with tmux, which lets Telegram answer the native permission prompt without interrupting the process. Without tmux, takeover stops the terminal process and resumes saved session context, losing in-memory plans or to-dos. A Linux primary keeps the bot reachable when the Mac sleeps, but separate host-local sessions mean switching hosts does not migrate an active conversation.

### Hardware & Deployment Guide
Run the worker on macOS or Linux with Node.js 20+, Claude Code installed and on `PATH`, and a Telegram bot token and owner ID in `config.json`. Install dependencies under `worker/` with `npm install`, then start `node index.mjs`. Configure the Claude Code hooks for terminal approval forwarding and completion notices. The configuration calls for a Groq API key for voice transcription; FFmpeg is optional for the voice fallback. Self-hosting the worker does not make it an offline system.

For persistence, use a macOS LaunchAgent or run the Linux worker under systemd as a regular user. The optional Linux-primary/Mac-standby topology needs passwordless SSH from the Mac and hands off Telegram polling, not conversation state. The Node worker does not serve model weights; size the host for the CLI and the jobs it runs, with extra headroom if using local transcription or optional Puppeteer screenshots. The March 20, 2026 v1.0.0 release highlights native CLI execution, live progress, and session management.
```

## Key Capabilities
```text
- Execution: worker/executor.mjs starts the installed Claude Code CLI and parses stream-json events for live tool updates.
- Sessions: --resume preserves continuity on the same host, with named sessions, directory changes, and per-session token tracking.
- Approvals: Telegram sessions use inline buttons; tmux lets the bot answer a terminal prompt without restarting Claude.
- Git workflow: The Telegram panel covers status, diff, log, staging, commits, push, and pull.
- Host handoff: A Linux primary and Mac standby share one Telegram poller; Claude sessions remain separate on each host.
- MCP integration: send_telegram and send_file_telegram let Claude send messages and attachments proactively.
```

## Quick Start / Clone
```bash
git clone https://github.com/Imolatte/claude-cli-telegram.git
cd tg-claude && cp config.example.json config.json
# Edit config.json — add bot token, chat ID, Groq API key
cd worker && npm install && node index.mjs
```
