The Telegram Bridge: How to Control AI Coding Agents from Your Phone
Ace's Telegram Bridge lets you manage a fleet of autonomous AI coding agents from anywhere. Approve decisions, check progress, send commands — all from your phone while the sprouts keep building.
The Problem with Autonomous Agents
The promise of autonomous AI agents is that they work while you're not watching. You set them loose, go live your life, and come back to finished software. That promise is real, but it comes with a catch: agents still need oversight. Not constant oversight — but available oversight. A sprout that hits an unexpected error at 2am needs a human to make a call. A deployment that requires credentials you forgot to include needs someone to provide them.
If the only way to interact with your agents is to be at your computer, you've traded one constraint for another. You're no longer writing code, but you're still tethered to a desk. Ace solves this with a Telegram bridge that gives you full bidirectional control from your phone, from anywhere in the world.
Architecture: How the Bridge Works
The bridge is a Python daemon called telegram-bridge.py that runs on the same machine as the Ace orchestrator. It runs a polling loop against the Telegram Bot API, checking for new messages every two seconds. When it receives a message, it routes it to the appropriate destination — a command to the orchestrator, a response to a waiting human request, a natural language message forwarded to a specific sprout.
On the outbound side, the bridge subscribes to events from the SQLite database. When a sprout logs an event of type task_completed, deploy_success, test_failed, or human_needed, the bridge picks it up within seconds and sends a formatted Telegram message to your phone.
The connection is two-way and stateful. The bridge maintains a mapping of open human requests — if a sprout is waiting for your answer on question X, the bridge knows that your next free-text message should be routed to that request. You don't have to specify which sprout to answer. The bridge figures it out from context.
The Commands
/status — gives you a snapshot of every active project: name, current task, last commit, deployment URL. This is the command you run first when you pick up your phone in the morning.
/sessions — lists all active Claude Code sessions with their heartbeat status. A green dot means alive. A yellow dot means the heartbeat is stale but the AppleScript check confirms the process is running. A red dot means crashed and pending recovery.
/costs — breaks down token spend by project and session. Because long autonomous sessions can accumulate significant API costs, this command runs daily and sends a summary automatically at midnight.
/health — a detailed diagnostic dump: database size, number of pending tasks, any sessions with error logs, last deploy timestamp per project.
/kill [project-id] — emergency stop for a specific sprout. Terminates the Claude Code session, marks all in-progress tasks as paused, and logs an emergency event. Use this if a sprout is doing something unexpected and you need to stop it immediately.
Natural Language Forwarding
Commands are useful, but most interactions aren't commands. Most of the time, a sprout needs a specific piece of information — a Firebase project ID, a decision about which library to use, an approval to proceed with a destructive operation. These don't fit neatly into a command structure.
The bridge handles free-text messages with a routing algorithm. It looks at the list of open human requests — sprouts that are currently waiting for input — and matches your message to the most recently created one. If there's only one open request, all free-text goes there. If there are multiple, the bridge asks you to disambiguate with a number: "There are 3 open requests. Reply 1, 2, or 3 to select one."
This design keeps the interaction model simple. You don't need to know which sprout is which, or remember project IDs, or use any special syntax. You just reply to what's in front of you, and the bridge routes it correctly.
Autopilot Triggers from Your Phone
Beyond monitoring and responses, the Telegram bridge also serves as a launch interface for Ace's autopilot modes. You can trigger any autopilot cycle from your phone:
RESEARCH — spawns a research sprout that scans markets, identifies opportunities, and returns a scored list of project ideas. Results arrive as a Telegram message within 20-30 minutes.
TRADE — triggers the paper trading cycle: morning brief review, strategy signal evaluation, position logging. Results come back as a formatted trade log.
REVIEW — runs a full health check across all active projects: build status, deployment status, last commit date, open human requests, and a pass/fail assessment for each project.
The practical effect is significant. You can manage a portfolio of software projects from a phone with two minutes of attention per hour. The cognitive overhead is close to zero.
A Real Scenario
You're on a flight. You have wifi but not your laptop. At 35,000 feet, your phone buzzes. A sprout building a payment integration needs your Stripe test key. You open Telegram, copy the key from your password manager, paste it as a reply. Thirty seconds total. The sprout receives the key, completes the integration, runs the tests, and deploys. By the time you land, there's a second message: "Deployed to Firebase. All tests passing."
This is not a hypothetical. It's the normal operating mode for Ace. The Telegram bridge makes it possible.
Setup
To configure the Telegram bridge, you'll need a bot token from BotFather and your personal Telegram user ID. Full setup instructions are in the installation guide. The bridge runs as a background process managed by a launchd plist on macOS, so it starts automatically on login and restarts if it crashes.