🐾 TinyClaw Guide
The complete documentation for TinyClaw — an open-source, lightweight multi-agent collaboration framework. Run a personal team of AI agents 24/7 across Discord, Telegram, and WhatsApp.
What is TinyClaw?
TinyClaw is an open-source lightweight multi-agent collaboration framework by TinyAGI, designed specifically for resource-constrained environments. It enables multiple professional AI agents — such as @coder, @writer, @reviewer — to run simultaneously, collaborate via chained or fan-out execution, and communicate over Discord, Telegram, and WhatsApp.
Unlike heavyweight AI platforms, TinyClaw runs on a Raspberry Pi, an old laptop, or a cheap VPS. Its key innovation is a file-based SQLite queue system that prevents race conditions and enables seamless multi-channel message handling.
Features
Multi-Agent System
Run multiple isolated agents simultaneously, each with its own workspace, conversation history, and config.
Team Collaboration
Agents hand off tasks sequentially (chains) or distribute tasks in parallel (fan-out). Visualize live with the TUI.
Multi-Channel
Discord, WhatsApp, Telegram — all share agent conversations. Switch devices, keep context.
SQLite Queue
Atomic transactions, retry logic, dead-letter management. No message lost during crashes.
Parallel Processing
Agents process messages concurrently. Fan-out patterns dispatch to multiple agents at once.
Live TUI Dashboard
Real-time team visualizer for monitoring agent chains and activity in your terminal.
Persistent Sessions
Conversation context maintained across restarts. Your agents remember previous work.
Plugin System
Extend TinyClaw with custom plugins for message hooks and event listeners.
Multi-Provider AI
Anthropic Claude (Sonnet, Opus) and OpenAI GPT — mix providers per agent.
24/7 Operation
Runs in tmux for always-on availability. Proactive heartbeat with configurable intervals.
TinyOffice Web
Next.js browser portal: dashboard, chat, task Kanban, agent config, logs.
Sender Pairing
Access control: gate inbound messages behind a sender approval flow. Secure by default.
Requirements
| Dependency | Version | Notes |
|---|---|---|
macOS or Linux | Any recent | Windows not supported natively |
Node.js | v14+ | Required for TinyClaw runtime |
tmux | Any | For persistent background sessions |
Bash | 4.0+ | macOS: brew install bash |
jq | Any | JSON parsing utility |
| Claude Code CLI | Latest | Required for Anthropic provider |
| OpenAI Codex CLI | Latest | Required for OpenAI provider |
| AI API Key | — | Anthropic and/or OpenAI key |
macOS ships with Bash 3.x. Run brew install bash before installing TinyClaw.
⚡ Quickstart
Get TinyClaw running in under 5 minutes with the one-line installer:
curl -fsSL https://raw.githubusercontent.com/TinyAGI/tinyclaw/main/scripts/remote-install.sh | bash
Then start TinyClaw and follow the setup wizard:
tinyclaw start
The interactive wizard walks you through channels, AI provider, model, and heartbeat interval setup automatically.
📦 Installation
TinyClaw supports three installation methods:
# One-line remote installer (recommended)
curl -fsSL https://raw.githubusercontent.com/TinyAGI/tinyclaw/main/scripts/remote-install.sh | bash
Automatically downloads and installs TinyClaw with all dependencies. Settings and user data are preserved on updates.
# Download pre-built bundle
wget https://github.com/TinyAGI/tinyclaw/releases/latest/download/tinyclaw-bundle.tar.gz
tar -xzf tinyclaw-bundle.tar.gz
cd tinyclaw && ./scripts/install.sh
Download a pre-compiled bundle from GitHub Releases. Good for offline or air-gapped setups.
# Clone and build from source
git clone https://github.com/TinyAGI/tinyclaw.git
cd tinyclaw && npm install && ./scripts/install.sh
For contributors or those who want to modify TinyClaw. Requires Node.js and npm.
PATH Configuration
The installer automatically adds ~/.local/bin to PATH in your shell profile. If the tinyclaw command isn't found, add it manually:
export PATH="$HOME/.local/bin:$PATH"
source ~/.bashrc # or ~/.zshrc
🧙 Setup Wizard
Running tinyclaw start for the first time (or tinyclaw setup anytime) launches the interactive setup wizard:
Select Messaging Channels
Choose one or more: Discord, WhatsApp, Telegram. You can enable multiple channels simultaneously.
Name Your Workspace
Set the directory path for your TinyClaw workspace. Agents operate within this directory.
Configure Default Agent
Set a name and role for your primary agent. This agent handles messages that have no @prefix.
Choose AI Provider
Select Anthropic (Claude) or OpenAI (GPT). You can mix providers across different agents later.
Select Model
Anthropic: sonnet or opus. OpenAI: gpt-4o, gpt-5.3-codex, etc.
Set Heartbeat Interval
How often (in seconds) agents proactively check for pending tasks, errors, and unread messages. Default: 3600s (1 hour).
Re-run the wizard at any time:
tinyclaw setup
⚙️ Configuration
TinyClaw is configured via settings.json in the TinyClaw root directory. Here is a complete example:
{
"workspace": {
"path": "/Users/me/tinyclaw-workspace",
"name": "tinyclaw-workspace"
},
"channels": {
"enabled": ["discord", "telegram", "whatsapp"],
"discord": { "bot_token": "..." },
"telegram": { "bot_token": "..." },
"whatsapp": {}
},
"agents": {
"coder": {
"name": "Code Assistant",
"provider": "anthropic",
"model": "sonnet",
"working_directory": "/Users/me/tinyclaw-workspace/coder"
},
"writer": {
"name": "Technical Writer",
"provider": "openai",
"model": "gpt-5.3-codex",
"working_directory": "/Users/me/tinyclaw-workspace/writer"
}
},
"teams": {
"dev": {
"name": "Development Team",
"agents": ["coder", "reviewer"],
"leader_agent": "coder"
}
},
"monitoring": {
"heartbeat_interval": 3600
}
}
🤖 Agents
Agents are the core building blocks of TinyClaw. Each agent is an isolated AI persona with its own workspace, conversation history, and configuration.
Adding Agents
# Add a new agent via CLI
tinyclaw agent add \
--name coder \
--provider anthropic \
--model opus \
--role "Primary development agent — writes, tests, and ships code"
# Add a reviewer agent
tinyclaw agent add \
--name reviewer \
--provider anthropic \
--model sonnet \
--role "Review code for bugs, security issues, and performance"
# Add a writer agent (different provider)
tinyclaw agent add \
--name writer \
--provider openai \
--model gpt-5.3-codex \
--role "Technical Writer — document the API and write user guides"
Listing & Managing Agents
tinyclaw agent list # List all agents
tinyclaw agent info coder # Show agent details
tinyclaw agent remove coder # Remove an agent
Agent Isolation
Each agent operates in a separate working directory with its own:
- Conversation history (no cross-agent context bleed)
- File workspace (
/workspace/agent_name/) - AI provider and model configuration
- Skills directory (
.agent/skills/) - Claude project context (
.claude/CLAUDE.md)
Agent Skills
Agents have a .agent/skills/ folder where you can add custom skills — Markdown files describing capabilities and behaviors. TinyClaw includes built-in skills:
| Skill | Description |
|---|---|
browser-automation | Control a browser to scrape, fill forms, and automate web tasks |
skill-creator | Create new skills for other agents dynamically |
tinyclaw-admin | Self-administer TinyClaw: manage agents, teams, settings via REST API |
cron-scheduler | Create, list, and delete recurring cron tasks that send messages to the queue |
Switching Provider & Model
# Switch provider for an agent
tinyclaw provider anthropic --model sonnet
tinyclaw provider openai --model gpt-4o
tinyclaw provider openai --model gpt-5.3-codex
# Or switch separately
tinyclaw provider anthropic # Switch provider only
tinyclaw model opus # Switch model only
tinyclaw model gpt-5.2 # Switch to OpenAI model
Resetting Agent Conversations
# Reset specific agent(s) conversation history
tinyclaw reset coder
tinyclaw reset coder writer reviewer
# In-chat: reset current agent's conversation
/reset coder
👥 Teams
Teams let agents collaborate automatically. When a task is sent to a team, the leader coordinates the work — routing sub-tasks to specialists and aggregating results.
Collaboration Patterns
Sequential Chain
Agent A completes a task, then hands off the result to Agent B. Single handoff for ordered workflows.
Parallel Fan-Out
Leader dispatches subtasks to multiple agents simultaneously. Results are aggregated and returned.
Creating a Team
# Create a dev team with a leader
tinyclaw team add \
--name dev \
--agents coder,reviewer,builder \
--leader coder
# List teams
tinyclaw team list
# Visualize team activity (live TUI)
tinyclaw team visualize dev
Example: Developer Team Workflow
# In your chat channel:
@dev fix the authentication bug
# TinyClaw automatically:
# → Routes to team leader (@coder)
# → @coder fixes bug, mentions @reviewer in response
# → @reviewer automatically invoked, reviews changes
# → Combined response sent back to you
Team Configuration
{
"teams": {
"dev": {
"name": "Development Team",
"agents": ["coder", "reviewer", "builder"],
"leader_agent": "coder"
},
"content": {
"name": "Content Team",
"agents": ["writer", "editor", "seo"],
"leader_agent": "writer"
}
}
}
For detailed team execution patterns, chain configuration, and advanced visualizer usage, see docs/TEAMS.md in the TinyClaw repository.
📨 Message Routing
TinyClaw uses @agent_id prefix syntax to route messages. An important note: the prefix requires a space after the agent ID.
Use @coder fix — not @coderfix. The space is required for the routing prefix to work correctly.
# Route to specific agent
@coder fix the authentication bug
@writer document the API endpoints
@reviewer check the documentation quality
@researcher find papers on transformers
# Route to team
@dev build the new payment feature
# No prefix → goes to default agent
help me with this task
Access Control Note
Before routing, channel clients apply sender pairing allowlist checks. Ensure senders are approved via the pairing system before expecting message routing to work.
🗄️ Queue System
TinyClaw's key innovation is its file-based SQLite queue system. It prevents race conditions and enables seamless multi-channel support with reliable delivery guarantees.
Architecture
Queue Features
- Atomic transactions — No partial writes or race conditions
- SQLite WAL mode — Write-ahead logging for concurrent access
- Retry logic — Failed messages are retried automatically
- Dead-letter queue — Messages that exceed retry limits are moved to DLQ for inspection
- Orphan recovery — On startup, orphan files in the queue are recovered
- Duplicate prevention — 1-second timer avoids re-queuing already-processing files
- Watchdog timer — Restarts polling after 2 minutes of inactivity
- Fatal error recovery — Auto-restart polling on EFATAL / 409 errors
For detailed message flow diagrams and queue configuration options, see docs/QUEUE.md in the repository.
💓 Heartbeat
The heartbeat system enables proactive agent behavior. At configurable intervals, agents automatically check for:
- Pending tasks in the queue
- Errors requiring attention
- Unread messages across channels
- Scheduled reminders
# Example: Agent set up to remind you
# You say: "Remind me to call mom"
# Agent: "I'll remind you!"
# [1 hour later via heartbeat]
# Agent: "Don't forget to call mom!"
# Set heartbeat in settings.json
{
"monitoring": {
"heartbeat_interval": 3600 // seconds
}
}
Customize heartbeat behavior by editing SOUL.md in your workspace — this file controls what each agent monitors and prioritizes during heartbeat intervals.
📡 Channels
TinyClaw supports three messaging channels. All channels share the same agent conversation context — switch between devices while keeping full context.
Discord
Bot-based channel with rich formatting and server support.
Mobile-first via QR code linking. Great for on-the-go access.
Telegram
Fast, secure messaging via BotFather. Excellent for automation.
CLI
Direct terminal access for scripting and automation workflows.
💬 Discord Setup
Create Discord Application
Go to discord.com/developers/applications and create a new application.
Add a Bot
Go to Bot section → Add Bot → Copy the bot token. Enable Message Content Intent in Privileged Gateway Intents.
Generate OAuth2 Invite URL
OAuth2 → URL Generator → Select bot scope and required permissions → Copy the invite URL → Add bot to your server.
Configure TinyClaw
{
"channels": {
"enabled": ["discord"],
"discord": { "bot_token": "YOUR_BOT_TOKEN_HERE" }
}
}
Reset Discord authentication:
tinyclaw channels reset discord # Shows Discord reset instructions
✈️ Telegram Setup
Open BotFather
Open Telegram and search for @BotFather. Send /newbot and follow the prompts.
Get Your Bot Token
BotFather will give you a token like 123456789:ABCdef.... Copy this token.
Configure TinyClaw
{
"channels": {
"enabled": ["telegram"],
"telegram": { "bot_token": "YOUR_TELEGRAM_BOT_TOKEN" }
}
}
Reset Telegram authentication:
tinyclaw channels reset telegram # Shows Telegram reset instructions
📱 WhatsApp Setup
Start TinyClaw
Run tinyclaw start. TinyClaw will display a QR code in the terminal.
Scan the QR Code
Open WhatsApp on your phone → Settings → Linked Devices → Link a Device → Scan the QR code shown in your terminal.
Start Messaging
Your WhatsApp is now linked. Send messages directly from your phone to your TinyClaw agents.
Reset WhatsApp session:
tinyclaw channels reset whatsapp # Clear WhatsApp session
⌨️ CLI Channel
The CLI channel lets you interact directly from your terminal, perfect for scripting and automation:
# Send a message to default agent
tinyclaw send "What's the weather?"
# Send to specific agent
tinyclaw send "@coder review the latest changes"
# Attach to live tmux session (interactive)
tmux attach -t tinyclaw
# or
tinyclaw attach
🖥 TinyOffice Web Portal
TinyOffice is a Next.js web portal bundled with TinyClaw. It provides a browser UI for monitoring and operating your agent system without terminal access.
Features
Dashboard
Real-time queue/system overview and live event feed.
Chat Console
Send messages to default agent, @agent, or @team from the browser.
Agents & Teams
Create, edit, and remove agents and teams via a friendly UI.
Tasks (Kanban)
Create tasks, drag across stages, assign to agent or team.
Logs & Events
Inspect queue logs and streaming events in real time.
Settings
Edit TinyClaw configuration (settings.json) via UI without touching files.
Setup & Launch
# 1. Start TinyClaw first (provides the API at :3777)
tinyclaw start
# 2. Navigate to TinyOffice directory
cd tinyoffice
# 3. Install dependencies
npm install
# 4. Set backend URL (default: http://localhost:3777)
export NEXT_PUBLIC_API_URL=http://localhost:3777
# 5. Start development server
npm run dev
# 6. Open in browser
open http://localhost:3000
TinyOffice is UI-only. It does not replace TinyClaw daemon processes. Always start TinyClaw first so the queue processor, channels, and API are available.
🔌 Plugin System
TinyClaw's plugin system allows you to extend functionality with custom message hooks and event listeners. Plugins live in the plugins/ directory.
Plugin Types
| Type | Description | Trigger |
|---|---|---|
| Message Hook | Intercept and transform messages before they reach agents | onMessage |
| Event Listener | React to system events: agent start, completion, errors | onEvent |
Example Plugin
// plugins/my-logger/index.js
module.exports = {
name: 'my-logger',
version: '1.0.0',
// Called for every incoming message
onMessage: async (message, context) => {
console.log(`[Plugin] Message from ${message.channel}: ${message.text}`);
return message; // pass through (or modify)
},
// Called on system events
onEvent: async (event) => {
if (event.type === 'agent.complete') {
console.log(`Agent ${event.agentId} finished task`);
}
}
};
🎯 Skills System
Skills are Markdown files that define what an agent knows how to do. When an agent is set up, it gets a .agent/skills/ folder, a symlinked skills directory, and a .claude/CLAUDE.md context file.
Directory Structure
workspace/
└── coder/
├── .agent/
│ └── skills/
│ ├── browser-automation.md
│ ├── skill-creator.md
│ └── tinyclaw-admin.md
└── .claude/
└── CLAUDE.md # Agent context & instructions
Creating Custom Skills
Add a Markdown file to .agent/skills/ describing the capability:
# .agent/skills/database-expert.md
# Database Expert Skill
You are an expert in SQL, PostgreSQL, Redis, and MongoDB.
## When to use this skill
- When asked about database queries, optimization, or design
- When debugging slow queries or schema issues
## Key capabilities
- Write optimized SQL queries
- Design normalized schemas
- Troubleshoot performance issues
🔒 Sender Pairing
Sender Pairing is a security feature that gates inbound messages behind a sender approval flow. It prevents unauthorized users from interacting with your agents.
How It Works
First Message
An unknown sender's first message triggers TinyClaw to generate a pairing code and send approval instructions back.
Pending State
Additional messages from that sender while pending are silently blocked. No repeated pairing message is sent.
Approve the Sender
The operator approves via tinyclaw pairing approve <code>. After approval, the sender's messages are processed normally.
Pairing Commands
tinyclaw pairing pending # List pending pairing requests
tinyclaw pairing approve <code> # Approve a sender by code
tinyclaw pairing list # List all approved senders
tinyclaw pairing unpair <id> # Remove a sender's approval
🐳 Docker Infrastructure
For production containerized deployment with API authentication, health checks, and process isolation, use tinyclaw-infra. No changes to TinyClaw source are required.
Architecture
Quick Setup
# Clone both repos
git clone https://github.com/TinyAGI/tinyclaw.git
git clone https://github.com/shwdsun/tinyclaw-infra.git
# Configure environment
cd tinyclaw-infra
cp .env.example .env
# Edit .env: set API_KEY, provider keys, bot tokens
# Start all services
docker compose up -d
# Prometheus metrics available at :9090
Worker Configuration
# docker-compose.override.yml
worker-coder:
build:
context: .
dockerfile: docker/Dockerfile.worker
environment:
- GATEWAY_URL=http://gateway:8080
- API_KEY=${API_KEY}
- AGENT_ID=coder
- PROVIDER=anthropic
- MODEL=sonnet
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
volumes:
- code-workspace:/workspace
networks:
- workers
Two networks enforce permission boundaries: core for TinyClaw internals, workers for isolated agent execution. Workers can only reach the gateway. The zero-dependency gateway uses only Node.js built-ins — no npm packages, no supply chain to audit.
⌨️ CLI Commands Reference
Use tinyclaw if installed as CLI, otherwise use ./tinyclaw.sh.
Core Commands
Agent Commands
Team Commands
Provider & Model
Channel Commands
Updates & Misc
💬 In-Chat Commands
These commands work directly in your messaging channel (Discord, Telegram, WhatsApp):
| Command | Description |
|---|---|
@agent_id message | Route message to specific agent |
@team_id message | Route message to a team |
/reset <agent_id> | Reset a specific agent's conversation |
/restart | Restart TinyClaw from within chat |
help me with this | No prefix → goes to default agent |
📄 Settings Reference
| Field | Type | Description |
|---|---|---|
workspace.path | string | Absolute path to workspace directory |
workspace.name | string | Display name for the workspace |
channels.enabled | array | List of active channels: discord, telegram, whatsapp |
channels.discord.bot_token | string | Discord bot token |
channels.telegram.bot_token | string | Telegram BotFather token |
agents.{id}.name | string | Display name for the agent |
agents.{id}.provider | string | AI provider: anthropic or openai |
agents.{id}.model | string | Model name: sonnet, opus, gpt-4o, etc. |
agents.{id}.working_directory | string | Agent's working directory path |
teams.{id}.agents | array | Agent IDs that belong to this team |
teams.{id}.leader_agent | string | Agent ID who leads the team |
monitoring.heartbeat_interval | number | Proactive check interval in seconds (default: 3600) |
💡 Use Cases
Personal AI Assistant
Deploy on Raspberry Pi or an old PC. Get reminders, schedule management, and task automation via WhatsApp or Telegram 24/7.
Developer Team Collab
Set up @coder to implement features, @reviewer to check quality, @writer to document — all collaborating automatically via team mode.
Cross-Device Access
Message from phone via WhatsApp on commute, switch to Discord on desktop at work, use Telegram on tablet at home. Same context, always.
Research Assistance
@researcher finds academic papers, @summarizer condenses long documents into key points. Route alongside each other for full pipeline.
Edge Device Deployment
Run lightweight AI on resource-limited embedded devices. Local intelligence with minimal computational overhead.
Smart Home Hub
Low-cost smart home control center. Send voice commands via WhatsApp, agents coordinate IoT devices and provide feedback.
Cloud Dev Agent
Deploy on a $6/mo DigitalOcean droplet. A hardened, Tailscale-secured coding agent that ships code while you sleep.
Content Pipeline
@writer creates drafts, @editor refines quality, @seo optimizes for search. Full content production pipeline automated.
🔧 Troubleshooting
tinyclaw command not found
# Add to PATH manually
export PATH="$HOME/.local/bin:$PATH"
source ~/.bashrc # or ~/.zshrc for zsh
# Or use the script directly
./tinyclaw.sh start
Bash version error (macOS)
brew install bash
# Then add /usr/local/bin/bash to /etc/shells
Broken update on v0.0.1 or v0.0.2
# Re-install instead of updating (settings preserved)
curl -fsSL https://raw.githubusercontent.com/TinyAGI/tinyclaw/main/scripts/remote-install.sh | bash
Queue processor deadlock
Fixed in v0.0.3+. Update TinyClaw. The fix prevents duplicate file queueing from the 1-second timer re-reading incoming files already in a promise chain, and adds orphan file recovery on startup.
Checking Logs
tinyclaw logs all # All logs
tmux attach -t tinyclaw # Live session
systemctl --user status tinyclaw.service # Systemd status
WhatsApp QR not appearing
Run tinyclaw channels reset whatsapp to clear the session, then restart TinyClaw. A fresh QR code will be displayed.
Message your agent daily. If a full day passes with no response, SSH in and run tinyclaw logs all. Git history and backup scripts ensure you can always roll back to a known-good state.