Hermes Messaging Gateway: Exposing Your Claude Agent on Telegram and Discord
Step-by-step setup for Hermes's Telegram and Discord gateways, with safe defaults (allowed_users), a YAML config template, and notes on the other six backends.
Step-by-step setup for Hermes's Telegram and Discord gateways, with safe defaults (allowed_users), a YAML config template, and notes on the other six backends.
One of the sharper features in Hermes is the messaging gateway. A single daemon can expose your Claude agent over Telegram, Discord, Slack, WhatsApp, Signal, Matrix, Feishu, and DingTalk simultaneously. Every message you send to any of those channels becomes a prompt; the agent's response comes back on the same channel.
This post walks through the two most common gateways — Telegram and Discord — end to end. Create the bot, get the token, drop it into Hermes config, exchange a few messages, and lock access down to only you.
allowed_users is the single most important config line — without it, anyone can talk to your agent and burn your tokens.~/.hermes/config.yaml); see docs for the canonical path.Chat is the most natural input for a general-purpose agent. You are already in Telegram or Discord all day. Being able to fire off "check yesterday's deploy logs and summarize failures" from your phone, on the bus, and get a response two minutes later — that is an order of magnitude more useful than opening a terminal.
The gateway is also how most people integrate Hermes with a team. Point the Discord gateway at your team server, restrict access to a specific role, and now the whole team shares one agent that remembers prior conversations via the Hermes memory system. More on that in hermes-memory-deep-dive-fts5-markdown-recall.
Telegram is the quickest to set up because everything happens inside Telegram itself.
@BotFather, start a conversation./newbot. Give it a display name and a unique username ending in bot.123456:ABC-DEF.... Copy it.@userinfobot and it will tell you your ID (for example, 123456789).Now configure Hermes:
gateways:
telegram:
token: "${TELEGRAM_BOT_TOKEN}"
allowed_users: [123456789]
Export the token in your shell (export TELEGRAM_BOT_TOKEN=123456:ABC-DEF...) or drop it into a .env file Hermes reads on startup. Restart the daemon. Send /start to your new bot and then any prompt. The agent should respond.
The allowed_users list is non-optional in practice. If you leave it empty, anyone on Telegram who guesses your bot's username can burn your API quota. Lock it to your ID and only you can talk to it.
Discord takes longer because you are creating an OAuth application.
bot scope and the Send Messages, Read Message History, and Use Slash Commands permissions.Now configure Hermes:
gateways:
discord:
token: "${DISCORD_BOT_TOKEN}"
guild_id: "987654321098765432"
allowed_users: ["111122223333444455"]
The allowed_users list here takes Discord user IDs. Get yours the same way: right-click your own name, Copy User ID.
Mention the bot in a channel (@yourbot hello) and it should reply. See docs for exact field names; some deployments allow role-based permissions instead of per-user allowlists.
Hermes is happy to run both gateways from one daemon:
gateways:
telegram:
token: "${TELEGRAM_BOT_TOKEN}"
allowed_users: [123456789]
discord:
token: "${DISCORD_BOT_TOKEN}"
guild_id: "987654321098765432"
allowed_users: ["111122223333444455"]
Both chats now funnel into the same Hermes memory and tool registry. A conversation started on Telegram in the morning can be continued on Discord from your desktop in the afternoon. That is the underrated power of the shared memory layer.
The pattern is the same for the rest:
signal-cli. Most private option.Each follows the token + allowed_users shape with minor variations for platform-specific fields (Slack needs a signing secret, Matrix needs a homeserver URL). Check the Hermes docs for field-level specifics per gateway.
Three rules that save you from a bad day.
allowed_users. If it is empty, your bot responds to anyone. On Telegram that means anyone who discovers the username. On Discord it means anyone in the guild.--max-budget-usd configured so a runaway conversation cannot drain your API credit. See cost-control-hermes-max-turns-budget-fallback for the full picture.Gateways are most useful in combination with the scheduler. A daily 8am PR digest that posts into your Slack #ops channel, plus an on-demand "what's the status of the cluster" query from Telegram, covers 80% of useful ChatOps without you writing any code beyond a YAML file.
For the scheduling side, see scheduling-claude-agents-hermes-cron-daily-reports.
The gateway daemon needs to be alive for messages to flow. A $5 VPS running Hermes under systemd is the classic setup. If you only need it to respond during waking hours, your home machine works too — but expect the agent to be unresponsive when the machine sleeps.
Ten minutes to a working Telegram bot is the kind of setup that makes you actually use the tool. Start with Telegram, add Discord if you need a team surface, and let the shared memory layer do the work of keeping conversations coherent across surfaces.
Manage Apple Notes via the memo CLI on macOS (create, view, search, edit).
Manage Apple Reminders via remindctl CLI (list, add, complete, delete).
Delegate coding tasks to OpenAI Codex CLI agent. Use for building features, refactoring, PR reviews, and batch issue fixing. Requires the codex CLI and a git repository.
Track Apple devices and AirTags via FindMy.app on macOS using AppleScript and screen capture.