A while back I started running Claude Code on my computer, and every time I
stepped out I wanted to keep an eye on what the agent was doing. Back then there
was no way to reach it from your phone, so I quickly hacked together a little
tool — also running on my machine — that launched Claude Code and let me talk to
it over Telegram. Suddenly I could keep working from my phone while I was away
from the desk. The catch: it all still ran on my local computer, which had to
stay on the whole time.
Later Claude Code shipped its own phone integration — but it constantly glitches
and drops, and you have to remember to turn it on in the first place. So I kept
using my own thing, and along the way I added OpenCode
next to Claude Code.
It grew well past the original "peek at the agent while I'm out." I can drive it
by voice, restart agents, even open a raw terminal to see what's running and
kill or keep whatever I want — at that point it's less "control the agent" and
more "control the whole machine." And the big one: I moved the whole thing onto
a VPS. Now nothing has to run on my laptop 24/7 — the agents are just always up,
reachable from my phone, tablet, or desktop, whether my laptop is awake or not.
I can queue up work for them ahead of time, and they even send videos and
screenshots back into the chat.
I built it for myself, use it daily, kept it quietly open source — figured it's
time to tell people.
TL;DR
- I run Claude Code and OpenCode on my own VPS and drive them entirely from Telegram — by voice or text, from my phone, tablet, or desktop.
- One Telegram forum topic = one project = one agent session. Topics behave like terminal tabs; Claude Code in one, OpenCode in another.
- It's a relay, not a cloud: the bot talks to the agents on
localhostand reaches me over Telegram — no open ports, nothing exposed. - Self-hosted, MIT. Sessions survive restarts, work can be scheduled ahead, and the agent sends screenshots and videos back into the chat.
- Setup is a few minutes; the full walkthrough lives in the repo.
What is TelegramCode?
TelegramCode is a free, self-hosted, MIT-licensed Telegram bot that lets you drive AI coding agents — Claude Code and OpenCode — running on your own VPS or machine, entirely from your phone, with one Telegram forum topic per project.
It isn't a cloud service and there's no account to sign up for. You run the bot next to your agents; Telegram is just the remote control.
What I actually use it for
The install was never the point — this is:
- Talking to it, literally. I hold the mic, describe a task, and the bot transcribes the voice note and hands it to the agent. Half my prompts never get typed. The reply streams back into the topic as the agent works.
- One topic per project, like terminal tabs. Each forum topic binds to a folder and runs its own isolated session. I keep several open — one project on Claude Code, another on OpenCode, a third running in parallel on the same repo — and switch between them like tabs.
- Throwing a bug at it. A screenshot of broken layout, a stack trace, a PDF — I drop it straight into the topic and it goes to the agent with my note. (An album arrives as a single prompt.)
-
Queuing work for later. I
/schedulea prompt — "every weekday at 9, go through the open PRs and summarize" — and it runs as a fresh session at that time, even if I'm nowhere near a keyboard. It survives restarts. - The one notification that matters. I keep every topic muted. The single moment the agent needs a decision, it pins the question — and a pin pierces the mute, so I get exactly one buzz instead of a stream of noise. I answer with a tap.
-
Controlling the machine, not just the agent. I can restart an agent, or open a raw
/terminalin the project folder to see what's running, kill something, leave something. At that point it's closer to carrying my whole dev box in my pocket. - It talks back with more than text. The agent can send screenshots, charts, even short videos into the chat — handy when "show me" beats "describe it."
And because the whole thing lives on a VPS, none of this depends on my laptop being awake. The agents are just always up — reachable from my phone on a bus, my tablet on the couch, or my desktop when I'm back at it.
How it all works
The bot is almost entirely a relay. It adds no "AI" of its own — its job is to route your phone to the agent running on your box and stream the agent's output back:
- One topic ↔ one folder ↔ one session. Routing, model, and history are isolated per topic. Two topics can point at the same folder when you want two agents on one repo.
-
Two backends, your pick per topic. Claude Code runs as a local process the bot drives; OpenCode runs as a local HTTP server the bot talks to. From your side it's the same interface —
/claudeor/opencode. -
Outgoing only — nothing exposed. The bot reaches Telegram over an outbound connection and talks to the agents on
localhost. No open ports, no tunnel, no public endpoint on your machine. - Sessions survive restarts. The agents live in external processes, so a bot update or a server reboot re-adopts them instead of killing them — and the same session is still reachable over plain SSH if you sit down at the box.
- Voice, files, scheduling, pins are the layers on top: voice notes go through Whisper (Groq, free tier), files are saved and announced to the agent, scheduled prompts re-arm after a reboot, and pending questions get pinned.
That's the whole model: your agents and your code stay on hardware you own; Telegram is just the pane of glass you already carry.
Getting started
Setup takes a few minutes, and the full step-by-step — BotFather, group setup, config — lives in the README. The short version:
npm install -g telegramcode # needs Node ≥ 22
Create a bot with @BotFather, drop its token into ~/.config/telegramcode/.env, then launch from the parent folder of your projects:
cd ~/projects && telegramcode
Open a Telegram topic, /bind it to a project folder, and start an agent with /claude or /oc. That's it — type or talk.
Everything it does
I lean on this every day, so it has grown a lot of features — very likely more than the other phone/Telegram bridges for coding agents. Here's the fuller map, beyond the basics above.
Two agents, your pick per topic
- Claude Code and OpenCode in the same bot — switch per topic, run them side by side.
- Per-topic model (
/model) and reasoning effort (/effort), on both backends. - Control how much you see:
/thinking,/tool_results,/subagent,/verbosity.
The agent talks back — properly (the part people miss)
The bot hands the agent its own set of MCP tools, so it uses Telegram the right way instead of flattening everything into text:
- Send a video as a real, playable video (not a GIF), a file as a file, and an image inline as an image — single items or a whole album.
- Send several separate messages at once — e.g. a digest where each item lands as its own message instead of one giant wall.
- Schedule its own prompts and jobs — the agent can set up its future runs, list them, and cancel them.
Runs like infrastructure
- Self-hosted, MIT, outgoing-only — no open ports, nothing exposed on your box.
- Sessions survive a restart of both the bot and the agent server; the same session is still reachable over plain SSH.
- Scheduled prompts (
/schedule) — cron, one-shot, or recurring, and restart-safe. - Pinned question alerts — one pin pierces a muted topic, so you get exactly one buzz when the agent needs you.
- API-error auto-recovery — a rate-limited or logged-out agent is surfaced and retried instead of silently hanging.
Fits how you work
- Run it from a forum group, from the bot's private chat, or both at once.
- Sign in to Claude right from the topic (
/login), or hand a provider key to the agent (/connect). - Voice, file/photo/PDF intake, and tap-to-answer questions (covered above).
- 12 UI languages, switchable per chat (
/language).
There are a few other Telegram bots for coding agents out there, and some are genuinely good — I won't knock them. For what it's worth, I was early to this: I'd been driving Claude Code from Telegram before it had any phone integration of its own, and this repo has been public since early 2026 — before the other OpenCode/Telegram bots. I just kept it low-key instead of promoting it, which is probably why you may have met one of the others first. My honest pitch is simple: this one runs both Claude Code and OpenCode, it very likely covers more than the alternatives, and since I use it every single day, the everyday rough edges are the ones that actually got filed down.
A few honest caveats
- You need an always-on host. A cheap VPS is the honest answer; on a laptop the agents are only reachable while it's awake.
- Bot access = shell access. Anyone who can message the served group runs commands as the bot's OS user. Keep the group private; only trust people you'd give SSH to.
-
Your agent's own auth is on you. Log Claude/OpenCode in to your provider, or hand the bot a key with
/connect. - Telegram's limits. ~20 MB per file, and long output is paced into chunks by design — that's not a stall.
FAQ
Is there a mobile client for Claude Code or OpenCode?
No official app for either — TelegramCode is the closest thing, for both. It gives you a real phone UI (send prompts, switch models, tap to answer the agent's questions) over the agents running on your own machine, inside the Telegram app you already have.
Can I control my coding agent from my phone without exposing any ports?
Yes. The bot talks to the agents on localhost and reaches you through Telegram's servers, so nothing on your machine needs a public port or a tunnel.
Does it run Claude Code too, or only OpenCode?
Both, in the same bot. Each topic picks its backend — /claude or /opencode — so you can run Claude Code in one project and OpenCode in another.
What happens to my session if the server restarts?
It's re-adopted. The bot persists which topic maps to which session and re-attaches on boot; if the agent server itself restarts, it restores the sessions from disk.
Is it really free?
The bot is MIT and self-hosted — you pay only for your own VPS and your Claude/OpenCode usage. No SaaS layer, no account.
Wrap-up
I stopped being chained to my desk the day my agents' questions started reaching my phone instead of a terminal I wasn't looking at. If that's a problem you have too, the repo is here (MIT). If not, no worries.
Next up: I'll walk through the other half — standing up the VPS itself: how to provision it, what to watch out for, and how to keep your agents alive 24/7. That's the follow-up post.
If you try it, I'd love to hear which agent you run in which topic — and what you'd want it to do while you're away from the keyboard.


Top comments (0)