nanoclaw README

The project's README from github.com/nanocoai/nanoclaw. As one markdown file: README.md.

NanoClaw

An AI assistant that runs agents securely in their own containers. Lightweight, built to be easily understood and completely customized for your needs.

nanoclaw.dev  •   docs  •   中文  •   日本語  •   한국어  •   Discord  •   repo tokens


NEW! Agents in Slack: one app per agent

Setup provisions each agent its own Slack app: manifest, avatar, and workspace install, no tokens to paste. Spawn teammates from chat: every one gets its own bot identity, container, and memory, with shared rooms and canvases.

Quick Start


Why I Built NanoClaw

OpenClaw is an impressive project, but I wouldn't have been able to sleep if I had given complex software I didn't understand full access to my life. OpenClaw has nearly half a million lines of code, 53 config files, and 70+ dependencies. Its security is at the application level (allowlists, pairing codes) rather than true OS-level isolation. Everything runs in one Node process with shared memory.

NanoClaw provides that same core functionality, but in a codebase small enough to understand: one process and a handful of files. Agents run in their own Linux containers with filesystem isolation, not merely behind permission checks.

Quick Start

git clone https://github.com/nanocoai/nanoclaw.git nanoclaw-v2
cd nanoclaw-v2
bash nanoclaw.sh

nanoclaw.sh walks you from a fresh machine to a named agent you can message. It installs Node, pnpm, and Docker if missing, registers your Anthropic credential with OneCLI, builds the agent container, and pairs your first channel (Slack, Telegram, Discord, WhatsApp, iMessage, or a local CLI). If a step fails, Claude Code is invoked automatically to diagnose and resume from where it broke.

Migrating from NanoClaw v1?

Run from a fresh v2 checkout next to your v1 install:

git clone https://github.com/nanocoai/nanoclaw.git nanoclaw-v2
cd nanoclaw-v2
bash migrate-v2.sh

migrate-v2.sh finds your v1 install (sibling directory, or NANOCLAW_V1_PATH=/path/to/nanoclaw), migrates state into the v2 checkout, then execs into Claude Code to finish the parts that need judgment (owner seeding, shared-memory migration, fork-customisation replay).

Run the script directly, not from inside a Claude session — the deterministic side needs interactive prompts and real shell I/O for Node/pnpm bootstrap, Docker, OneCLI, and the container build.

What it does: merges .env, seeds the v2 DB from registered_groups, copies group folders + session data + scheduled tasks, installs the channel adapters you select, copies channel auth state (including the Baileys keystore for WhatsApp — LID mapping is now resolved per-message by the Baileys v7 adapter, not migrated), builds the agent container.

What it doesn't: flip the system service. Pick "switch to v2" at the prompt, or do it manually after testing — your v1 install is left untouched.

See docs/v1-to-v2-changes.md for what's different and docs/migration-dev.md for development notes.

Philosophy

Small enough to understand. One process, a few source files and no microservices. If you want to understand the full NanoClaw codebase, just ask Claude Code to walk you through it.

Secure by isolation. Agents run in Linux containers and they can only see what's explicitly mounted. Bash access is safe because commands run inside the container, not on your host.

Built for the individual user. NanoClaw isn't a monolithic framework; it's software that fits each user's exact needs. Instead of becoming bloatware, NanoClaw is designed to be bespoke. You make your own fork and have Claude Code modify it to match your needs.

Customization = code changes. No configuration sprawl. Want different behavior? Modify the code. The codebase is small enough that it's safe to make changes.

AI-native, hybrid by design. The install and onboarding flow is an optimized scripted path, fast and deterministic. When a step needs judgment, whether a failed install, a guided decision, or a customization, control hands off to Claude Code seamlessly. Beyond setup there's no monitoring dashboard or debugging UI either: describe the problem in chat and Claude Code handles it.

Skills over features. Trunk ships the registry and infrastructure, not specific channel adapters or alternative agent providers. Channels (Discord, Slack, Telegram, WhatsApp, …) live on a long-lived channels branch; alternative providers (OpenCode, Ollama) live on providers. You run /add-telegram, /add-opencode, etc. and the skill copies exactly the module(s) you need into your fork. No feature you didn't ask for.

Best harness, best model. NanoClaw natively uses Claude Code via Anthropic's official Claude Agent SDK, so you get the latest Claude models and Claude Code's full toolset, including the ability to modify and expand your own NanoClaw fork. Other providers are drop-in options: /add-codex for OpenAI's Codex (ChatGPT subscription or API key), /add-opencode for OpenRouter, Google, DeepSeek and more via OpenCode, and /add-ollama-provider for local open-weight models. Provider is configurable per agent group.

What It Supports

Accounts and what leaves your machine

NanoClaw has no user accounts. The only thing it reports is anonymous setup diagnostics, and NANOCLAW_NO_DIAGNOSTICS=1 turns those off. Your agents, messages, files and keys never leave your machine.

One opt-in exception: you can fetch a prebuilt agent image instead of building it locally. Fetching ours needs a free account, so we see your email address and when you ask for an image — nothing about your agents, and nothing after the image lands. Building locally needs no account and contacts nothing, and is the default. The same account unlocks the perks below.

Perks

The free account also opens the community portal at portal.nanoclaw.dev, a dashboard where you switch on what the account offers. Today that is Echo's hardened agent image and a managed Slack app for your agent, created and installed for you with no tokens to paste. Everything else in NanoClaw works without it.

Setup opens the portal once. You sign in in the browser, approve the terminal you are running setup from, and enable the perk; the wizard notices and continues on its own. Enabling Echo is where you agree to Echo's terms, including whether you want product and security email. Close the page without enabling anything and setup carries on without the perk, then offers it once more later.

What stays on your machine: the sign-in record and install token in ~/.config/nanoclaw/account.json, one device key per machine in ~/.config/nanoclaw/device-key.json, and this checkout's journal in data/community-portal.json (which perks are on, setup progress, the credentials a perk handed you), all mode 0600. The install token never passes through the browser: the browser sees only the one-time sign-in code, and the token reaches this machine from the account service directly. The host keeps one outbound connection to the portal so a perk you change in the browser reaches the running agent; it sends nothing about your agents, messages or files.

Revisit a step with pnpm exec tsx setup/portal.ts --stage echo or --stage slack. To sign a machine out, forget it under Devices in the portal: its token stops working and the host disconnects. Files, recovery commands and troubleshooting: docs/community-portal.md.

Usage

Talk to your assistant with the trigger word (default: @Andy):

@Andy send an overview of the sales pipeline every weekday morning at 9am (has access to my Obsidian vault folder)
@Andy review the git history for the past week each Friday and update the README if there's drift
@Andy every Monday at 8am, compile news on AI developments from Hacker News and TechCrunch and message me a briefing

From a channel you own or administer, you can manage groups and tasks:

@Andy list all scheduled tasks across groups
@Andy pause the Monday briefing task
@Andy join the Family Chat group

Customizing

NanoClaw doesn't use configuration files. To make changes, just tell Claude Code what you want:

Or run /customize for guided changes.

The codebase is small enough that Claude can safely modify it.

Contributing

Don't add features. Add skills.

If you want to add a new channel or agent provider, don't add it to trunk. New channel adapters land on the channels branch; new agent providers land on providers. Users install them in their own fork with /add-<name> skills, which copy the relevant module(s) into the standard paths, wire the registration, and pin dependencies.

This keeps trunk as pure registry and infra, and every fork stays lean — users get the channels and providers they asked for and nothing else.

RFS (Request for Skills)

No channel or provider skills are currently requested — propose one via an issue.

Requirements

Architecture

messaging apps → host process (router) → inbound.db → container (Bun, Claude Agent SDK) → outbound.db → host process (delivery) → messaging apps

A single Node host orchestrates per-session agent containers. When a message arrives, the host routes it via the entity model (user → messaging group → agent group → session), writes it to the session's inbound.db, and wakes the container. The agent-runner inside the container polls inbound.db, runs the agent, and writes responses to outbound.db. The host polls outbound.db and delivers back through the channel adapter.

Two SQLite files per session, each with exactly one writer — no cross-mount contention, no IPC, no stdin piping. Channels and alternative providers self-register at startup; trunk ships the registry and the Chat SDK bridge, while the adapters themselves are skill-installed per fork.

For the full architecture writeup see docs/architecture.md; for the three-level isolation model see docs/isolation-model.md.

Key files:

FAQ

Why Docker?

Docker provides cross-platform support (macOS, Linux and Windows via WSL2) and a mature ecosystem.

Can I run this on Linux or Windows?

Yes. Docker is the default runtime and works on macOS, Linux, and Windows (via WSL2). Just run bash nanoclaw.sh.

Is this secure?

Agents run in containers, not behind application-level permission checks. They can only access explicitly mounted directories. Credentials never enter the container — outbound API requests route through OneCLI's Agent Vault, which injects authentication at the proxy level and supports rate limits and access policies. You should still review what you're running, but the codebase is small enough that you actually can. See the security documentation for the full security model.

Why no configuration files?

We don't want configuration sprawl. Every user should customize NanoClaw so that the code does exactly what they want, rather than configuring a generic system. If you prefer having config files, you can tell Claude to add them.

Can I use third-party or open-source models?

Yes. The supported path is /add-opencode (OpenRouter, OpenAI, Google, DeepSeek, and more via OpenCode config) or /add-ollama-provider (local open-weight models via Ollama). Both are configurable per agent group, so different agents can run on different backends in the same install.

For one-off experiments, any Claude API-compatible endpoint also works via .env:

ANTHROPIC_BASE_URL=https://your-api-endpoint.com
ANTHROPIC_AUTH_TOKEN=your-token-here

How do I debug issues?

Ask Claude Code. "Why isn't the scheduler running?" "What's in the recent logs?" "Why did this message not get a response?" That's the AI-native approach that underlies NanoClaw.

Why isn't the setup working for me?

If a step fails, nanoclaw.sh hands off to Claude Code to diagnose and resume. If that doesn't resolve it, run claude, then /debug. If Claude identifies an issue likely to affect other users, open a PR against the relevant setup step or skill.

How do I uninstall NanoClaw?

bash nanoclaw.sh --uninstall

Every install is tagged with a per-checkout id, so the uninstaller removes only what belongs to that copy: the background service, containers and image, app data and logs, your agents' files, and this copy's OneCLI vault agents. Shared things — the OneCLI app and your credentials, other NanoClaw copies on the machine — are left alone. It shows exactly what it found and asks for confirmation per group; nothing is deleted until you say yes. Use --dry-run to preview without changing anything, or --yes to skip the prompts. Your .env is backed up before removal. To finish, delete the checkout folder itself.

What changes will be accepted into the codebase?

Only security fixes, bug fixes, and clear improvements will be accepted to the base configuration. That's all.

Everything else (new capabilities, OS compatibility, hardware support, enhancements) should be contributed as skills: channel and provider code on the channels/providers registry branches, everything else as a self-contained skill. See docs/customizing.md and CONTRIBUTING.md.

This keeps the base system minimal and lets every user customize their installation without inheriting features they don't want.

Community

Questions? Ideas? Join the Discord.

Changelog

See CHANGELOG.md for breaking changes, or the full release history on the documentation site.

License

MIT

nanoclaw (nanocoai/nanoclaw)

Searching Database…

这是什么?一个可以自己搭建的 AI 助手:它在各自独立的 Docker 容器里运行由 Claude 驱动的智能体,并把它们接入各种聊天软件——WhatsApp、Telegram、Slack、Discord 等等。每个智能体都有自己的记忆、工作区和定时任务,你只要发消息给它就行。
为什么要做一个更轻量的 OpenClaw,而不是直接用 OpenClaw?OpenClaw 大约有 50 万行代码、53 个配置文件和 70 多个依赖项,而且只有应用层面的安全防护。NanoClaw 用一个小到能看得懂的代码库(只有一个进程、屈指可数的几个文件)实现了同样的核心功能,并且给每个智能体一个隔离的 Linux 容器。
怎么把它跑起来?运行 nanoclaw.sh——它会安装缺少的 Node、pnpm 和 Docker,把你的 Anthropic 凭证注册到 OneCLI,构建智能体容器,并配对你的第一个渠道(Slack、Telegram、Discord、WhatsApp、iMessage 或本地命令行)。如果某一步失败,Claude Code 会接手诊断并继续完成。
开始之前需要装好哪些东西?需要 Node.js 22+、pnpm 10+ 和 Docker,外加一个 Anthropic 凭证——不过如果没装 Node 和 pnpm,安装脚本会自动补上。Claude Code 也是必需的:它驱动 /customize、/debug、安装出错时的自动恢复,以及所有 /add- 开头的技能。
有没有管理智能体的面板或界面?没有。除了安装环节之外,没有监控面板,也没有调试界面——出了问题,你直接在聊天里描述,交给 Claude Code 处理。没有任何设置页面可以兜底。
它在 Windows 上能用吗,还是只支持 Mac 和 Linux?macOS 和 Linux 原生支持;Windows 也能用,但只能在 WSL2 里运行。选 Docker 作为默认运行环境,正是为了这种跨平台覆盖。
我说的话和我的密钥会不会离开我的电脑?默认什么都不外发:没有用户账号,你的智能体、消息、文件和密钥都不会离开这台电脑。只有匿名的安装诊断信息会上报,而且通过一个环境变量就能关掉。唯一可选的一项——拉取预构建的智能体镜像——也只会分享你的邮箱。
智能体可以接入哪些聊天软件?一共 13 个:WhatsApp、Telegram、Discord、Slack、Microsoft Teams、iMessage、Matrix、Google Chat、Webex、Linear、GitHub、微信,以及通过 Resend 接入的电子邮件。每个渠道都通过一个 /add- 技能按需安装;你可以同时启用多个,给每个渠道配不同的智能体,也可以把多个渠道合并到同一个共享会话里。
没有配置文件的话,我该怎么自定义它?直接在聊天里让 Claude Code 改就行,比如说"把触发词改成 @Bob"或者"回复短一点",也可以运行 /customize 按引导修改。这个代码库小到 Claude 可以放心地直接改代码,所以自定义就是改代码,而不是堆一堆配置。
可以用 Claude 以外的模型吗?Claude 是通过 Anthropic 官方的 Claude Agent SDK 提供的默认方案,但其他模型提供商都是即插即用的技能:/add-codex 接入 OpenAI 的 Codex,/add-opencode 接入 OpenRouter、Google 和 DeepSeek,/add-ollama-provider 接入本地开源权重模型。模型提供商按智能体分组来设置。
智能体自己能看到自己的 API 密钥吗?看不到。智能体从不直接持有 API 密钥——对外的请求都经过 OneCLI 的 Agent Vault,由它在请求时注入凭证,并执行按智能体划分的权限策略和速率限制。再加上容器挂载的控制,一个智能体只能看到你明确给它的东西。
Creator
nanocoai
Size
34.3 MB
Stars
31K
Age
8mo
Commits · 90 Days