𝗖𝗼𝗱𝗶𝗻𝗴 𝗔𝗴𝗲𝗻𝘁𝘀 𝗼𝘃𝗲𝗿 𝗧𝗲𝗹𝗲𝗴𝗿𝗮𝗺: 𝗙𝗿𝗼𝗺 𝗭𝗲𝗿𝗼 𝘁𝗼 𝗔𝗻 𝗔𝗴𝗲𝗻𝘁 𝗧𝗵𝗮𝘁 𝗔𝗻𝘀𝘄𝗲𝗿𝘀

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:

  1. 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

  2. Run the setup with your bot token: OPENCLAW_BOT_TOKEN="" OPENCLAW_BOT_ACCOUNT="my-bot" ./setup-openclaw.sh

  3. 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

에이전트 워크스페이스에 AGENTS.md 파일을 생성하세요. 이 파일은 에이전트가 어떻게 행동해야 하는지 정의합니다. 다음 사항을 반드시 정의해야 합니다:

  • 창(pane)을 읽는 방법 (tmux capture-pane).
  • 창(pane)에 쓰는 방법 (tmux send-keys).
  • "status", "send", 또는 "restart"와 같은 특정 명령을 처리하는 방법.

✅ 준비 상태 테스트 (Readiness Test)

다음 다섯 가지 체크리스트를 모두 통과해야 완료된 것입니다:

  1. 봇이 Telegram 토픽에 응답합니다.
  2. 프롬프트가 tmux 창(pane)에 전달됩니다.
  3. 코딩 에이전트가 프롬프트에 따라 작업을 시작합니다.
  4. 로그 파일을 통해 에이전트가 토픽을 처리했음을 확인할 수 있습니다.
  5. 그룹이 귀하의 User ID로만 잠겨 있습니다.

출처: https://dev.to/jerilk/coding-agents-over-telegram-part-2-from-zero-to-an-agent-that-answers-2777

선택 사항 학습 커뮤니티: https://t.me/GyaanSetuAi