A lean replacement for OpenClaw.
Single binary. 22 tools. Three-tier memory. Telegram + Discord + MCP.
7.5 MB binary ยท 14 MB RAM ยท 5,296 lines ยท 98.9% BFCL ยท 95.5% T-Eval ยท 4.3ร faster with MoE
Quick Start ยท Features ยท Benchmark ยท Architecture ยท Roadmap
๐ ็น้ซไธญๆ ยท ็ฎไฝไธญๆ ยท ํ๊ตญ์ด
The idea started with a simple observation: someone rewrote OpenClaw in Go and cut memory usage from 1GB+ down to 35MB. That was impressive. But we asked โ could we go further?
Most people don't need 430,000 lines of TypeScript. They need an agent that talks to Telegram, reads their files, runs their code, and opens a GitHub PR when something breaks. That's it.
RustClaw is the 80/20 version of OpenClaw โ the features that matter, in a single cargo build.
| RustClaw | OpenClaw | |
| ๐ฆ Binary | 7.5 MB static | requires Node.js 24 + npm |
| ๐พ Idle RAM | 14 MB | 1 GB+ |
| โก Startup | < 100 ms | 5โ10 s |
| ๐ Code | 5,296 lines | ~430,000 lines |
| ๐ง Memory | Three-tier (vector + graph + history) | Basic session |
| ๐ง Tools | 22 built-in + MCP | Plugin system |
| ๐ค LLM | Anthropic, OpenAI, Ollama, Gemini | OpenAI |
| ๐ฑ Channels | Telegram, Discord, WebSocket | Web UI |
Note
RustClaw is not trying to replace OpenClaw. It's proof that the core of what makes an AI agent useful doesn't require a gigabyte of RAM. It requires good architecture, the right language, and the willingness to start over with clearer constraints.
Built entirely with Claude Code by Ad Huang. Zero human-written code.
๐ชถ Runs anywhere โ 7.5 MB binary, 14 MB RAM. Raspberry Pi, $5 VPS, or your laptop. No Node.js, no Python, no Docker required.
๐ง Remembers everything โ Three-tier memory (vector + graph + history) with mixed-mode scoping. Tell the bot your name in Telegram, it remembers in Discord. Facts auto-extracted, contradictions auto-resolved.
๐ก๏ธ Safe by design โ 14 dangerous command patterns blocked. Tool output truncated. Patch files verified before modification. Error retry with auto-recovery. 120s timeout with graceful fallback.
๐ง Actually does things โ 98.9% on the industry-standard BFCL benchmark (1,000 questions). The bot reads your files, runs your commands, creates PRs โ it doesn't just describe what it would do.
๐ MCP-ready โ Connect any MCP server. Tools auto-discovered and routed transparently. Your LLM sees one unified tool list โ local and remote, no difference.
๐ Benchmarked and proven โ 1,000-question BFCL + 2,146-question T-Eval + 500-question internal benchmark. Dual-model strategy: MoE for speed (2.6s/q), dense for accuracy (99.7%).
โ๏ธ Claude Code inspired โ Understand-first tool ordering, history compression, workspace context loading, error retry hints. The same patterns that make Claude Code effective, applied to an open-source agent.
macOS / Linux:
curl -sSL https://raw.githubusercontent.com/Adaimade/RustClaw/main/install.sh | shWindows (PowerShell):
irm https://raw.githubusercontent.com/Adaimade/RustClaw/main/install.ps1 | iexThis downloads the pre-built binary, adds it to PATH, and creates a default config. Works on macOS (Intel/Apple Silicon), Linux (x86/ARM), and Windows.
| Requirement | Install |
|---|---|
| Rust 1.85+ | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh |
| LLM backend | Ollama, OpenAI, Anthropic, or Gemini |
git clone https://github.com/Adaimade/RustClaw.git && cd RustClaw
cargo build --release && strip target/release/rustclaw
# โ target/release/rustclaw (7.5 MB)mkdir -p ~/.rustclaw
cp config.example.toml ~/.rustclaw/config.toml| Ollama (local) | Anthropic | Gemini |
[agent]
provider = "openai"
api_key = "ollama"
base_url = "http://127.0.0.1:11434"
model = "qwen2.5:32b" |
[agent]
provider = "anthropic"
api_key = "sk-ant-..."
model = "claude-sonnet-4-20250514" |
[agent]
provider = "openai"
api_key = "your-key"
base_url = "https://generativelanguage.googleapis.com/v1beta/openai"
model = "gemini-2.5-flash" |
Security: RustClaw binds to
0.0.0.0by default for cloud deploy. Never put API keys in code โ use~/.rustclaw/config.toml(gitignored) or environment variables (RUSTCLAW__AGENT__API_KEY).
# Start everything (gateway + channels + cron + memory)
rustclaw gateway
# One-shot agent call with tool access
rustclaw agent "List all .rs files and count total lines of code"
# GitHub operations
rustclaw github scan
rustclaw github fix 12322 built-in tools with autonomous execution. Supports Anthropic and OpenAI function calling. Max 10 iterations per request.
Layered tool loading โ understand first, then act, then check:
๐๏ธ Understand โก Act ๐ Check
โโโ read_file โโโ run_command โโโ process_check
โโโ list_dir โโโ write_file โโโ docker_status
โโโ search_code โโโ patch_file โโโ system_stats
โโโ http_ping
๐ฌ Discord (on-demand) ๐ง Email (on-demand) โโโ pm2_status
โโโ create/delete channel โโโ fetch_inbox โโโ process_list
โโโ create_role/set_topic โโโ read_email
โโโ kick/ban_member โโโ send_email
Safety: 14 dangerous patterns blocked ยท output truncated to 4000c ยท patch verification ยท error retry hints ยท 120s graceful timeout
Memory is delegated to R-Mem โ a separate Rust crate that handles vector recall, fact extraction, contradiction resolution, and entity-relation graphs. RustClaw is a thin wrapper that adds mixed-mode scoping on top.
Mixed-mode recall โ three scopes merged on every query:
| Scope | Example | Shared across |
|---|---|---|
| Local | telegram:-100xxx |
Single group |
| User | user:12345 |
All channels for one person |
| Global | global:system |
Everyone |
| Channel | Features |
|---|---|
| Telegram | Long polling ยท streaming edit ยท ACL ยท session history |
| Discord | @mention ยท server management ยท scan / fix issue #N / pr status |
| Gateway | OpenClaw-compatible WebSocket on :18789/ws |
[mcp]
servers = [
{ name = "fs", command = "npx @modelcontextprotocol/server-filesystem /tmp" },
]Auto-scan repos ยท auto-PR from issues ยท system monitoring alerts ยท email classification โ all scheduled via cron, notifications to Discord.
Tested on the official Gorilla BFCL benchmark โ the industry standard for evaluating function calling. Dual-model comparison on Mac Mini 2024 (M4 Pro, 64 GB):
| Test | qwen3-coder:30b (MoE) | qwen2.5:32b (dense) | Speed diff |
|---|---|---|---|
| simple_python (400) | 100% ยท 1.5s/q | 99.75% ยท 7.3s/q | 4.9ร |
| multiple (200) | 97% ยท 2.4s/q | 99.5% ยท 8.4s/q | 3.5ร |
| parallel (200) | 99.5% ยท 2.9s/q | 100% ยท 12.0s/q | 4.1ร |
| parallel_multiple (200) | 98% ยท 3.4s/q | 100% ยท 15.7s/q | 4.6ร |
| Overall (1,000) | 98.9% ยท 2.6s/q | 99.7% ยท 10.8s/q | 4.3ร |
MoE model trades -0.8% accuracy for 4.3ร speed. Both models exceed 98% across all categories.
Tested on T-Eval โ Shanghai AI Lab's tool-use evaluation suite covering planning, retrieval, review, and instruction following:
| Test | Score | Questions | Speed |
|---|---|---|---|
| T-Eval retrieve | 98% (542/553) | 553 | 14.5s/q |
| T-Eval plan | 96% (535/553) | 553 | 25.6s/q |
| T-Eval review | 96% (472/487) | 487 | 3.5s/q |
| T-Eval instruct | 92% (514/553) | 553 | 8.2s/q |
2,146 questions across four core categories. Average 95.5% โ strong tool selection, multi-step planning, and self-review.
500-question tool calling benchmark (qwen2.5:32b, local Ollama). Not yet re-tested on qwen3-coder:30b:
| Version | Total | Timeout | Speed |
|---|---|---|---|
| v3 baseline | 81% | 74 | 44s/q |
| v4 timeout fix | 85% | 3 | 36s/q |
| v5 optimized | 97% | 0 | 38s/q |
| Category | v5 Score |
|---|---|
| Core operations | 92% |
| Basic tools | 95% |
| Medium tasks | 100% |
| Advanced reasoning | 98% |
| Hallucination traps | 100% |
| Multi-step chains | 99% |
Benchmark questions available at AI-Bench.
src/
โโโ main.rs CLI dispatch + startup
โโโ cli/mod.rs clap subcommands
โโโ config.rs TOML + env config
โโโ gateway/ WebSocket server + protocol + handshake
โโโ agent/runner.rs LLM streaming + agentic loop + history compression
โโโ channels/ Telegram (teloxide) + Discord (serenity)
โโโ tools/ 22 tools: fs, shell, search, discord, email, system, github, mcp
โโโ session/ SessionStore (history) + MemoryManager (R-Mem wrapper)
โโโ cron/ Scheduled jobs (system, email, GitHub)
27 files ยท 5,296 lines ยท 7.5 MB binary ยท Zero external services
| Status | Feature |
|---|---|
| โ | Tool calling (22 tools + agentic loop) |
| โ | Three-tier memory (vector + graph + mixed scope) |
| โ | Telegram + Discord channels |
| โ | MCP client (transparent tool routing) |
| โ | GitHub integration (scan + auto-PR) |
| โ | System monitoring + cron alerts |
| โ | Email (IMAP + SMTP) |
| โ | SQLite persistence |
| โ | Cross-platform install (macOS / Linux / Windows) |
| โ | Multi-model routing (per-channel model override via config) |
| ๐ฒ | Slack / LINE channels |
| ๐ฒ | Prometheus metrics |
Community contributions welcome โ open an issue or PR.
MIT License ยท v0.5.0
Created by Ad Huang with Claude Code
The framework is there. The rest is up to the community.
