Chapter 1 (free): why Claude Code belongs in your Telegram, and how the bridge works
The itch
Claude Code is the most capable assistant you own, and it lives in a terminal on one machine. Your questions show up on your phone, on the bus, at 11pm. Every "I'll do it when I'm at the desk" is a task that never happens.
Telegram is already the app you have open. A bot there is free, instant, and works on every device you own.
So: a tiny bridge. Message the bot → it runs claude -p "<your message>" in a folder on your computer → the answer comes back. Follow-ups continue the same Claude Code session, so "now make it shorter" works. Photos and files land in an inbox/ folder and Claude reads them.
Why not the API, a framework, or a hosted service?
- Your login, not a key. The bridge shells out to the
claudeCLI, so it runs under the Claude Code login you already pay for. If you'd rather meter it, setANTHROPIC_API_KEYand it uses that instead. - Zero dependencies. One file, Node ≥ 22, nothing to
npm install, nothing to audit. The Telegram side is plainfetchagainst the Bot API. - Long polling, not a webhook. Webhooks need TLS, a public URL and a fixed port — the two most common reasons Telegram bots "don't work". Polling needs an outbound connection, which is all your laptop has anyway.
- Nothing leaves your machine except what Claude Code already sends to Anthropic. No third-party server sees your prompts or files.
The safety model in one paragraph
Only your Telegram user id gets answers. Claude Code runs in dontAsk mode with an allowlist of tools — read, search, edit files in your workspace, web search, a few read-only git commands. Anything else is auto-denied and Claude tells you what it wanted to do. You widen the list when you trust a workflow. The working directory can't leave the roots you allow. This is the difference between "an assistant" and "a remote shell for whoever guesses your bot name".
The first three steps (you can do these now)
- Install Claude Code and run
claudeonce so it's logged in. - In Telegram, message @BotFather →
/newbot→ copy the token. - Send yourself the token later; you'll paste it into
setup.sh.
What the paid pack adds
The bridge itself (bot.mjs), the one-click setup.sh with a self-test, background service install for macOS and Linux, the assistant CLAUDE.md template, per-chat sessions with /new /cwd /model /status /cancel, photo/file/voice inbox, and MISTAKES.md — 14 real mistakes from shipping a paid Telegram product with Claude Code.