Thanks to visit codestin.com
Credit goes to Github.com

Skip to content
/ tinyclaw Public

TinyClaw is a team of personal agents that collaborate with each other

Notifications You must be signed in to change notification settings

jlia0/tinyclaw

Repository files navigation

TinyClaw 🦞

Multi-agent, Multi-team, Multi-channel, 24/7 AI assistant

Run multiple teams of AI agents that collaborate with each other simultaneously with isolated workspaces.

✨ Features

  • βœ… Multi-agent - Run multiple isolated AI agents with specialized roles
  • βœ… Multi-team collaboration - Agents hand off work to teammates via chain execution and fan-out
  • βœ… Multi-channel - Discord, WhatsApp, and Telegram
  • βœ… Team Observation - You can observe agent teams conversations via tinyclaw team visualize
  • βœ… Multiple AI providers - Anthropic Claude and OpenAI Codex using existing subscriptions without breaking ToS
  • βœ… Parallel processing - Agents process messages concurrently
  • βœ… Live TUI dashboard - Real-time team visualizer for monitoring agent chains
  • βœ… Persistent sessions - Conversation context maintained across restarts
  • βœ… File-based queue - No race conditions, reliable message handling
  • βœ… 24/7 operation - Runs in tmux for always-on availability

πŸš€ Quick Start

Prerequisites

  • macOS or Linux
  • Node.js v14+
  • tmux
  • Bash 4.0+ (macOS: brew install bash)
  • Claude Code CLI (for Anthropic provider)
  • Codex CLI (for OpenAI provider)

Installation

Option 1: One-line Install (Recommended)

curl -fsSL https://raw.githubusercontent.com/jlia0/tinyclaw/main/scripts/remote-install.sh | bash

Option 2: From Release

wget https://github.com/jlia0/tinyclaw/releases/latest/download/tinyclaw-bundle.tar.gz
tar -xzf tinyclaw-bundle.tar.gz
cd tinyclaw && ./scripts/install.sh

Option 3: From Source

git clone https://github.com/jlia0/tinyclaw.git
cd tinyclaw && npm install && ./scripts/install.sh

First Run

tinyclaw start  # Runs interactive setup wizard

The setup wizard will guide you through:

  1. Channel selection - Choose Discord, WhatsApp, and/or Telegram
  2. Bot tokens - Enter tokens for enabled channels
  3. Workspace setup - Name your workspace directory
  4. Default agent - Configure your main AI assistant
  5. AI provider - Select Anthropic (Claude) or OpenAI
  6. Model selection - Choose model (e.g., Sonnet, Opus, GPT-5.3)
  7. Heartbeat interval - Set proactive check-in frequency
πŸ“± Channel Setup Guides

Discord Setup

  1. Go to Discord Developer Portal
  2. Create application β†’ Bot section β†’ Create bot
  3. Copy bot token
  4. Enable "Message Content Intent"
  5. Invite bot using OAuth2 URL Generator

Telegram Setup

  1. Open Telegram β†’ Search @BotFather
  2. Send /newbot β†’ Follow prompts
  3. Copy bot token
  4. Start chat with your bot

WhatsApp Setup

After starting TinyClaw, scan the QR code:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
     WhatsApp QR Code
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[QR CODE HERE]

πŸ“± Settings β†’ Linked Devices β†’ Link a Device

πŸ“‹ Commands

Commands work with tinyclaw (if CLI installed) or ./tinyclaw.sh (direct script).

Core Commands

Command Description Example
start Start TinyClaw daemon tinyclaw start
stop Stop all processes tinyclaw stop
restart Restart TinyClaw tinyclaw restart
status Show current status and activity tinyclaw status
setup Run setup wizard (reconfigure) tinyclaw setup
logs [type] View logs (discord/telegram/whatsapp/queue/heartbeat/all) tinyclaw logs queue
attach Attach to tmux session tinyclaw attach

Agent Commands

Command Description Example
agent list List all configured agents tinyclaw agent list
agent add Add new agent (interactive) tinyclaw agent add
agent show <id> Show agent configuration tinyclaw agent show coder
agent remove <id> Remove an agent tinyclaw agent remove coder
agent reset <id> Reset agent conversation tinyclaw agent reset coder

Team Commands

Command Description Example
team list List all configured teams tinyclaw team list
team add Add new team (interactive) tinyclaw team add
team show <id> Show team configuration tinyclaw team show dev
team remove <id> Remove a team tinyclaw team remove dev
team visualize [id] Live TUI dashboard for team chains tinyclaw team visualize dev

Configuration Commands

Command Description Example
provider [name] Show or switch AI provider tinyclaw provider anthropic
provider <name> --model <model> Switch provider and model tinyclaw provider openai --model gpt-5.3-codex
model [name] Show or switch AI model tinyclaw model opus
reset Reset all conversations tinyclaw reset
channels reset <channel> Reset channel authentication tinyclaw channels reset whatsapp

Pairing Commands

Use sender pairing to control who can message your agents.

Command Description Example
pairing pending Show pending sender approvals (with pairing codes) tinyclaw pairing pending
pairing approved Show approved senders tinyclaw pairing approved
pairing list Show both pending and approved senders tinyclaw pairing list
pairing approve <code> Move a sender from pending to approved by code tinyclaw pairing approve ABCD1234
pairing unpair <channel> <sender_id> Remove an approved sender from the allowlist tinyclaw pairing unpair telegram 1234567

Pairing behavior:

  • First message from unknown sender: TinyClaw generates a code and sends approval instructions.
  • Additional messages while still pending: TinyClaw blocks silently (no repeated pairing message).
  • After approval: messages from that sender are processed normally.

Update Commands

Command Description Example
update Update TinyClaw to latest version tinyclaw update

Note: If you are on v0.0.1 or v0.0.2, the update script was broken. Please re-install instead:

curl -fsSL https://raw.githubusercontent.com/jlia0/tinyclaw/main/scripts/remote-install.sh | bash

Your settings and user data will be preserved.

Update Details

Auto-detection: TinyClaw checks for updates on startup (once per hour).

Manual update:

tinyclaw update

This will:

  1. Check for latest release
  2. Show changelog URL
  3. Download bundle
  4. Create backup of current installation
  5. Install new version

Disable update checks:

export TINYCLAW_SKIP_UPDATE_CHECK=1

Messaging Commands

Command Description Example
send <message> Send message to AI manually tinyclaw send "Hello!"
send <message> Route to specific agent tinyclaw send "@coder fix bug"

In-Chat Commands

These commands work in Discord, Telegram, and WhatsApp:

Command Description Example
@agent_id message Route message to specific agent @coder fix the bug
@team_id message Route message to team leader @dev fix the auth bug
/agent List all available agents /agent
/team List all available teams /team
@agent_id /reset Reset specific agent conversation @coder /reset
/reset Reset conversation (WhatsApp/global) /reset or !reset
message Send to default agent (no prefix) help me with this

Note: The @agent_id routing prefix requires a space after it (e.g., @coder fix not @coderfix).

Access control note: before routing, channel clients apply sender pairing allowlist checks.

πŸ€– Using Agents

Routing Messages

Use @agent_id prefix to route messages to specific agents (see In-Chat Commands table above):

@coder fix the authentication bug
@writer document the API endpoints
@researcher find papers on transformers
help me with this  ← goes to default agent (no prefix needed)

Agent Configuration

Agents are configured in .tinyclaw/settings.json:

{
  "workspace": {
    "path": "/Users/me/tinyclaw-workspace",
    "name": "tinyclaw-workspace"
  },
  "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"
    }
  }
}

Each agent operates in isolation:

  • Separate workspace directory - ~/tinyclaw-workspace/{agent_id}/
  • Own conversation history - Maintained by CLI
  • Custom configuration - .claude/, heartbeat.md (root), AGENTS.md
  • Independent resets - Reset individual agent conversations
πŸ“– Learn more about agents

See docs/AGENTS.md for:

  • Architecture details
  • Agent configuration
  • Use cases and examples
  • Advanced features
  • Troubleshooting

πŸ“ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Message Channels                         β”‚
β”‚         (Discord, Telegram, WhatsApp, Heartbeat)            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚ Write message.json
                     ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   ~/.tinyclaw/queue/                         β”‚
β”‚                                                              β”‚
β”‚  incoming/          processing/         outgoing/           β”‚
β”‚  β”œβ”€ msg1.json  β†’   β”œβ”€ msg1.json   β†’   β”œβ”€ msg1.json        β”‚
β”‚  β”œβ”€ msg2.json       └─ msg2.json       └─ msg2.json        β”‚
β”‚  └─ msg3.json                                                β”‚
β”‚                                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚ Queue Processor
                     ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Parallel Processing by Agent                    β”‚
β”‚                                                              β”‚
β”‚  Agent: coder        Agent: writer       Agent: assistant   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”‚
β”‚  β”‚ Message 1β”‚       β”‚ Message 1β”‚        β”‚ Message 1β”‚       β”‚
β”‚  β”‚ Message 2β”‚ ...   β”‚ Message 2β”‚  ...   β”‚ Message 2β”‚ ...   β”‚
β”‚  β”‚ Message 3β”‚       β”‚          β”‚        β”‚          β”‚       β”‚
β”‚  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜        β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜       β”‚
β”‚       β”‚                  β”‚                     β”‚            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        ↓                  ↓                     ↓
   claude CLI         claude CLI             claude CLI
  (workspace/coder)  (workspace/writer)  (workspace/assistant)

Key features:

  • File-based queue - Atomic operations, no race conditions
  • Parallel agents - Different agents process messages concurrently
  • Sequential per agent - Preserves conversation order within each agent
  • Isolated workspaces - Each agent has its own directory and context
πŸ“– Learn more about the queue system

See docs/QUEUE.md for:

  • Detailed message flow
  • Parallel processing explanation
  • Performance characteristics
  • Debugging tips

πŸ“ Directory Structure

tinyclaw/
β”œβ”€β”€ .tinyclaw/            # TinyClaw data
β”‚   β”œβ”€β”€ settings.json     # Configuration
β”‚   β”œβ”€β”€ queue/            # Message queue
β”‚   β”‚   β”œβ”€β”€ incoming/
β”‚   β”‚   β”œβ”€β”€ processing/
β”‚   β”‚   └── outgoing/
β”‚   β”œβ”€β”€ logs/             # All logs
β”‚   β”œβ”€β”€ channels/         # Channel state
β”‚   β”œβ”€β”€ files/            # Uploaded files
β”‚   β”œβ”€β”€ pairing.json      # Sender allowlist state (pending + approved)
β”‚   β”œβ”€β”€ chats/            # Team chain chat history
β”‚   β”‚   └── {team_id}/    # Per-team chat logs
β”‚   β”œβ”€β”€ events/           # Real-time event files
β”‚   β”œβ”€β”€ .claude/          # Template for agents
β”‚   β”œβ”€β”€ heartbeat.md      # Template for agents
β”‚   └── AGENTS.md         # Template for agents
β”œβ”€β”€ ~/tinyclaw-workspace/ # Agent workspaces
β”‚   β”œβ”€β”€ coder/
β”‚   β”‚   β”œβ”€β”€ .claude/
β”‚   β”‚   β”œβ”€β”€ heartbeat.md
β”‚   β”‚   └── AGENTS.md
β”‚   β”œβ”€β”€ writer/
β”‚   └── assistant/
β”œβ”€β”€ src/                  # TypeScript sources
β”œβ”€β”€ dist/                 # Compiled output
β”œβ”€β”€ lib/                  # Runtime scripts
β”œβ”€β”€ scripts/              # Installation scripts
└── tinyclaw.sh           # Main script

βš™οΈ Configuration

Settings File

Located at .tinyclaw/settings.json:

{
  "channels": {
    "enabled": ["discord", "telegram", "whatsapp"],
    "discord": { "bot_token": "..." },
    "telegram": { "bot_token": "..." },
    "whatsapp": {}
  },
  "workspace": {
    "path": "/Users/me/tinyclaw-workspace",
    "name": "tinyclaw-workspace"
  },
  "agents": {
    "assistant": {
      "name": "Assistant",
      "provider": "anthropic",
      "model": "sonnet",
      "working_directory": "/Users/me/tinyclaw-workspace/assistant"
    }
  },
  "teams": {
    "dev": {
      "name": "Development Team",
      "agents": ["coder", "reviewer"],
      "leader_agent": "coder"
    }
  },
  "monitoring": {
    "heartbeat_interval": 3600
  }
}

Heartbeat Configuration

Edit agent-specific heartbeat prompts:

# Edit heartbeat for specific agent
nano ~/tinyclaw-workspace/coder/heartbeat.md

Default heartbeat prompt:

Check for:

1. Pending tasks
2. Errors
3. Unread messages

Take action if needed.

🎯 Use Cases

Personal AI Assistant

You: "Remind me to call mom"
Claude: "I'll remind you!"
[1 hour later via heartbeat]
Claude: "Don't forget to call mom!"

Multi-Agent Workflow

@coder Review and fix bugs in auth.ts
@writer Document the changes
@reviewer Check the documentation quality

Team Collaboration

@dev fix the auth bug
# β†’ Routes to team leader (@coder)
# β†’ Coder fixes bug, mentions @reviewer in response
# β†’ Reviewer automatically invoked, reviews changes
# β†’ Combined response sent back to user

Teams support sequential chains (single handoff) and parallel fan-out (multiple teammate mentions). See docs/TEAMS.md for details.

Cross-Device Access

  • WhatsApp on phone
  • Discord on desktop
  • Telegram anywhere
  • CLI for automation

All channels share agent conversations!

πŸ“š Documentation

πŸ› Troubleshooting

See docs/TROUBLESHOOTING.md for detailed solutions.

Quick fixes:

# Reset everything (preserves settings)
tinyclaw stop && rm -rf .tinyclaw/queue/* && tinyclaw start

# Reset WhatsApp
tinyclaw channels reset whatsapp

# Check status
tinyclaw status

# View logs
tinyclaw logs all

Common issues:

  • Bash version error β†’ Install bash 4.0+: brew install bash
  • WhatsApp not connecting β†’ Reset auth: tinyclaw channels reset whatsapp
  • Messages stuck β†’ Clear queue: rm -rf .tinyclaw/queue/processing/*
  • Agent not found β†’ Check: tinyclaw agent list

Need help?

πŸ™ Credits

πŸ“„ License

MIT


TinyClaw - Tiny but mighty! 🦞✨

Star History Chart

About

TinyClaw is a team of personal agents that collaborate with each other

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •