Overview
The WhatsApp channel uses the Baileys library to connect to WhatsApp Web. It supports both personal WhatsApp numbers (shared) and dedicated numbers (separate device).Installation
Run the/add-whatsapp skill in Claude Code:
- Install the WhatsApp channel code
- Add required dependencies (
@whiskeysockets/baileys,qrcode,qrcode-terminal) - Guide you through authentication
- Register your first chat
Authentication Methods
WhatsApp offers three authentication methods:QR Code in Browser (Recommended)
Displays a large, scannable QR code in your browser. When to use: Desktop environments, best user experiencePairing Code
Enter a numeric code on your phone (no camera needed). When to use: Headless servers, camera issues, preference for typingThe pairing code expires in ~60 seconds and must be entered immediately. Have WhatsApp open and ready before running the command.
QR Code in Terminal
Displays a QR code directly in the terminal. When to use: SSH sessions, minimal environmentsConfiguration
Shared vs Dedicated Number
Shared Number (Personal WhatsApp)- Use your personal WhatsApp number
- Recommended: Use self-chat or a solo group
- All messages from linked device appear in your WhatsApp
- Use a separate phone/SIM for the assistant
- Users DM the bot’s number or add it to groups
- Complete separation from personal messages
Chat Registration
After authentication, register your first chat: Self-Chat (Recommended for shared numbers)How It Works
Connection
- WhatsApp channel reads credentials from
store/auth/creds.json - Connects to WhatsApp Web using Baileys library
- Maintains persistent session (credentials last ~20 days)
- Auto-reconnects on disconnection
Message Handling
- Incoming: Messages arrive via Baileys WebSocket
- Storage: Stored in SQLite with sender info and timestamp
- Routing: Main loop polls and routes to registered chats
- Processing: Agent processes in isolated container
- Outgoing: Response sent back through Baileys
Group Metadata Sync
WhatsApp groups need metadata sync to get group names:Troubleshooting
QR Code Expired
QR codes expire after ~60 seconds. Delete auth and retry:Pairing Code Not Working
Codes expire in ~60 seconds. Ensure:- Phone number includes country code without
+(e.g.,1234567890) - Phone has internet access
- WhatsApp is updated to latest version
- You enter the code immediately when it appears
“conflict” Disconnection
Happens when two instances connect with the same credentials. Ensure only one NanoClaw process is running:Bot Not Responding
Group Names Not Showing
Run group metadata sync:Implementation Details
Dependencies
@whiskeysockets/baileys- WhatsApp Web protocol implementationqrcode- QR code generation for browser displayqrcode-terminal- QR code rendering in terminal
Session Storage
Credentials are stored instore/auth/:
creds.json- Authentication credentialsapp-state-sync-*.json- App state sync datasender-key-*.json- E2E encryption keys
JID Format
- Individual chats:
<phone-number>@s.whatsapp.net(e.g.,[email protected]) - Group chats:
<group-id>@g.us(e.g.,[email protected])
Self-Registration Code
store/auth/creds.json exists.
Next Steps
Add Telegram
Add Telegram as a second channel
Channel Overview
Learn about the channel system