Easy install, 24/7. Ultra-lightweight secure AI assistant inspired by OpenClaw.
OpenClaw: 430,000 lines, complex setup, security concerns
nanoClaw: ~3,000 lines, secure by default, 2-min setup
- Secure by default - file system sandbox, shell command filtering, prompt injection defense
- Model-agnostic - Claude, GPT-5, DeepSeek, Gemini via OpenRouter or direct API
- Ultra-lightweight - ~3000 lines total, minimal dependencies
- 2-minute setup - interactive wizard guides configuration
- No open ports - Telegram polling, dashboard on localhost only
- Persistent memory - remembers facts about you across conversations
- Background tasks - spawn long-running research jobs
- Scheduled jobs - cron-like recurring tasks
- Web dashboard - monitor activity, manage settings
git clone https://github.com/ysz/nanoClaw
cd nanoclaw
pip install -e .Run the interactive wizard:
nanoclaw initThe wizard will:
- Configure your LLM provider (OpenRouter recommended)
- Set up Telegram bot connection
- Optionally enable web search (Brave API)
- Run security checks
Start the agent:
nanoclaw serveThen message your bot on Telegram!
# Interactive chat
nanoclaw chat
# One-shot message
nanoclaw chat -m "What's the weather in Tokyo?"# Check status
nanoclaw status
# Run security audit
nanoclaw doctor
# Manage scheduled tasks
nanoclaw cron list
nanoclaw cron add --name "Morning news" --message "Summarize tech news" --every 86400
nanoclaw cron remove 1You (Telegram) --> [nanoClaw Server] --> LLM API
|
+-------------------+-------------------+
| | | |
Agent Memory Tools Security
Loop (SQLite) (sandboxed) (6 layers)
|
Dashboard (localhost:18790)
- FileGuard - restricts file access to workspace only
- ShellSandbox - blocks dangerous commands, confirms destructive ones
- PromptGuard - detects and sanitizes prompt injection attempts
- SessionBudget - rate limiting and cost controls
- AuditLog - logs all agent actions
- SecurityDoctor - validates installation security
Config is stored at ~/.nanoclaw/config.json:
{
"providers": {
"openrouter": {
"apiKey": "sk-or-..."
}
},
"agents": {
"defaults": {
"model": "anthropic/claude-sonnet-4-5"
}
},
"channels": {
"telegram": {
"enabled": true,
"token": "BOT_TOKEN",
"allowFrom": ["YOUR_USER_ID"]
}
},
"tools": {
"webSearch": {
"apiKey": "BRAVE_API_KEY"
}
},
"dashboard": {
"enabled": true,
"port": 18790
}
}web_search- search the internet (Brave API)web_fetch- fetch and read web pagesshell_exec- execute shell commands (sandboxed)file_read/write/list- file operations in workspacememory_save/search- persistent memoryspawn_task- background tasks
get_weather- weather lookupgithub_repo_info- GitHub repository infoget_news- news searchsummarize_url- URL summarizationget_time- time in different cities
Add Python files to ~/.nanoclaw/skills/:
from nanoclaw.tools.registry import tool
@tool(
name="my_skill",
description="Does something useful",
parameters={"arg": {"type": "string", "description": "Argument"}}
)
async def my_skill(arg: str) -> str:
return f"Result: {arg}"Skills are auto-loaded on startup.
docker run -d \
--name nanoclaw \
--restart unless-stopped \
-v ~/.nanoclaw/config.json:/app/config/config.json:ro \
-v ~/.nanoclaw/workspace:/app/workspace \
-v ~/.nanoclaw/data:/app/data \
-p 127.0.0.1:18790:18790 \
nanoclaw/nanoclaw:latest# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Type check
mypy nanoclaw/
# Lint
ruff check nanoclaw/| Provider | Models | Get API Key |
|---|---|---|
| OpenRouter | All major models | openrouter.ai/keys |
| DeepSeek | deepseek-chat, deepseek-reasoner | platform.deepseek.com |
| Anthropic | Claude Sonnet/Opus/Haiku | console.anthropic.com |
| OpenAI | GPT-5 family | platform.openai.com |
| Local | Ollama, LM Studio | - |
- Python 3.11+
- Telegram Bot Token (from @BotFather)
- LLM API key (any provider above)
- Optional: Brave Search API key
MIT