freshcrate
Home > AI Agents > RustClaw

RustClaw

Lean Rust AI agent: 6MB binary, 7.9MB RAM. OpenClaw replacement. Telegram + Discord + GitHub auto-PR. Ollama/Anthropic support.

Description

Lean Rust AI agent: 6MB binary, 7.9MB RAM. OpenClaw replacement. Telegram + Discord + GitHub auto-PR. Ollama/Anthropic support.

README

RustClaw

AI Agent Framework โ€” in Rust

A lean replacement for OpenClaw.
Single binary. 22 tools. Three-tier memory. Telegram + Discord + MCP.

License: MIT Rust Built with Claude Code

7.5 MB binary ยท 14 MB RAM ยท 5,918 lines ยท 97% tool accuracy ยท 0% hallucination

Quick Start ยท Features ยท Benchmark ยท Architecture ยท Roadmap

๐ŸŒ ็น้ซ”ไธญๆ–‡ ยท ็ฎ€ไฝ“ไธญๆ–‡ ยท ๆ—ฅๆœฌ่ชž ยท ํ•œ๊ตญ์–ด ยท Espaรฑol ยท Portuguรชs


Why RustClaw?

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.

RustClawOpenClaw
๐Ÿ“ฆ Binary7.5 MB staticrequires Node.js 24 + npm
๐Ÿ’พ Idle RAM14 MB1 GB+
โšก Startup< 100 ms5โ€“10 s
๐Ÿ“ Code5,918 lines~430,000 lines
๐Ÿง  MemoryThree-tier (vector + graph + history)Basic session
๐Ÿ”ง Tools22 built-in + MCPPlugin system
๐Ÿค– LLMAnthropic, OpenAI, Ollama, GeminiOpenAI
๐Ÿ“ฑ ChannelsTelegram, Discord, WebSocketWeb 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.


๐Ÿ’ก Key Advantages

๐Ÿชถ 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 โ€” 97% tool accuracy on 500-question benchmark. 0% hallucination rate. 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 โ€” 500-question professional benchmark covering daily ops, coding, system administration, and adversarial prompts. v3โ†’v5 improvement: 81% โ†’ 97%. Zero timeouts.

โš™๏ธ 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.


๐Ÿš€ Quick Start

Prerequisites

Requirement Install
Rust 1.85+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
LLM backend Ollama, OpenAI, Anthropic, or Gemini

Build & Run

git clone https://github.com/Adaimade/RustClaw.git && cd RustClaw
cargo build --release
# โ†’ target/release/rustclaw (7.5 MB)

Configure

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.0 by default for cloud deploy. Never put API keys in code โ€” use ~/.rustclaw/config.toml (gitignored) or environment variables (RUSTCLAW__AGENT__API_KEY).

Run

# 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 123

โœจ Features

๐Ÿ”ง Tool Calling (Agentic Loop)

22 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

๐Ÿง  Three-Tier Memory

Powered by R-Mem architecture.

โ”œโ”€ ๐Ÿ“ Short-term โ”€โ”€ conversation history (SQLite)
โ”œโ”€ ๐Ÿ“ฆ Long-term โ”€โ”€โ”€ LLM fact extraction โ†’ dedup โ†’ ADD/UPDATE/DELETE/NONE
โ”‚    โ””โ”€โ”€ Integer ID mapping ยท contradiction detection ยท semantic dedup
โ””โ”€ ๐Ÿ•ธ๏ธ Graph โ”€โ”€โ”€โ”€โ”€โ”€โ”€ entity + relation extraction with soft-delete

Mixed-mode recall โ€” three scopes merged:

Scope Example Shared across
Local telegram:-100xxx Single group
User user:12345 All channels for one person
Global global:system Everyone

๐Ÿ“ฑ Channels

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 Client

[mcp]
servers = [
  { name = "fs", command = "npx @modelcontextprotocol/server-filesystem /tmp" },
]

๐Ÿ™ GitHub ยท โฐ Cron ยท ๐Ÿ“ง Email

Auto-scan repos ยท auto-PR from issues ยท system monitoring alerts ยท email classification โ€” all scheduled via cron, notifications to Discord.


๐Ÿ“Š Benchmark

500-question tool calling benchmark, qwen2.5:32b (local Ollama):

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%

๐Ÿ—๏ธ Architecture

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/             MemoryManager + SQLite store + graph + embedding + extraction
โ””โ”€โ”€ cron/                Scheduled jobs (system, email, GitHub)

30 files ยท 5,918 lines ยท 7.5 MB binary ยท Zero external services


๐Ÿ—บ๏ธ Roadmap

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
๐Ÿ”ฒ Web UI dashboard
๐Ÿ”ฒ Slack / LINE channels
๐Ÿ”ฒ RAG (document search)
๐Ÿ”ฒ Multi-agent routing
๐Ÿ”ฒ WASM plugin system
๐Ÿ”ฒ Prometheus metrics

Community contributions welcome โ€” open an issue or PR.


MIT License ยท v0.4.0

Created by Ad Huang with Claude Code

The framework is there. The rest is up to the community.

Release History

VersionChangesUrgencyDate
v0.5.0**Full Changelog**: https://github.com/Adaimade/RustClaw/compare/v0.3.0...v0.5.0High4/12/2026
v0.1.0## RustClaw v0.1.0 First public release. **Stats** - Binary: 6MB - Idle RSS: 7.9MB - Startup: < 100ms - Lines of code: 4,312 **Features** - Gateway WebSocket (OpenClaw-compatible protocol) - Telegram + Discord channels - Tool calling agentic loop (read/write files, exec, search) - GitHub auto-PR - Ollama + Anthropic support - Zeabur one-click deploy Built entirely with Claude Code.High4/7/2026

Dependencies & License Audit

Loading dependencies...

Similar Packages

openclaw-model-bridgeConnect any LLM to OpenClaw โ€” production-tested middleware for Qwen3-235B and beyondmain@2026-04-21
moltisA secure persistent personal agent server in Rust. One binary, sandboxed execution, multi-provider LLMs, voice, memory, Telegram, WhatsApp, Discord, Teams, and MCP tools. Secure by design, runs on you20260420.02
edgecrabEdgeCrab ๐Ÿฆ€ A Super Powerful Personal Assistant inspired by NousHermes and OpenClaw โ€” Rust-native, blazing-fast terminal UI, ReAct tool loop, multi-provider LLM support, ACP protocol, gateway adaptersv0.7.0
axonixA self-evolving AI agent that gets more useful every daymain@2026-04-13
Agent-World-ProtocolThe open world for autonomous AI agents on Solana Trade. Build. Fight. Earn. Explore. Connect your AI agent to a persistent shared world. Trade real SOL, build structures, form guilds, fight for terrimain@2026-04-10