WhatsApp Setup
Overview
Section titled “Overview”Connect Clawdbot to WhatsApp and chat with Claude directly from your phone. This guide covers setup, configuration, and best practices.
Prerequisites
Section titled “Prerequisites”- Clawdbot installed and configured
- WhatsApp account on your phone
- Active internet connection on both phone and server
-
Enable WhatsApp channel
Edit your
.envfile:Terminal window WHATSAPP_ENABLED=true -
Install WhatsApp dependencies
Terminal window pip install whatsapp-web.py# or for Node.js basednpm install whatsapp-web.js -
Start Clawdbot
Terminal window python -m clawdbot -
Scan QR Code
A QR code will appear in your terminal. On your phone:
- Open WhatsApp
- Go to Settings → Linked Devices
- Tap “Link a Device”
- Scan the QR code
-
Verify connection
You should see:
[INFO] WhatsApp connected successfully[INFO] Ready to receive messages
Configuration Options
Section titled “Configuration Options”# Enable/disable WhatsApp channelWHATSAPP_ENABLED=true
# Session storage locationWHATSAPP_SESSION_PATH=.wwebjs_auth
# Rate limiting (messages per minute)WHATSAPP_RATE_LIMIT=10
# Auto-reply to group messagesWHATSAPP_GROUPS_ENABLED=false
# Message prefix for bot commands (optional)WHATSAPP_PREFIX=!
# Allowed phone numbers (empty = all)WHATSAPP_ALLOWED_NUMBERS=+1234567890,+0987654321Features
Section titled “Features”Direct Messages
Section titled “Direct Messages”Send any message to your own number or have contacts message you. Clawdbot responds as if you were chatting with Claude.
Group Chat Support
Section titled “Group Chat Support”When enabled, Clawdbot can respond in group chats. Configure with:
WHATSAPP_GROUPS_ENABLED=trueWHATSAPP_GROUP_PREFIX=@bot # Only respond when mentionedMedia Support
Section titled “Media Support”| Media Type | Receive | Send |
|---|---|---|
| Text | ✅ | ✅ |
| Images | ✅ | ⚠️ Limited |
| Voice | ✅ (transcribed) | ❌ |
| Documents | ✅ | ❌ |
| Location | ✅ | ❌ |
Best Practices
Section titled “Best Practices”Avoiding Rate Limits
Section titled “Avoiding Rate Limits”WhatsApp may restrict your account if it detects automated behavior. To stay safe:
- Don’t spam: Keep messages reasonable
- Add delays: Configure rate limiting
- Avoid bulk messaging: Don’t use for mass outreach
- Keep natural patterns: Vary response times slightly
Session Management
Section titled “Session Management”The WhatsApp session is stored in .wwebjs_auth/. To reset:
rm -rf .wwebjs_auth/# Restart Clawdbot and scan QR code againRunning 24/7
Section titled “Running 24/7”For always-on operation:
- Use a VPS or home server
- Set up as a system service (see Linux Guide)
- Keep your phone connected to WiFi
Troubleshooting
Section titled “Troubleshooting”QR Code Not Showing
Section titled “QR Code Not Showing”# Try running with debugLOG_LEVEL=DEBUG python -m clawdbot
# Check if terminal supports QR display# Some terminals need specific encodingTERM=xterm-256color python -m clawdbotDisconnection Issues
Section titled “Disconnection Issues”Symptoms: Bot disconnects randomly
Solutions:
- Keep phone connected to internet
- Don’t logout from WhatsApp Web manually
- Check for WhatsApp app updates
- Reset session if needed
Message Not Delivered
Section titled “Message Not Delivered”Check:
- Phone has internet access
- WhatsApp account is not restricted
- Rate limits not exceeded
- Recipient hasn’t blocked you
”Session Expired” Error
Section titled “”Session Expired” Error”# Clear session and re-authenticaterm -rf .wwebjs_auth/python -m clawdbot# Scan new QR codeSecurity Considerations
Section titled “Security Considerations”- Your number is visible: Recipients see your real number
- Messages on your phone: Conversations appear in your WhatsApp
- Account risk: Excessive automation may trigger WhatsApp restrictions
- End-to-end encryption: Messages are encrypted by WhatsApp
Example Usage
Section titled “Example Usage”Once connected, simply message your Clawdbot-connected number:
You: What's the capital of France?Bot: The capital of France is Paris.
You: Write me a short poem about codingBot: Here's a poem for you: In lines of code, we dream and build, Logic flows, a canvas filled...