hamen/claude-code-telegram: The Telegram Bridge That Makes Claude Interruptible

Remote access is the obvious feature. The real invention is a stop lane that can jump the queue while Claude stays sandboxed, redacted, and stateful.

8 min read • View on GitHub • More from hamen

A Telegram chat on a phone sends a stop message while a laptop terminal keeps Claude running in the background. The scene frames remote AI coding as a control problem, where the user needs a fast interruption path instead of another chat box.
The real product is not the chat bridge. It is the ability to interrupt a live agent without losing control of the session.
Key Takeaways

The stop button is the product

Remote access is easy to sell and easy to misunderstand. Sending Claude a prompt from your phone is not the hard part. The hard part is deciding what happens when the agent is still running, you are nowhere near the terminal, and the next message needs to cut in front of everything else.

That is why hamen/claude-code-telegram reads less like a chat wrapper and more like a control plane. It keeps active work visible, lets the user intervene, and preserves session state instead of treating every interruption as a reset.

How a stop command skips the line

The technical trick lives in StopAwareUpdateProcessor. Ordinary Telegram updates flow through the sequential lane behind a lock. A message that starts with stop: bypasses that gate, reaches the active request controller, and halts the running Claude task without waiting for the queue to drain.

The bot's cleverness is not the chat layer. It is the fast lane that lets a stop command skip the queue and reach the running task first.

That design matters because a stop command that arrives late is barely a stop. Priority routing turns interruption into a first-class path, which is the difference between a responsive agent and a polite one.

Safety makes preemption usable

A close-up of a command stream where sensitive tokens are blacked out by a redaction pass while a hard boundary keeps a terminal window inside an approved workspace. The image explains that preemption only works when the agent is constrained by safety rails, not just speed.
The stop path is only trustworthy because the rest of the system is fenced in.

Preemption only works if the surrounding guardrails are serious. The repo pairs the queue bypass with a SecurityValidator that constrains work to an approved directory, secret redaction that strips obvious credentials before they reach Telegram, and audit logging that records what happened without leaking what should stay private.

That mix changes the feel of the system. Claude can run bash, but it does so inside a bounded workspace, with the operator seeing a sanitized trace instead of raw shell fallout.

Hamed Farag in a tight editorial portrait. The image introduces the creator behind the project and signals that the repo grew from one builder's own workflow pain rather than a generic product brief.

The origin story is useful because it explains the product direction. This began as a bridge, but the repo now points toward a broader operator surface: model switching, project-aware threads, persistent state, and an event-driven core that can grow beyond one chat stream.

Telegram is the doorway, not the boundary. The deeper pattern is a workflow system that lets a human supervise Claude without being glued to the terminal.

Compared with other ways to drive Claude

ProjectAccess modelInterruptibilityPersistenceSecurity postureBest use case
Terminal-only Claude CodeLocal terminalManual, localWhatever the shell keeps aliveDepends on the operatorDesk-bound solo work
Official remote controlPhone approval for a live sessionApproval focused, not queue-awareSession stays anchored to the terminalBuilt in, narrow surfaceQuick approvals from the mobile app
Other Telegram bridgesChat bridge or tmux wrapperUsually message order, not priority awareOften custom persistenceVaries by DIY setupSimple remote chat with Claude
hamen/claude-code-telegramTelegram control plane with stop lanePriority stop path via StopAwareUpdateProcessorPersistent project threads and stored stateSandboxing, redaction, audit loggingSupervise Claude from anywhere

The comparison reveals the real niche. This repo is strongest where the pain is operational, not conversational: stopping a run, keeping context, and trusting the output enough to leave your desk.