Skip to content

Repository files navigation

TinyClaw

Tiny footprint. Maximum capability. 100% Rust.
Ultra-efficient AI assistant with streaming TUI, parallel tools, and tiered builds.

License: MITStars

~3.5MB binary · <10ms startup · 2,235 tests · 22+ providers · streaming TUI · parallel tools

What is TinyClaw?

TinyClaw is a high-performance AI assistant built in Rust, forked from ZeroClaw with significant new capabilities:

FeatureZeroClawTinyClaw
InterfaceCLI onlyCLI + ratatui TUI with markdown rendering
StreamingNoneReal-time SSE token streaming
Token TrackingStubbedLive cost tracking across all providers
Tool ExecutionSequentialParallel via tokio::spawn
SessionsLost on exitAuto-saved to disk, resumable
TUI CommandsNone/help, /cost, /clear, /model, /sessions, /export
Build TiersMonolithic3-tier feature flags (tiny/standard/full)

Quick Start

git clone https://github.com/suislanchez/tinyclaw.git
cd tinyclaw
cargo build --release
# Setup
tinyclaw onboard --api-key sk-... --provider openrouter
# Launch TUI (recommended)
tinyclaw tui
# Or single message
tinyclaw agent -m "Hello!"# Interactive CLI
tinyclaw agent

Build Tiers

Choose the right build for your hardware:

# Tiny (~3.5MB) — CLI agent only, minimal deps
cargo build --release --no-default-features --features tiny
# Standard (~3.7MB) — adds TUI with ratatui
cargo build --release --no-default-features --features standard
# Full (~4.6MB) — everything: gateway, daemon, channels, OTel, skillforge
cargo build --release # default
TierSizeIncludes
tiny~3.5MBCLI agent, providers, tools, memory, security
standard~3.7MB+ ratatui TUI with streaming & markdown
full~4.6MB+ gateway, daemon, channels, OTel, skillforge, tunnel

TUI Features

The TUI provides a rich terminal interface:

  • Real-time streaming — tokens appear as they're generated via SSE
  • Markdown rendering — bold, italic, code blocks, headings, lists
  • Live cost tracking — token count, request count, estimated USD in status bar
  • Session persistence — conversations auto-save and can be resumed
  • Slash commands:
CommandDescription
/helpShow available commands
/costDetailed token usage breakdown
/clearClear history (keeps system prompt)
/modelShow current model
/sessionsList saved sessions
/sessionShow current session ID
/exportExport conversation as markdown
/quitExit

Architecture

Every subsystem is a trait — swap implementations with a config change.

SubsystemTraitShips with
AI ModelsProvider22+ providers (OpenRouter, Anthropic, OpenAI, Ollama, Groq, Mistral, xAI, DeepSeek, etc.)
ChannelsChannelCLI, Telegram, Discord, Slack, iMessage, Matrix, WhatsApp, Email
MemoryMemorySQLite (hybrid FTS5 + vector search), Markdown
ToolsToolshell, file_read, file_write, memory (store/recall/forget), browser, composio
ObservabilityObserverNoop, Log, OpenTelemetry
RuntimeRuntimeAdapterNative (Mac/Linux/Pi)
SecuritySecurityPolicyPairing, sandbox, allowlists, rate limits, encrypted secrets

Token Tracking

All providers (OpenRouter, OpenAI, Anthropic, Compatible) report token usage to a shared UsageTracker with atomic counters. The TUI status bar shows live metrics:

[1,247 tokens, 3 reqs, ~$0.0142]

Parallel Tool Execution

When the LLM requests multiple tools in one response, TinyClaw executes them concurrently via tokio::spawn instead of sequentially. Results are collected in order.

Streaming

OpenRouter supports real-time SSE streaming. The Provider trait includes chat_with_history_stream with a default fallback to non-streaming. The ReliableProvider wrapper tries streaming providers first and falls back automatically.

Configuration

Config: ~/.tinyclaw/config.toml (created by onboard)

api_key = "sk-..."default_provider = "openrouter"default_model = "anthropic/claude-sonnet-4-20250514"default_temperature = 0.7
[memory]
backend = "sqlite"auto_save = true
[autonomy]
level = "supervised"workspace_only = trueallowed_commands = ["git", "npm", "cargo", "ls", "cat", "grep"]
[runtime]
kind = "native"
[browser]
enabled = falseallowed_domains = ["docs.rs"]

Supported Providers

OpenRouter, Anthropic, OpenAI, Ollama, Gemini, Venice, Groq, Mistral, xAI/Grok, DeepSeek, Together AI, Fireworks AI, Perplexity, Cohere, GitHub Copilot, Moonshot, MiniMax, Bedrock, Cloudflare AI, Vercel AI, and any OpenAI-compatible endpoint via custom:https://your-api.com.

Commands

CommandDescription
tinyclaw tuiLaunch TUI interface
tinyclaw agent -m "..."Single message mode
tinyclaw agentInteractive CLI mode
tinyclaw onboardSetup wizard
tinyclaw statusSystem status + build tier
tinyclaw gatewayStart webhook server
tinyclaw daemonAutonomous runtime
tinyclaw doctorSystem diagnostics

Development

cargo build # Dev build
cargo build --release # Release build
cargo test# 2,235 tests
cargo clippy # Lint
cargo fmt # Format

License

MIT — see LICENSE

Credits

Forked from ZeroClaw by @theonlyhennygod.


TinyClaw — Tiny footprint. Maximum capability. Deploy anywhere.

About

Ultra-efficient AI assistant — forked from ZeroClaw with TUI, streaming, parallel tools, and tiered builds

Resources

Contributing

Security policy

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages