Minimal multi-channel AI assistant with WhatsApp integration and queue-based architecture.
TinyClaw is a lightweight wrapper around Claude Code that:
- โ Connects WhatsApp (via QR code)
- โ Processes messages sequentially (no race conditions)
- โ Maintains conversation context
- โ Runs 24/7 in tmux
- โ Ready for multi-channel (Telegram, etc.)
Key innovation: File-based queue system prevents race conditions and enables multi-channel support.
โโโโโโโโโโโโโโโโโโโ
โ WhatsApp โโโโ
โ Client โ โ
โโโโโโโโโโโโโโโโโโโ โ
โโโโ Queue (incoming/)
โโโโโโโโโโโโโโโโโโโ โ โ
โ Telegram โโโโค โโโโโโโโโโโโโโโโ
โ (future) โ โ โ Queue โ
โโโโโโโโโโโโโโโโโโโ โ โ Processor โ
โ โโโโโโโโโโโโโโโโ
Other Channels โโโโโโโ โ
claude --dangerously-skip-permissions -c -p
โ
Queue (outgoing/)
โ
โโโโโโโโโโโโโโโโโโโ
โ Channels send โ
โ responses โ
โโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโ
โ WhatsApp โ Queue โ
โ Client โ Processor โ
โโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโค
โ Heartbeat โ Logs โ
โโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโ
- macOS or Linux
- Claude Code installed
- Node.js v14+
- tmux
cd /Users/jliao/workspace/tinyclaw
# Install dependencies
npm install
# Make scripts executable
chmod +x *.sh *.js
# Start TinyClaw
./tinyclaw.sh startA QR code will appear in your terminal:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
WhatsApp QR Code
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
[QR CODE HERE]
๐ฑ Scan with WhatsApp:
Settings โ Linked Devices โ Link a Device
Scan it with your phone. Done! ๐
Send a WhatsApp message to yourself from a different WhatsApp account:
"Hello Claude!"
You'll get a response! ๐ค
# Start TinyClaw
./tinyclaw.sh start
# Check status
./tinyclaw.sh status
# Send manual message
./tinyclaw.sh send "What's the weather?"
# Reset conversation
./tinyclaw.sh reset
# View logs
./tinyclaw.sh logs whatsapp
./tinyclaw.sh logs queue
# Attach to tmux
./tinyclaw.sh attach
# Stop
./tinyclaw.sh stop- Connects to WhatsApp via QR code
- Writes incoming messages to queue
- Reads responses from queue
- Sends replies back
- Polls incoming queue
- Processes ONE message at a time
- Calls
claude -c -p - Writes responses to outgoing queue
- Runs every 5 minutes
- Sends heartbeat via queue
- Keeps conversation active
- Main orchestrator
- Manages tmux session
- CLI interface
WhatsApp message arrives
โ
whatsapp-client.js writes to:
.tinyclaw/queue/incoming/whatsapp_<id>.json
โ
queue-processor.js picks it up
โ
Runs: claude -c -p "message"
โ
Writes to:
.tinyclaw/queue/outgoing/whatsapp_<id>.json
โ
whatsapp-client.js sends response
โ
User receives reply
tinyclaw/
โโโ .claude/ # Claude Code config
โ โโโ settings.json # Hooks config
โ โโโ hooks/ # Hook scripts
โโโ .tinyclaw/ # TinyClaw data
โ โโโ queue/
โ โ โโโ incoming/ # New messages
โ โ โโโ processing/ # Being processed
โ โ โโโ outgoing/ # Responses
โ โโโ logs/
โ โโโ whatsapp-session/
โ โโโ heartbeat.md
โโโ tinyclaw.sh # Main script
โโโ whatsapp-client.js # WhatsApp I/O
โโโ queue-processor.js # Message processing
โโโ heartbeat-cron.sh # Health checks
./tinyclaw.sh resetSend: !reset or /reset
Next message starts fresh (no conversation history).
Edit heartbeat-cron.sh:
INTERVAL=300 # seconds (5 minutes)Edit .tinyclaw/heartbeat.md:
Check for:
1. Pending tasks
2. Errors
3. Unread messages
Take action if needed.# WhatsApp activity
tail -f .tinyclaw/logs/whatsapp.log
# Queue processing
tail -f .tinyclaw/logs/queue.log
# Heartbeat checks
tail -f .tinyclaw/logs/heartbeat.log
# All logs
./tinyclaw.sh logs daemon# Incoming messages
watch -n 1 'ls -lh .tinyclaw/queue/incoming/'
# Outgoing responses
watch -n 1 'ls -lh .tinyclaw/queue/outgoing/'Messages processed sequentially, one at a time:
Message 1 โ Process โ Done
Message 2 โ Wait โ Process โ Done
Message 3 โ Wait โ Process โ Done
Add Telegram by creating telegram-client.js:
// Write to queue
fs.writeFileSync(
'.tinyclaw/queue/incoming/telegram_<id>.json',
JSON.stringify({ channel: 'telegram', message, ... })
);
// Read responses
// Same format as WhatsAppQueue processor handles it automatically!
Uses claude -c -p:
-c= continue conversation-p= print mode (clean output)- No tmux capture needed
WhatsApp session persists across restarts:
# First time: Scan QR code
./tinyclaw.sh start
# Subsequent starts: Auto-connects
./tinyclaw.sh restart- WhatsApp session stored locally in
.tinyclaw/whatsapp-session/ - Queue files are local (no network exposure)
- Each channel handles its own authentication
- Claude runs with your user permissions
# Check logs
./tinyclaw.sh logs whatsapp
# Re-authenticate
rm -rf .tinyclaw/whatsapp-session/
./tinyclaw.sh restart# Check queue processor
./tinyclaw.sh status
# Check queue
ls -la .tinyclaw/queue/incoming/
# View queue logs
./tinyclaw.sh logs queue# Use helper script
./show-qr.sh
# Or attach to tmux
tmux attach -t tinyclawsudo systemctl enable tinyclaw
sudo systemctl start tinyclawpm2 start tinyclaw.sh --name tinyclaw
pm2 save[program:tinyclaw]
command=/path/to/tinyclaw/tinyclaw.sh start
autostart=true
autorestart=trueYou: "Remind me to call mom"
Claude: "I'll remind you!"
[5 minutes later via heartbeat]
Claude: "Don't forget to call mom!"
You: "Review my code"
Claude: [reads files, provides feedback]
You: "Fix the bug"
Claude: [fixes and commits]
- WhatsApp on phone
- Telegram on desktop
- CLI for scripts All share the same Claude conversation!
- Inspired by OpenClaw by Peter Steinberger
- Built on Claude Code
- Uses whatsapp-web.js
MIT
TinyClaw - Small but mighty! ๐ฆโจ