Telegram Coding Agent

Use OpenClaw as a mobile-first coding assistant through Telegram - code from anywhere, anytime.

3 min read

One of the most powerful ways to use OpenClaw is through Telegram. This gives you a mobile-first AI coding assistant that you can interact with from your phone, tablet, or any device with Telegram installed.

Why Telegram?

Traditional coding requires sitting at a computer with an IDE open. But what if you could:

  • Fix a bug while commuting on the train
  • Review and merge PRs from your phone
  • Deploy updates while away from your desk
  • Brainstorm solutions during a walk

Telegram + OpenClaw makes this possible.

Setting Up the Telegram Bot

Prerequisites

  • A running Clawdy instance
  • A Telegram account
  • The Telegram app (mobile or desktop)

Step 1: Get Your Bot Token

  1. Open Telegram and search for @BotFather
  2. Send /newbot to create a new bot
  3. Follow the prompts to name your bot
  4. Copy the API token you receive
Use this token to access the HTTP API:
123456789:ABCdefGHIjklMNOpqrsTUVwxyz

Step 2: Configure OpenClaw

SSH into your instance or use the web terminal:

# Navigate to OpenClaw config
cd ~/openclaw

# Set your Telegram bot token
export TELEGRAM_BOT_TOKEN="your-token-here"

# Restart OpenClaw to apply
sudo systemctl restart openclaw

Or set it through the Clawdy dashboard under Settings > Environment Variables.

Step 3: Start Chatting

  1. Open Telegram
  2. Search for your bot by its username
  3. Click Start
  4. Send your first message!
You: Create a Python script that fetches weather data from an API

Bot: I'll create a weather fetching script for you...

Use Cases

Mobile Code Review

Review pull requests from your phone:

You: Show me the open PRs in my-project repo

Bot: Here are 3 open pull requests:
1. #42 - Add user authentication (by @alice)
2. #43 - Fix pagination bug (by @bob)
3. #44 - Update dependencies (by @dependabot)

You: Show me the diff for PR #42

Bot: Here's the diff for "Add user authentication":
[Shows code changes]

You: Looks good, merge it

Bot: PR #42 has been merged into main.

Quick Bug Fixes

Fix issues without opening your laptop:

You: There's a typo in src/utils/format.ts line 23, 
     "recieve" should be "receive"

Bot: I found the typo. Here's the fix:
- const recieve = (data) => {
+ const receive = (data) => {

Should I commit this change?

You: Yes, commit with message "fix: correct typo in format.ts"

Bot: Committed and pushed to main.

Deployment Management

Deploy and monitor from anywhere:

You: What's the status of the production deployment?

Bot: Production status:
- Last deploy: 2 hours ago
- Commit: abc123 "Add new feature"
- Health: All systems operational
- CPU: 23% | Memory: 45%

You: Deploy the staging branch to production

Bot: Starting deployment...
[Progress updates]
Deployment complete! 

Learning and Exploration

Ask questions about your codebase:

You: How does the authentication middleware work?

Bot: The auth middleware in src/middleware/auth.ts:
1. Extracts JWT from Authorization header
2. Validates token signature
3. Decodes user payload
4. Attaches user to request context

Here's the relevant code:
[Shows code snippet]

Tips for Mobile Coding

Use Voice Messages

Telegram supports voice messages. Describe your request verbally:

  1. Hold the microphone button
  2. Describe what you need
  3. OpenClaw transcribes and responds

"Hey, can you add error handling to the user registration function and make sure it validates email format?"

Save Common Commands

Pin frequently used prompts or create a saved messages list:

  • "Show git status"
  • "Run the tests"
  • "Deploy to staging"
  • "Show recent errors"

Use Telegram's Features

  • Reply to specific messages for context
  • Forward code snippets from other chats
  • Use inline formatting for code: `like this`
  • Send files directly for OpenClaw to analyze

Security Considerations

Private Bot

Your Telegram bot is private by default. Only you can interact with it unless you:

  • Share the bot username publicly
  • Add others to the allowed users list

Sensitive Data

Be cautious about:

  • Sending API keys or secrets via Telegram
  • Committing credentials through the bot
  • Sharing screenshots that include sensitive info

The bot runs on your private Clawdy instance, but Telegram messages pass through Telegram's servers.

Two-Factor Authentication

Enable 2FA on your Telegram account for additional security:

  1. Go to Settings > Privacy and Security
  2. Enable Two-Step Verification
  3. Set a strong password

Troubleshooting

Bot Not Responding

  1. Check that OpenClaw is running: systemctl status openclaw
  2. Verify the bot token is set correctly
  3. Check logs: journalctl -u openclaw -f

Slow Responses

Mobile networks can have latency. If responses are slow:

  1. Wait for the "typing..." indicator
  2. Avoid sending multiple messages before receiving a response
  3. Check your internet connection

Rate Limits

Telegram has rate limits. If you're sending many messages:

  • Wait a few seconds between messages
  • Batch related requests into single messages
  • Use the web interface for intensive sessions

Advanced Configuration

Allowed Users

Restrict who can use your bot:

# In OpenClaw config
TELEGRAM_ALLOWED_USERS="123456789,987654321"

Custom Commands

Add bot commands for quick access:

  1. Open @BotFather
  2. Send /setcommands
  3. Select your bot
  4. Add commands:
status - Show instance status
deploy - Deploy to production
logs - Show recent logs
help - Show available commands

Webhooks vs Polling

For faster responses, configure webhooks:

# Set webhook URL
TELEGRAM_WEBHOOK_URL="https://your-slug.clawdy.app/telegram/webhook"

Next Steps