agents_control icon
agents_control

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.

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

In numbers

4,092RubyGems downloads, all versions
383Git clones, last 14 days
383Git clones since 29 Sept
5GitHub stars
29 SeptGit clones per day12 Oct

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 13 Oct 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
/agentsSessions with a live agent.
/tabsAll terminal tabs.
/screen NShow a tab's screen.
/focus NSwitch to a tab.
/run N commandRun a command in a tab and show the result. Replying to the result types into the same pane.
/new [directory]Create a tab.
/awayIntercept agent questions before you step out.
/statusCurrent status.

The number N comes from the last list shown.

Console (opens with agents_control)
/sessionsSessions with a live agent.
/tabsAll terminal tabs.
/awayIntercept agent questions.
/settingsSettings. /settings away toggles away mode.
/doctorCheck that everything is in place.
/quitQuit.
Command line
agents_controlOpen the console and stay in the tab. This is the normal way to run it.
agents_control setupSet up the Telegram bot: asks for the token, waits for your /start.
agents_control sessionsShow agent sessions.
agents_control daemonRun the daemon: agent hooks plus Telegram.
agents_control hooks statusCheck, install or uninstall the agent hooks.
agents_control stopStop a running daemon.
agents_control doctorCheck that everything is in place, in the environment the daemon will actually get.
agents_control service installAutostart with launchd or systemd. Also uninstall and status.
agents_control passphrase setPassphrase for destructive commands. Also clear and status.
agents_control versionPrint 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.