Author: Nikhil Bhan
🚀 What I Built
Imagine having an AI personal assistant that you can text from anywhere — your phone, your desktop, wherever — and it knows you, remembers context, and can even send you messages on a schedule without you asking.
That's exactly what I built using OpenClaw, a free and open-source AI agent framework. In under two hours, I had a fully functional, secured, autonomous AI assistant connected to Telegram and powered by Anthropic's Claude Sonnet 4.5.
In this post I'll walk you through exactly how I did it — installation, configuration, Telegram integration, security hardening, and cron-based automation.
🧰 What You'll Need
- A Windows computer (PowerShell required for install)
- An Anthropic API key (get one at console.anthropic.com)
- A Telegram account (mobile or desktop)
- ~90 minutes of your time
🦀 What is OpenClaw?
OpenClaw is a free, open-source AI agent that runs locally on your machine. It acts as a gateway between you and AI providers like Anthropic. Key features:
- Control UI — a browser-based chat interface to interact with your assistant
- Gateway — a background process that keeps your AI available at all times
- Channel integrations — connect Telegram, WhatsApp, Discord, and more
- Cron jobs — schedule autonomous AI tasks to run on a timer
- Plugins & Skills — extend what your assistant can do
- Allowlists — restrict who can access your bot
It's the closest thing I've found to a personal AI operating system.
Step 1: Installing OpenClaw and Running the Gateway
Open PowerShell on your Windows machine and run:
powershell
iwr -useb https://openclaw.ai/install.ps1 | iex
This launches the OpenClaw Onboarding Wizard. During setup, you'll:
- Choose your AI provider — select Anthropic
- Choose your model — I selected Claude Sonnet 4.5
- Enter your Anthropic API key
The wizard also installs the OpenClaw Gateway, which is a background service that keeps your AI assistant running even when you're not actively using the Control UI.
Once installed, verify everything is working:
openclaw gateway status
Troubleshooting tip: If you can't access the Control UI in your browser, check the PowerShell terminal running the Gateway for the correct IP address. I initially tried the wrong IP and spent time debugging — the correct one is shown in the terminal output.
Step 2: Your First Conversation in the Control UI
Open your browser and navigate to the IP address shown in the Gateway terminal (typically http://127.0.0.1:18789).
This is the OpenClaw Control UI, a clean chat interface where you can talk directly to your AI assistant.
Try these prompts to get started:
Hello! Can you introduce yourself and tell me what you can do?
Your assistant will list its capabilities — task automation, web search, calendar management, connecting to messaging platforms, running commands, and more.
Check token usage with /status:
/status
This gives you real-time session data: which AI provider is active, which model you're using, and how many tokens have been sent and received. It's excellent for monitoring API costs.
Step 3: Connecting Telegram for Mobile Access
This is where things get exciting. You can now message your AI from your phone.
3.1 Create a Telegram Bot
- Open Telegram and search for @botfather
- Send the command
/newbot - Give your bot a name (I used
MyNextWorkClaw) - Give it a username (I used
teknikassistantbot) - Copy the bot token that BotFather provides
3.2 Add the Bot to OpenClaw
Go to your OpenClaw Control UI and send this message to your assistant:
Add a Telegram channel using this bot token: [YOUR_BOT_TOKEN]
Your assistant will update the openclaw.json configuration file automatically.
3.3 Pair Your Telegram Account
- Open Telegram and search for your bot by username
- Send
/start— a pairing code will be returned - Go back to the Control UI and send:
Approve this pairing code: [PAIRING_CODE]
That's it. Your Telegram account is now paired with your AI assistant. Send it a message from Telegram — it will respond!
Step 4: Securing the Bot with an Allowlist
By default, anyone who finds your bot could message it and use your Anthropic API credits. We need to lock it down.
Get Your Telegram User ID
There are several bots that can tell you your User ID (such as @userinfobot). You can also see it in the pairing confirmation.
Update the Allowlist
In the Control UI, tell your assistant:
Update the OpenClaw configuration so that only Telegram User ID [YOUR_USER_ID] is allowed to use this bot.
Verify the change:
Show me the current OpenClaw configuration.
You should see your User ID in the allowedUsers field. Anyone else who messages the bot will be blocked.
Step 5: Automating with Cron Jobs
This is the feature that makes OpenClaw feel genuinely agentic. Instead of you always initiating the conversation, your AI assistant can proactively send you messages.
In the Control UI:
Set up a cron job that runs every 10 minutes and sends me a Telegram message with a motivational quote, a fun fact, and a random piece of trivia.
Your assistant will create the cron configuration. After 10 minutes, you'll receive a Telegram message from your bot — completely unprompted — containing exactly what you asked for.
This is a simple example, but the possibilities are significant:
- Daily summaries of your calendar
- Reminders for tasks or medications
- Weather alerts
- Web-scraped news digests
📊 What I Learned
| Concept | What It Does |
|---|---|
/status command |
Tracks token usage and session info |
| OpenClaw Gateway | Keeps your AI running in the background |
| Bot pairing code | Securely connects your Telegram identity to OpenClaw |
openclaw.json |
The config file that controls everything |
| Allowlist | Restricts bot access to approved User IDs only |
| Cron jobs | Enables proactive, autonomous AI behavior |
🔮 What's Next
This project opened my eyes to what a local AI agent can really do. My next goals with OpenClaw:
- Build custom OpenClaw Skills — domain-specific capabilities for my workflows
- Create automated AWS monitoring alerts — integrating with my GuardDuty log analyzer project
- Connect to calendar and task tools — true personal assistant automation
💡 Why OpenClaw Over Just Using Claude.ai?
That's a fair question. Claude.ai is excellent for conversation, but OpenClaw gives you:
- Persistent background availability — your assistant is always on
- Channel flexibility — use Telegram, WhatsApp, Discord — not just a web tab
- Cron automation — AI-initiated actions, not just reactive responses
- Local control — your config, your API key, your data flow
- Skills and plugins — extend behavior programmatically
🏁 Conclusion
In about 90 minutes, I went from zero to a secured, mobile-accessible, autonomous AI personal assistant. The combination of OpenClaw's simplicity, Anthropic's powerful Claude models, and Telegram's ubiquity makes this genuinely practical for everyday use.
If you're building in the AWS/AI/automation space like I am, I'd strongly encourage you to try this. The cron job capability alone changes how you think about what AI can do for you.
GitHub / Resources:
- OpenClaw: https://openclaw.ai
- Anthropic API: https://console.anthropic.com
- NextWork Projects: https://nextwork.org
Nikhil Bhan is an AWS Community Builder (AI Engineering) based in Vancouver, Canada, with 13 years of experience in healthcare IT, systems administration, and technical documentation.
Top comments (0)