Overview
NanoClaw Pro runs as a macOS launchd service (com.nanoclaw) that starts automatically on login and restarts if it crashes. The service manages the main Node.js process, which handles channel connections, message polling, and spawning containerized agents.
Prerequisites
Node.js 20 or later
Claude Code CLI authenticated
Container runtime (Apple Container or Docker) installed and running
Build tools (Xcode Command Line Tools)
Installation
Clone and set up the project
Build the agent container image
nanoclaw-agent:latest image with Node.js 20, Claude Code CLI, Chromium (for browser automation), and the agent-runner code.Configure authentication
Create a Extract from Only authentication variables are extracted and mounted into containers. Other
.env file in the project root with one of these options:Option 1: Claude Subscription (OAuth)~/.claude/.credentials.json if logged into Claude Code.Option 2: Pay-per-use API Key.env variables stay on the host for security.Service Management
Check Service Status
Start/Stop/Restart
Uninstall
Log Files
| File | Contents |
|---|---|
logs/nanoclaw.log | Main process stdout (message polling, channel connections, agent spawns) |
logs/nanoclaw.error.log | Main process stderr (errors, warnings) |
groups/{name}/logs/container-*.log | Per-agent execution logs (one per container invocation) |
container-20260307-143022.log
Service Configuration
The launchd plist includes these key settings:Changing the Assistant Name
Edit the plist’sEnvironmentVariables section:
@YourName to trigger the assistant.
Container Runtime
NanoClaw Pro auto-detects and starts your container runtime on launch. It supports:- Docker (default):
CONTAINER_RUNTIME_BIN=dockerinsrc/container-runtime.ts - Apple Container: Switch with
/convert-to-apple-containerskill
- Checks if runtime is running (
docker info) - Kills orphaned
nanoclaw-*containers from previous runs - Spawns fresh containers for each agent invocation
Apple Container Networking
If using Apple Container, configure networking for internet access:Docker handles networking automatically. Apple Container requires manual NAT setup.
Startup Sequence
When the service starts, NanoClaw:- Ensures container runtime is running (auto-starts if needed)
- Cleans up orphaned containers from crashed runs
- Initializes SQLite database (
store/messages.db) - Loads state: registered groups, sessions, router state
- Connects channels (loops through registry, instantiates those with credentials)
- Starts scheduler loop (checks for due tasks every 60s)
- Starts IPC watcher (monitors
data/ipc/for container messages) - Recovers unprocessed messages from before shutdown
- Starts message polling loop (checks SQLite every 2s)
Environment Variables
Set in the plist’sEnvironmentVariables dict:
| Variable | Default | Purpose |
|---|---|---|
ASSISTANT_NAME | Andy | Trigger word for messages |
CONTAINER_IMAGE | nanoclaw-agent:latest | Agent container image name |
CONTAINER_TIMEOUT | 1800000 (30 min) | Max container runtime (ms) |
IDLE_TIMEOUT | 1800000 (30 min) | Keep container alive after last result |
MAX_CONCURRENT_CONTAINERS | 5 | Max parallel agent containers |
PATH | Standard paths | Include ~/.local/bin for Claude Code CLI |
Security
The service runs as your user (not root) and all agents execute in containers:- Filesystem isolation: Agents only access mounted directories
- Safe Bash: Commands run in container, not on host
- Credential isolation: Per-group
.claude/sessions - Mount shadowing: Main group’s project root mount shadows
.envwith/dev/nullto prevent secret access
Next Steps
Linux Deployment
Deploy with systemd on Linux servers
Troubleshooting
Common issues and solutions