Architecture
NanoClaw Pro uses a skill-based channel system where each communication channel (WhatsApp, Telegram, Slack, Discord, Gmail) is installed as a separate skill. The core ships with no channels built in — you choose which channels to install.Self-Registration Pattern
Channels use a self-registration pattern at startup:- Each channel skill adds implementation code to
src/channels/ - The channel registers itself by calling
registerChannel()at module load time - At startup, NanoClaw loops through registered channels and connects those with valid credentials
- Channels without credentials are automatically skipped
Channel Interface
Every channel implements a standard interface:Available Channels
Personal or dedicated number with QR/pairing code auth
Telegram
Bot-based with simple token authentication
Slack
Socket Mode integration (no public URL needed)
Discord
Bot integration with Gateway Intents
Gmail
Email integration with OAuth authentication
How Channels Work
Message Flow
- Incoming Message → Channel receives message from platform API
- Store in SQLite → Message is stored with metadata
- Polling Loop → Main loop polls for new messages every 2 seconds
- Routing Check → Router verifies chat is registered and checks trigger pattern
- Agent Invocation → Message is processed by Claude in an isolated container
- Response → Router sends response back through the owning channel
Multi-Channel Support
NanoClaw Pro can run multiple channels simultaneously:- Each channel auto-enables when its credentials are present
- Channels operate independently and in parallel
- Messages are routed to the correct channel based on JID prefix (
whatsapp:,tg:,slack:, etc.) - No conflicts — you can have WhatsApp, Telegram, and Slack all running together
Adding a New Channel
To create a custom channel integration:Create Channel Implementation
Add a new file to
src/channels/<name>.ts that implements the Channel interface.See existing channel implementations in
.claude/skills/add-*/add/src/channels/ for reference patterns.Channel Registry
The channel system is built on a factory registry insrc/channels/registry.ts:
ChannelOpts (callbacks for onMessage, onChatMetadata, and registeredGroups) and returns either a Channel instance or null if credentials are not configured.
Key Files
| File | Purpose |
|---|---|
src/channels/registry.ts | Channel factory registry |
src/channels/index.ts | Barrel imports that trigger channel self-registration |
src/types.ts | Channel interface, ChannelOpts, message types |
src/index.ts | Orchestrator — instantiates channels, runs message loop |
src/router.ts | Finds owning channel for a JID, formats messages |
Next Steps
Install WhatsApp
Set up WhatsApp with QR code or pairing code
Install Telegram
Create a Telegram bot and connect