---
title: "agents_control by 278labs | Claude Code in Telegram"
description: "agents_control is an open source remote for iTerm2, tmux and AI agents like Claude Code. Answer questions, run commands and read the screen from Telegram."
url: https://agentscontrol.278labs.co.uk/
language: en
---

![agents_control icon](https://agentscontrol.278labs.co.uk/icon.webp)

agents_control by [278labs](https://278labs.co.uk/)

# Your terminal AI agents, in Telegram.

agents_control is a remote for iTerm2, tmux and the AI agents inside them. When Claude Code stops and waits, the question arrives in Telegram with reply buttons. You answer, the session unblocks.

Install [View on GitHub](https://github.com/saparjohnick/agents_control)

- macOS and Linux
- Ruby 3.1+
- Open source, Apache 2.0
- Your own bot, no shared service

## In numbers

**4,690** RubyGems downloads, all versions

**422** Git clones, last 14 days

**1,233** Git clones since 29 Sept

**7** GitHub stars

*Git clones per day, 29 Sept to 10 Nov*

29 Sept Git clones per day 10 Nov

Downloads from RubyGems, clones and stars from GitHub (clones include automated ones). GitHub keeps 14 days of traffic, so the history is saved daily here. Snapshot of 11 Nov 2026.

## What you can do

### Answer your agent from anywhere

Claude Code calls agents_control through its own hooks when it stops. The question and its reply buttons arrive in Telegram, and Claude Code waits while you answer. A question can also be answered by replying to its message, even with several tabs open.

Silence counts as a refusal: if nobody answers, the action does not happen. In `present` mode (the default) questions are mirrored but stay in the terminal. In `away` mode (`/away`) they wait for your tap.

### Run and read your terminal

`/tabs` lists your tabs, `/screen N` shows one, `/run N command` runs a command and shows the result, `/new` opens a tab. Reply to a result and your text is typed into the same pane, so back-and-forth prompts like `git add -p` work over Telegram.

A tab stuck in `less`, `vim` or a REPL asks for confirmation first, instead of a blind send.

### Send files to a session

Photos, videos, voice notes and documents sent to the bot are saved on your machine, and the agent receives the file's local path. Name the target with a caption like `/run 3 why does this render wrong?` or by replying to a session's message. With nothing to go on, the file is saved and the path comes back, never guessed.

A path and never a link, on purpose: Telegram's download URL contains the bot token.

### Keep Claude Code moving

**Limit reset.** Notices a message like "resets 3pm" and types the continuation itself when the time comes. **CLI menus.** Turns Claude Code's own "1. … 2. …" choices into buttons. **Rate-limit anchors.** Moves the five-hour window to times that suit you, with a ping from a cheap model.

### Safe by design

Everyone runs their own bot: there is no shared service. The daemon listens on `127.0.0.1` only and reaches Telegram with outgoing connections. Only chats on your allowed list get answers. The token lives in the Keychain or libsecret, never in a file.

Destructive commands such as `rm -rf ~`, `mkfs` or a fork bomb ask first: a button tap, or a passphrase you set.

## In the chat

### A destructive command asks first

/run 3 rm -rf ~

this recursively deletes ~ — there is no undo

```
rm -rf ~
```

Reply to this message with the passphrase to send it to mobile-app. Anything else cancels.

················deleted from the chat once read

### A screenshot goes to your agent

[screenshot.png]caption: /run 3 why does this render wrong?

why does this render wrong? /Users/you/.local/state/agents_control/inbox/20260907-171530-screenshot.png

The agent opens the file the way it opens anything else. Files are written 0600 and swept after 14 days.

Both exchanges follow the examples in the project's README.

## Commands

**Telegram bot**

| /agents | Sessions with a live agent. |
| --- | --- |
| /tabs | All terminal tabs. |
| /screen N | Show a tab's screen. |
| /focus N | Switch to a tab. |
| /run N command | Run a command in a tab and show the result. Replying to the result types into the same pane. |
| /new [directory] | Create a tab. |
| /away | Intercept agent questions before you step out. |
| /status | Current status. |

The number N comes from the last list shown.

**Console (opens with agents_control)**

| /sessions | Sessions with a live agent. |
| --- | --- |
| /tabs | All terminal tabs. |
| /away | Intercept agent questions. |
| /settings | Settings. `/settings away` toggles away mode. |
| /doctor | Check that everything is in place. |
| /quit | Quit. |

**Command line**

| agents_control | Open the console and stay in the tab. This is the normal way to run it. |
| --- | --- |
| agents_control setup | Set up the Telegram bot: asks for the token, waits for your `/start`. |
| agents_control sessions | Show agent sessions. |
| agents_control daemon | Run the daemon: agent hooks plus Telegram. |
| agents_control hooks status | Check, `install` or `uninstall` the agent hooks. |
| agents_control stop | Stop a running daemon. |
| agents_control doctor | Check that everything is in place, in the environment the daemon will actually get. |
| agents_control service install | Autostart with launchd or systemd. Also `uninstall` and `status`. |
| agents_control passphrase set | Passphrase for destructive commands. Also `clear` and `status`. |
| agents_control version | Print the version. |

## Install

1. ### Install the gem
  
  You need Ruby 3.1 or newer. The only dependency is `thor`, pure Ruby, so nothing compiles.
  
  ```
  gem install agents_control
  ```
  
  Or clone the source, or add it from inside Claude Code as a plugin.
  
  ```
  git clone https://github.com/saparjohnick/agents_control
  cd agents_control
  bundle install
  
  # or, in Claude Code:
  /plugin marketplace add saparjohnick/agents_control
  /plugin install agents-control@agents-control
  ```
2. ### Create your bot
  
  Make a bot with @BotFather in Telegram, then run the wizard. It catches your `chat_id` from your own message and adds it to the allowed list, so you never type a long number by hand.
  
  ```
  agents_control setup    # asks for the token, waits for your /start
  ```
3. ### Open the console
  
  The tool lives in a tab. While it is open, it listens to Telegram and receives agent events.
  
  ```
  agents_control
  ```
4. ### Set a passphrase and autostart
  
  Both are optional. A passphrase replaces the confirmation button for destructive commands. Then check the setup.
  
  ```
  agents_control passphrase set     # typed without echo, stored in the Keychain
  agents_control service install    # autostart (launchd / systemd)
  agents_control doctor             # is everything in place
  ```

## Good to know

**macOS** iTerm2 (through AppleScript) or tmux. Secrets in the Keychain, autostart with launchd. Terminal.app is not supported.
**Linux** tmux. Secrets in libsecret, autostart with systemd.
**Windows** Not supported.
**Claude Code** Works in full, including sessions with no terminal, such as a VS Code session: they are visible and answer hooks.
**Codex** Sessions are visible and controllable like any tab, but there is no question relay: its hooks give nothing to hook into for that yet.
**Hooks** The daemon connects hooks on start and removes them on stop. Entries are tagged, so your other Claude Code settings are never touched.
**Tab titles** An agent's presence is confirmed by the process tree, not by a tab's title, because a title stays after the agent exits.
**Releases** The changelog explains what changed and why. While the major version is 0, a minor bump may change behaviour, and the entry says so.

## Questions

### What is agents_control?

An open source remote for iTerm2, tmux and the AI agents inside them, such as Claude Code. When an agent stops and waits for you, the question arrives in Telegram with reply buttons. You can also list tabs, read a tab's screen, run commands and send files from your phone.

### Is agents_control free?

Yes. It is open source under the Apache 2.0 licence and free to install from RubyGems or GitHub. It runs on your own machine with your own Telegram bot, so there is no shared service and no account with 278labs.

### Which systems does it support?

macOS with iTerm2 (through AppleScript) or tmux, and Linux with tmux. It needs Ruby 3.1 or newer. Windows and Terminal.app are not supported.

### Does it work with Claude Code and Codex?

Claude Code works in full, including sessions with no terminal such as a VS Code session. Codex sessions are visible and controllable like any tab, but there is no question relay, because its hooks give nothing to hook into for that yet.

### Will it change my Claude Code settings?

The daemon connects its hooks when it starts and removes them when it stops. The entries are tagged, so your other Claude Code settings are never touched.

### Is it safe to run commands from Telegram?

Only the chat ids on your allowed list can use the bot. A destructive command asks for a button tap or a passphrase first, and secrets are kept in the macOS Keychain or libsecret on Linux.

### How do I install it?

Run gem install agents_control, create a bot with @BotFather, run agents_control setup and then agents_control. The Install section above has every step.
