Your Local OS Automation Engine. Powered by Native Rust, Controlled via Telegram.
An ultra-lightweight, blazing-fast, and fully autonomous AI agent written in Rust. It interacts natively via Telegram, parses LLM outputs, executes shell scripts autonomously within your local system sandbox, and responds back. It is essentially the OpenClaw concept, heavily optimized for a pure deterministic, offline-capable desktop environment with zero enterprise web bloat.
Built by Anas Nafees
- Secure Telegram Polling: Long-polling allows for secure integration directly with Telegram without public webhooks.
- LLM Independence: Powered by Google's Gemini API (configurable models in
.env) with automatic 503 retry fallbacks. - Autonomous Execution: Interprets
<bash>blocks from the LLM, executes them natively on Windows (via.bat) or macOS/Linux. - Telegram UI Guardrails: Destructive
<bash_safe>commands are intercepted, pausing the Agent loop to render a native Telegram Inline Keyboard (Yes ✅,No ❌) asking you for explicit approval. - Background Cron Watchers: The LLM can spawn detached Tokio async tasks using
<cron>tags to silently run scripts in the background and only alert you if the conditions change! - Persistent Memory: Zero-overhead context preservation! Saves conversation history to a local
babyclaw_memory.jsonon disk, surviving terminal crashes effortlessly. - Agent Lock: Spam-proof concurrency handles rapid Telegram texts seamlessly; only one "brain" operates per Chat ID, quietly queuing up fast follow-up messages.
- Dynamic Skill Loader: Scans the local
skills/directory for.mdfiles to automatically compile prompt context for thousands of tools.
BabyClaw can automatically clone itself, install the Rust compiler if missing, interactively prompt you for your API keys, and launch!
Windows (PowerShell):
irm https://raw.githubusercontent.com/AnasNafees1802/BabyClaw/main/install.ps1 | iexLinux / macOS (Bash):
curl -fsSL https://raw.githubusercontent.com/AnasNafees1802/BabyClaw/main/install.sh | bashManual Installation (Developers)
-
Clone the repository:
git clone https://github.com/AnasNafees1802/BabyClaw.git cd BabyClaw -
Configure your environment: Rename
.env.exampleto.envand fill in your keys:TELEGRAM_BOT_TOKEN="YOUR_TELEGRAM_TOKEN" GEMINI_API_KEY="YOUR_GEMINI_API_KEY" GEMINI_MODEL="gemini-1.5-flash-8b"
-
Run the Agent:
cargo run --release
Once installed, BabyClaw operates as a persistent listener on your machine. Here is how you use it:
Step 1: Start the Engine Open any terminal (Command Prompt, PowerShell, or Bash) anywhere on your computer and simply type:
BabyClawYou can now close the terminal window, minimize it, or let it run in the background. BabyClaw is now alive and listening!
Step 2: Message Your Bot
Open the Telegram app on your phone or desktop, find the Bot you created (using the TELEGRAM_BOT_TOKEN), and send it a message!
"Hey, what are my top 5 most memory-intensive processes right now?" "Can you create a folder on my Desktop called 'ProjectX'?" "Ping google.com 4 times and give me the average latency."
Step 3: Approve or Deny Actions If BabyClaw needs to execute a "destructive" command (like deleting a file, making a directory, or modifying your system), it will explicitly pause and ask for your permission directly in the Telegram chat using interactive buttons!
- Tap
Yes ✅to authorize the command natively on your PC. - Tap
No ❌to instantly abort the operation.
BabyClaw will stream the raw terminal output from your computer straight back into the chat as a beautifully summarized human response.
BabyClaw actively injects the host OS into its system prompt so the LLM writes correct platform-specific scripts:
- Windows: Generates heavily-escaped temporary
.batfiles for execution to preventcmd.exequotation parsing bugs. - Linux/macOS: Generates temporary
.shscripts to safely execute complex multi-line bash commands.
BabyClaw clones the core architecture of OpenClaw, which makes it incredibly smart without requiring hard-coded API integrations.
Instead of building complex plugins for every service (GitHub, Spotify, Weather), BabyClaw uses Skills.
If you look inside the skills/ directory, you will find dozens of .md (Markdown) files. These files are beautifully written instructions in plain English that teach the LLM how to use specific command-line interfaces (CLIs) that already exist in the world.
How it works seamlessly:
- On boot, BabyClaw scans the
skills/folder and reads every single markdown file, combining them into one massive System Prompt (~8,000+ bytes). - The LLM now intrinsically knows how to interact with services on your computer.
- Example: If you ask BabyClaw to "Check my open GitHub PRs", it recalls the
skills/github/SKILL.mdinstructions, writes a temporary.batscript executinggh pr list, runs it natively in your Windows sandbox, parses the raw terminal stdout, and sends you a beautifully formatted Telegram message summarizing your PRs.
To make BabyClaw even smarter, you just need to install the underlying CLI tools on your host machine (e.g., install the GitHub CLI gh, or the weather CLI, etc.).
Because BabyClaw was rewritten entirely from scratch in Rust (utilizing the Tokio async runtime), it bypasses the heavy enterprise infrastructure of traditional AI agents.
- Typical AI Agents (Node.js/Python): 100MB to 250MB+ RAM when idle, requiring V8 engines, Python runtimes, Redis caching, or Docker containers.
- BabyClaw (Rust): A compiled, native binary that idles at ~10MB to 25MB of RAM.
It is practically a ghost on your system. It consumes ~0% CPU while long-polling for Telegram messages and spins up zero-cost threads only when you message it. It is the ultimate invisible, ultra-lightweight desktop automation assistant.
MIT License. See LICENSE for details.
