OpenClaw: Deploy Claude as Your WhatsApp Assistant
OpenClaw is an open-source framework that removes the infrastructure work from deploying Claude agents to messaging platforms. This post covers getting Claude running on WhatsApp in an afternoon.
Key Takeaways
- Comprehensive strategies proven to work at top companies
- Actionable tips you can implement immediately
- Expert insights from industry professionals
Most teams that want a Claude-powered WhatsApp bot spend their first three weeks wiring up webhooks, OAuth flows, message queues, and session storage before they write a single line of agent logic. OpenClaw exists to skip that part. It is an open-source framework that handles the infrastructure layer so you can focus entirely on what your agent does, not how messages get routed.
What Is OpenClaw and Why Does It Exist
OpenClaw is a thin orchestration layer that sits between a messaging platform and the Claude API. It handles incoming message routing, session management, tool dispatch, and response delivery. You define an agent config with a system prompt, tools, and memory settings, and OpenClaw handles the rest.
The alternative is building from scratch. That means implementing the WhatsApp Business API webhook, verifying message signatures, storing conversation state in a database, handling retries when Claude returns an error, and building a queue so messages do not get dropped during traffic spikes. None of that is hard on its own, but it is weeks of work that has nothing to do with your actual product. OpenClaw packages all of it into a single dependency with sensible defaults.
The framework is also platform-agnostic by design. The same agent config you write for WhatsApp can be deployed to Telegram, Slack, or a web chat widget by changing one line. That portability matters when you want to test user behavior across channels before committing to one. Your investment in writing a good system prompt pays off across every channel you add later.
Setting Up a WhatsApp Business API Connection
WhatsApp requires a Business API account through Meta. You will need a verified business, a phone number that is not already linked to the WhatsApp consumer app, and a Meta developer app with the WhatsApp product enabled. Meta's setup process takes a day or two for verification, but once you have your credentials, OpenClaw handles the webhook layer automatically.
OpenClaw reads your WhatsApp credentials from environment variables at startup:
OPENCLAW_CHANNEL=whatsapp
WHATSAPP_PHONE_NUMBER_ID=your_phone_number_id
WHATSAPP_ACCESS_TOKEN=your_permanent_access_token
WHATSAPP_VERIFY_TOKEN=a_random_string_you_choose
ANTHROPIC_API_KEY=your_claude_api_key
OpenClaw exposes a webhook endpoint at /webhook that you register in the Meta developer console. When Meta sends a verification challenge to confirm your server owns the endpoint, OpenClaw responds automatically using your verify token. From that point on, every incoming WhatsApp message is routed through OpenClaw to Claude, and Claude's response is delivered back to the user without any additional code on your part.
Writing Your Agent Config
The agent config is a YAML file that defines how your Claude agent behaves. The three core sections are the system prompt, memory settings, and tools. Getting all three right is what separates a bot users keep coming back to from one they try once and abandon.
agent:
name: assistant
model: claude-opus-4-5
system_prompt: |
You are a helpful personal assistant available on WhatsApp.
You have access to the user's name and conversation history.
Keep responses concise since this is a mobile messaging context.
Use plain text only. Do not use markdown formatting, asterisks,
or hyphens as bullet points. WhatsApp renders none of these.
Write in short paragraphs or numbered lists when structure is needed.
memory:
type: rolling_window
max_turns: 20
tools:
- type: web_search
- type: calculator
The system prompt for a WhatsApp context must explicitly instruct Claude to avoid markdown. WhatsApp does not render asterisks as bold text or hyphens as bullet points. Users notice when a bot sends raw asterisks in its replies, and it erodes trust immediately. Plain prose works better in every messaging environment.
The memory section controls how much conversation history Claude sees on each turn. A rolling window of 20 turns is usually enough for a personal assistant bot. If you are building a customer support agent that handles long troubleshooting sessions, you may want to increase this limit or switch to a summarization strategy that compresses older turns rather than dropping them entirely.
Prompt
"You are a personal assistant on WhatsApp. The user's name is [NAME]. You have access to their message history for this conversation. Respond concisely in plain text. If a question requires a calculation or real-time information, use the available tools before answering. Never use markdown formatting, asterisks, or hyphens as list markers."
Practical Use Cases and Channel Tradeoffs
WhatsApp has properties that make it especially well-suited for certain agent use cases. It is where people already live, so a personal assistant that runs on WhatsApp gets used because it requires zero context switch from a user's existing habits. The conversational format naturally handles multi-turn tasks. And WhatsApp Business lets you send proactive messages (called templates) to opted-in users, which opens up use cases like daily briefings or alert notifications that users have consented to receive.
The strongest use cases for a WhatsApp Claude agent are personal assistant (quick questions, reminders, lookups), team bot (a shared number your team texts to delegate research tasks), and first-line customer support (handling FAQ volume before routing complex issues to a human agent who can take over the conversation thread).
The tradeoffs are real and worth understanding before you build. WhatsApp has a 24-hour messaging session window. If a user sends you a message, you have 24 hours to reply with free-form messages. After that window closes, you can only send pre-approved template messages. For a support bot, this means you need to resolve issues within the session window or capture contact information to follow up via another channel.
WhatsApp also has no native rendering for rich content. Agent responses that work beautifully in Slack (code blocks, formatted tables, linked text) land as walls of unformatted characters on WhatsApp. Design your system prompt with the channel constraints in mind: short paragraphs, numbered lists where structure matters, and no markdown. Agents that are designed for the channel rather than against it feel natural to users. Agents that ignore the channel constraints feel like they were ported from somewhere else.
Want to build this live with Aki?
Join a Lightning Lesson and go deeper on this topic. Browse upcoming sessions →
Aki Wijesundara
Expert team of AI professionals and career advisors with experience at top tech companies. We've helped 500+ students land internships at Google, Meta, OpenAI, and other leading AI companies.
Ready to Launch Your AI Career?
Join our comprehensive program and get personalized guidance from industry experts who've been where you want to go.
Table of Contents
Share Article
Get Weekly AI Career Tips
Join 5,000+ professionals getting actionable career advice in their inbox.
No spam. Unsubscribe anytime.