/ai-toolkit:openclaw-setupfrom ai-toolkit
Installs, configures, secures, and troubleshoots OpenClaw (formerly Clawdbot/Moltbot), a self-hosted AI assistant for messaging apps. Covers Docker setup, Anthropic API cost control, Telegram/iMessage channels, and gateway hardening.
Ships in ai-toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
OpenClaw runs a Gateway on the user's own machine or server. The Gateway connects a model provider (here, Anthropic) to messaging channels such as Telegram and iMessage, so the user can talk to an agent that can run tools on that machine. That last part is why setup is mostly about safety: anyone who can message the bot, or reach the Gateway port, can try to make it act. Your job is a working install that only its owner controls and whose spending is capped.
A person is present during setup, so explain choices in plain language and let them decide. Read-only checks (openclaw --version, openclaw doctor, openclaw status, ss -tlnp) can run freely. Before each of the following, say in one line what will change and get a yes:
curl … | bash), sudo, or package installs;~/.openclaw/openclaw.json (back it up first: cp openclaw.json openclaw.json.bak);Secrets stay out of the chat. API keys, bot tokens and the gateway token go straight into the onboarding wizard, an editor, or a .env file with chmod 600, typed by the user. Refer to them as ${ANTHROPIC_API_KEY} and so on. Check that a secret is set by its presence or length, never by printing it, and don't run commands that echo one (such as printenv TOKEN); if the user needs to see a token, they run that command themselves.
openclaw doctor afterwards. Don't walk them back through installation.openclaw doctor, openclaw status --all, openclaw channels status --probe and openclaw logs --follow, then use the troubleshooting table./openclaw-audit, which runs the checklist read-only.openclaw --version with npm view openclaw dist-tags, and update with openclaw update. A version that was safe in January isn't safe now.gateway.bind: "loopback") and use token auth. Reach it remotely through an SSH tunnel or Tailscale Serve, not an open port. With Docker, the container must listen on its network interface, so the protection is publishing ports only on 127.0.0.1 on the host (see references/vps-setup.md); a host firewall like UFW doesn't filter Docker-published ports.dmPolicy: "pairing" (or an allowlist), groups require a mention, and DM sessions stay separate (session.dmScope: "per-channel-peer").references/security-defaults.md): messaging tool profile, exec denied or approval-gated, file tools limited to the workspace, elevated tools off. Then widen deliberately. Instructions written into SOUL.md are guidance to the model, not enforcement; real limits come from tool policy and sandboxing.Spend cap, as above.
Choose where it runs:
| Option | Good for | Reference |
|---|---|---|
| Mac (CLI or the OpenClaw.app menu-bar app, macOS 15+) | Personal use, always-on Mac mini, needed for iMessage | references/mac-local-setup.md |
| Linux VPS with Docker | 24/7 availability, Telegram; requires active hardening | references/vps-setup.md |
| Hostinger managed OpenClaw | Least admin work; Hostinger controls the host | references/vps-setup.md → Hostinger |
Install: curl -fsSL https://openclaw.ai/install.sh | bash (macOS, Linux, WSL2). It installs Node if needed (OpenClaw needs Node 24.16+ or 26.1+) and starts onboarding. Docker installs use the repo's scripts/docker/setup.sh instead.
Onboard: openclaw onboard --install-daemon. Explain each wizard step and recommend the safe choice: Anthropic with an API key (references/anthropic-auth.md), loopback bind, token auth, pairing for DMs, and bundled skills only.
Connect channels: references/telegram-channel.md, references/imessage-channel.md (Mac only).
Apply the hardened baseline and check: openclaw security audit --deep, openclaw doctor, openclaw channels status --probe. On a server, also ss -tlnp to confirm nothing listens on 0.0.0.0 that shouldn't.
Test: send the bot a DM, approve the pairing code (openclaw pairing approve telegram <code>), and confirm it answers.
For scripted installs, openclaw onboard --non-interactive requires --accept-risk; see https://docs.openclaw.ai/start/wizard-cli-automation.
~/.openclaw/openclaw.json is JSON5 and validated strictly: an unknown or misplaced key stops the Gateway from starting. So don't write keys from memory or from older guides. Take them from openclaw config schema, the docs, or the snippets in these references (checked against 2026.9.9), back up first, check with openclaw config validate, and run openclaw doctor after every change (openclaw doctor --fix migrates some older formats). Two keys that moved in 2026: the model is agents.defaults.model.primary (not agent.model), and the heartbeat lives under agents.defaults.heartbeat.
A minimal safe starting point:
{
agents: { defaults: { model: { primary: "anthropic/claude-sonnet-5-5" } } },
gateway: { mode: "local", bind: "loopback", auth: { mode: "token" } }, // keep the token onboarding generated
session: { dmScope: "per-channel-peer" },
channels: {
telegram: { enabled: true, dmPolicy: "pairing", groups: { "*": { requireMention: true } } },
},
}
| Symptom | First thing to try |
|---|---|
| Gateway won't start after a config edit | openclaw doctor; the error names the bad key. Restore the backup or fix the key from openclaw config schema |
node too old | The installer provisions a supported Node; otherwise install Node 24 LTS or 26 |
| Gateway reachable from the internet | Native: set gateway.bind: "loopback". Docker: publish ports as 127.0.0.1:PORT:PORT; see vps-setup.md |
| Telegram bot silent | openclaw channels status --probe; check the token, then pairing (openclaw pairing list telegram) |
| Pairing code rejected | Codes expire after an hour and at most 3 can be pending; send a new DM for a fresh code |
| iMessage not working | imsg chats --limit 1 in the Gateway's context, then the permission checklist in imessage-channel.md |
| Costs higher than expected | Control UI → Usage, or openclaw gateway usage-cost; see anthropic-auth.md for heartbeat and model choices |
| Audit warnings | Read them with the user, then openclaw security audit --fix for the auto-fixable ones (with their OK) |
| File | Covers |
|---|---|
references/mac-local-setup.md | Mac install, keep-awake, LaunchAgent, remote access |
references/vps-setup.md | Linux VPS with Docker (any provider), safe SSH order, port publishing, Hostinger notes |
references/anthropic-auth.md | API key vs Claude subscription login, model choice, heartbeat and cost control |
references/telegram-channel.md | BotFather, pairing, groups, privacy mode |
references/imessage-channel.md | @openclaw/imessage + imsg, macOS permissions |
references/security-defaults.md | Hardened baseline, tool limits, skills and plugins, incident response |
These notes were checked against OpenClaw 2026.9.9 (October 2026). OpenClaw changes monthly; when a command or key here disagrees with the installed version, trust openclaw --help, openclaw config schema and docs.openclaw.ai.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub aznatkoiny/zai-skills --plugin ai-toolkit6 skills in this plugin
/cpp-reinforcement-learningReinforcement learning in C++ with LibTorch (the PyTorch C++ frontend) and C++20. Use when the user is implementing DQN, PPO or SAC in C++, building a replay buffer or rollout buffer in C++, fixing libtorch memory growth or GPU issues in a C++ agent, running environments in parallel threads, or loading a policy trained in Python into a C++ program (games, robotics, simulators). Not for Python RL with Gymnasium or Stable-Baselines3, including exporting a Python policy to ONNX (use reinforcement-learning), or for general deep learning (use deep-learning)./deep-learningBuild and train neural networks with Keras 3 on any backend (JAX, TensorFlow or PyTorch). Use when the user is writing Keras code or asks for a Keras model, wants to migrate tf.keras / Keras 2 code to Keras 3, or is working on image classification, segmentation, text classification, sequence-to-sequence, time-series forecasting, or generative models (VAE, GAN) in Keras, including custom training loops, callbacks, transfer learning, mixed precision and multi-GPU training. Not for plain PyTorch or JAX training loops without Keras, Hugging Face / LLM fine-tuning, or reinforcement learning (use reinforcement-learning)./prompt-engineerWrite, review, debug, and migrate prompts for Claude models (Fable 5.1, Opus 5.5, Sonnet 5.5, Haiku 5.5) using Anthropic's official prompt engineering guidance. Covers system prompts, agent and harness prompts, tool descriptions, few-shot examples, and effort/thinking settings. Use this whenever the user wants to create or improve a prompt or system prompt. Also use it when they ask why Claude is behaving a certain way: too verbose or too terse, stops early or asks permission mid-task, over-engineers, goes silent between tool calls, skips searches or tool calls, refuses benign requests, ignores mid-turn messages, or returns broken JSON. It also covers migrating prompts or API calls to a newer Claude model, choosing an effort level or thinking configuration, and writing instructions that another LLM agent will follow, even when the user never says "prompt engineering"./reinforcement-learningReinforcement learning in Python with Gymnasium and Stable-Baselines3 (PPO, SAC, DQN, TD3, A2C). Use when the user is building a custom Gymnasium environment, choosing an algorithm, training or tuning an agent, debugging an agent that won't learn (flat reward, collapse, NaNs), evaluating a policy, or exporting one to ONNX. Includes runnable scripts that validate an environment, sanity-check it before training, and write an evaluation report. Not for RL in C++/libtorch (use cpp-reinforcement-learning), RLHF or LLM post-training (GRPO, DPO), or supervised deep learning (use deep-learning)./x402-paymentsBuild apps that charge for, or pay for, HTTP requests with the x402 protocol (HTTP 402 "Payment Required" plus stablecoin payments, usually USDC on Base or Solana). Covers paid API endpoints and middleware (Express, Hono, Next.js), clients and AI agents that pay for x402 resources with spending limits, MCP tools that charge or pay through x402, and moving from testnet to mainnet. Use when the user mentions x402, HTTP 402, per-request USDC payments, paywalled APIs for agents, or agent-to-agent payments. Not for card or Stripe billing, Coinbase Commerce checkout, smart-contract development, or general wallet and trading code. For a new project, /x402-scaffold generates a working testnet starter.Other plugins' skills for the same job