Coding Agents over Telegram: From Zero to An Agent That Answers
Stop reading and start doing.
By the end of this guide, you will have a Telegram topic where a coding agent answers your messages. This agent will drive a tmux pane on your own machine.
This is the core goal. You do not need memory, monitors, or tool servers yet. You only need to get the agent to answer you.
⏱️ Time Needed: 30–45 minutes.
🛠️ Prerequisites
Before you start, ensure you have these items ready:
- A machine with tmux and shell access.
- A working coding agent (like OpenCode or Claude Code) already running in a tmux pane.
- The exact tmux target for your agent (example: mybox:1.1).
- The exact command to launch your agent.
- The OpenClaw runtime installed.
- A Telegram account and the Telegram app.
📦 Required Versions
Do not skip these. Wrong versions cause silent failures.
• Node.js: 24.11.1 • Package Manager: pnpm 11.2.2 • OpenClaw: Pin to a specific commit.
🚀 Quick Setup Path
You can use these scripts to handle the local setup:
Download the scripts: curl -fsSL "https://gist.githubusercontent.com/jerilkuriakose/cd0f8353aac74e47c591111b758943e9/raw/setup-openclaw.sh" -o setup-openclaw.sh curl -fsSL "https://gist.githubusercontent.com/jerilkuriakose/7cf94af3e96526f9f14d0c28b6c26b69/raw/ready-check.sh" -o ready-check.sh chmod +x setup-openclaw.sh ready-check.sh
Run the setup with your bot token: OPENCLAW_BOT_TOKEN="
" OPENCLAW_BOT_ACCOUNT="my-bot" ./setup-openclaw.sh Verify the setup: AGENT_ID=my-agent PANE=mybox:1.1 ./ready-check.sh
📱 Telegram Configuration
Follow these steps in your Telegram app:
- Create a bot via @BotFather and save the token.
- Create a new group and add your bot.
- Make the bot an Administrator. This allows it to see your messages.
- Enable "Topics" in the group settings.
- Create a topic for your project.
- Send one message in that topic to generate a Topic ID in your logs.
⚙️ Wiring it Together
The gateway uses a JSON config at ~/.openclaw/openclaw.json.
Use Phase 1 to find your Chat ID and Topic ID by sending a message and checking the gateway logs.
Use Phase 2 to lock the group down. Change the policy to "allowlist" and add only your numeric Telegram User ID. Map your Topic ID to your specific Agent ID.
📝 The Agent Contract
Create an AGENTS.md file in your agent workspace. This file tells the agent how to behave. You must define:
- How to read the pane (tmux capture-pane).
- How to write to the pane (tmux send-keys).
- How to handle specific commands like "status", "send", or "restart".
✅ The Readiness Test
You are finished only when you pass these five checks:
- The bot replies in your Telegram topic.
- Your prompt reaches the tmux pane.
- The coding agent starts working on the prompt.
- A log file proves the agent handled your topic.
- The group is locked to your User ID only.
Source: https://dev.to/jerilk/coding-agents-over-telegram-part-2-from-zero-to-an-agent-that-answers-2777
Optional learning community: https://t.me/GyaanSetuAi