MiniClaw
A multi-channel personal AI assistant built with Zgent.
MiniClaw is a personal AI assistant that connects to Telegram, Discord, Slack, and a web chat UI — all through Zgent channels. It demonstrates how Zgent's channel system handles multiple message sources with a single agent definition.
Inspired by OpenClaw, MiniClaw achieves similar functionality in ~1,500 lines of Python.
Architecture
CLI ─────────────┐
Telegram Bot ────┤
Discord Bot ─────┤──▶ Channels ──▶ Zgent Context ──▶ AgentDefinition
Slack Bot ───────┤ │
WebChat (HTML) ──┘ ClaudeEngine
+ Skills
+ HooksHow it maps to Zgent
| Concept | MiniClaw implementation |
|---|---|
| Channels | TelegramChannel, DiscordChannel, SlackChannel, WSServerChannel |
| Dispatcher | One agent instance per chat (keyed by channel + chat ID) |
| Skills | SKILL.md files loaded from ~/.miniclaw/workspace/skills/ |
| Agent definition | Single definition with Claude engine and skill-injected system prompt |
Quick start
Run the python -m miniclaw ... commands below from zgent/python-sdk/examples/.
Install dependencies
cd zgent/python-sdk/examples
pip install -e ..
pip install websocketsInitialize workspace
cd zgent/python-sdk/examples
python -m miniclaw initThis creates ~/.miniclaw/ with default config, a SOUL.md personality file, and an example skill.
Start the gateway
cd zgent/python-sdk/examples
export ANTHROPIC_API_KEY="sk-ant-..."
python -m miniclaw gatewayOpen the web chat
Visit http://127.0.0.1:18790/ in your browser.
Channel adapters
Each channel adapter is a Zgent BaseChannel subclass:
| Channel | Session ID format | Dependency |
|---|---|---|
| WebChat | webchat-{id} | websockets |
| Telegram | tg-{chat_id} | python-telegram-bot |
| Discord | dc-{channel_id} | discord.py |
| Slack | sk-{channel_id} | slack-bolt |
Configuration
Config file lives at ~/.miniclaw/config.json:
{
"agent": {
"model": "claude-sonnet-4-20250514",
"system_prompt_file": "SOUL.md"
},
"gateway": {
"host": "127.0.0.1",
"port": 18789
},
"channels": {
"telegram": { "enabled": true, "botToken": "123456:ABCDEF" },
"discord": { "enabled": true, "token": "..." },
"slack": { "enabled": true, "botToken": "xoxb-...", "appToken": "xapp-..." }
}
}Environment variables override config values:
| Variable | Effect |
|---|---|
ANTHROPIC_API_KEY | Required for Claude |
TELEGRAM_BOT_TOKEN | Auto-enables Telegram channel |
DISCORD_BOT_TOKEN | Auto-enables Discord channel |
SLACK_BOT_TOKEN / SLACK_APP_TOKEN | Auto-enables Slack channel |
Skills
Skills are markdown files that extend the assistant's capabilities. Place them under ~/.miniclaw/workspace/skills/<name>/SKILL.md:
~/.miniclaw/workspace/
├── SOUL.md # Base personality
└── skills/
├── coding/
│ └── SKILL.md # Coding assistant instructions
└── writing/
└── SKILL.md # Writing style guideSource code
Browse the full source at python-sdk/examples/miniclaw/.