Independent work

Codex Telegram Bridge

Routes Codex updates, replies, and approvals through Telegram or Discord while the local computer stays in control.

Codex Telegram Bridge overview

A short overview of the problem, solution, and result.

Starting Point

Codex could keep working after I left the computer, but the control surface stayed pinned to the local app: a waiting prompt, approval, or completed answer was easy to miss until I returned.

What Shipped

Shipped a Rust command-line tool, background service, Telegram and Discord connections, project list, native macOS menu bar app, and a small optional agent interface.

Why It Mattered

Shipped a public bridge with install docs, Telegram and Discord setup guides, release workflow docs, CI, security notes, and a native macOS menu bar companion.

I built an open-source bridge so Codex work can continue over Telegram or Discord

I built an open-source bridge so Codex work can continue over Telegram or Discord while I am away from the desk.

Codex can keep working while I step away, but the default interaction model assumes I am still in front of the desktop app. A message alone would not solve it. The bridge needed to know when I was away, start or repair the shared live backend, notify only for relevant events, let me reply to the right thread, handle approvals, and stop cleanly when I returned.

I made remote replies part of the same local workflow

Codex Telegram Bridge lets me continue a Codex task through Telegram or Discord while I am away from the computer.

The chat apps carry notifications and replies, but the local Rust service remains responsible for thread state, routing, retries, away status, and delivery.

Away mode controls when messages can leave the computer

Make presence the top-level gate.

The main rule is simple: remote notifications stay off while I am at the computer. /away turns delivery on, while /back turns it off and clears pending messages.

Route every reply through local records.

The bridge stores thread snapshots, outgoing messages, delivery history, reply routes, approval routes, selected projects, and action history in a local database. A remote message carries a temporary route that the local service maps back to Codex.

Keep chat delivery separate from agent access.

Telegram and Discord handle delivery and replies. Hermes gets a small optional interface for trusted local agent tasks: it can inspect, reply, and approve, but it cannot install the background service, configure chat connections, process updates, or send proactive notifications.

The public commands follow the away-and-return routine

The common path is visible in the command list: install the Rust tool, run setup, use /away before leaving, reply when Codex needs input, and use /back when returning.

Codex Telegram Bridge command list showing setup, away mode, projects, replies, and approvals.

The implementation keeps remote control narrow and recoverable

Shape the commands around the common path.

The visible commands emphasize setup, remote mode, background-service management, chat setup, project selection, waiting threads, replies, and approvals. Advanced maintenance commands remain available but stay out of default help.

Let one local service own delivery.

The background service reads Codex state through the configured live connection, starts or repairs that connection when remote mode needs it, queues new events after the away session begins, delivers due messages, and checks Telegram or Discord for replies.

Map replies and approvals to exact threads.

Telegram notifications store a local reply route. Approval prompts use temporary route identifiers behind Approve and Deny buttons. Discord uses the same prepared-message model and maps replies through the local route table.

Select projects without guessing from chat.

The project list stores approved folders with identifiers, labels, and aliases. /project chooses the current workspace, and /new starts a Codex task in that registered folder.

Keep secrets out of command output.

Setup writes the bridge config with user-only permissions, command output redacts bot tokens, allowed user ids can restrict inbound commands, and the public docs call out dedicated bot-token ownership and local retention.

Put the common controls in the menu bar.

The macOS companion exposes the actions needed from the desktop: start, stop, repair, refresh status, open configuration, and inspect local state.

Remote access stays behind local state and explicit presence

Codex Telegram Bridge keeps presence, thread state, reply routes, delivery, and recovery on the local machine, then lets Telegram or Discord carry the messages.

01

The common remote actions are easy to find.

Default help shows setup, remote mode, Telegram and Discord, projects, waiting threads, replies, and approvals while lower-level maintenance commands stay hidden.

02

Remote notifications only run when remote mode is on.

`/away` enables Telegram or Discord notifications and starts the required local connection. `/back` turns notifications off and clears messages that have not been sent.

03

Chat replies map back to exact Codex threads.

The local background service records where each Telegram or Discord message came from, then sends a remote reply or approval back to the exact Codex thread.

04

Hermes can inspect and respond without controlling delivery.

The optional agent interface can inspect threads, show waiting work, reply, and approve. Setup, background-service control, chat connections, new threads, and archive operations remain outside it.

05

Remote mode has a macOS menu bar control.

The menu bar companion turns remote mode on or off, repairs the local connection, and watches the same state as the chat tools.

06

The repo includes docs, CI, release workflow, and safety tests.

Tests cover command parsing, hidden maintenance commands, token removal, Telegram reply routing, approval buttons, stored-data changes, agent discovery, and the deliberately small agent tool list.

Remote control remains useful because its boundaries are visible

Presence state, connection health, message delivery, reply routing, approvals, project context, and local retention remain visible parts of the workflow. That lets me continue a task remotely without giving a chat tool open-ended control over Codex.

The implementation is public

The repository includes the Rust bridge, Telegram and Discord setup guides, Hermes agent-interface docs, macOS menu bar companion, example configuration, automated checks, release workflow, and tests.

View GitHub repo

Tell me what your team needs to ship.

Start with the feature, integration, or system that's stuck. We'll work out whether a project or a monthly contract fits.