OpenClaw Cheat Sheet
Everything you need on one page. Bookmark this.
1. Architecture at a Glance
You ──▶ Channel ──▶ Gateway ──▶ Agent ──▶ Skill
│ │
▼ ▼
Memory External APIs
| Component | One-Line Description |
|---|---|
| Gateway | The central brain — routes messages, calls AI models, coordinates everything. Runs at ws://127.0.0.1:18789. |
| Channels | Communication bridges — iMessage, Slack, WhatsApp, Telegram, Discord, Signal, Teams, WebChat. |
| Agents | AI model instances that handle tasks. Simple questions use one agent; complex tasks spawn sub-agents. |
| Skills | Extensions from ClawHub that add capabilities — calendar, email, web search, smart home, and more. |
| Memory | Persistent knowledge store — remembers facts, preferences, and conversation history across sessions. |
| Plugins | Low-level infrastructure — filesystem access, HTTP requests, database queries. Skills are built on top of these. |
| Nodes | Device connectors — link iOS, Android, and macOS devices for device-specific features. |
| Pi Runtime | Execution sandbox where agents run with access to configured tools and skills. |
| Sessions | Conversation contexts — short (single Q&A) or long-running (multi-day projects). |
| Lobster | Visual workflow builder — chain actions into automations, similar to Zapier but with AI reasoning at each step. |
2. Key Config Files
All personality and behavior files live in ~/clawd/. The main system config lives in ~/.openclaw/.
| File | Location | Purpose |
|---|---|---|
openclaw.json | ~/.openclaw/ | Main configuration — API keys, model settings, channel configs, cron jobs |
SOUL.md | ~/clawd/ | Agent personality — tone, values, communication style, behavioral guidelines |
USER.md | ~/clawd/ | Information about you — name, location, preferences, routines, context the agent needs |
IDENTITY.md | ~/clawd/ | Agent name, avatar, and public-facing identity |
MEMORY.md | ~/clawd/ | Long-term memory — facts, preferences, and learned information persisted across sessions |
MESSAGING.md | ~/clawd/ | Message routing rules — how to handle messages from different sources and channels |
HEARTBEAT.md | ~/clawd/ | Proactive behaviors — scheduled actions and check-ins the agent initiates on its own |
RULES.md | ~/clawd/ | Handling rules for specific people, situations, topics, and edge cases |
AGENTS.md | ~/clawd/ | Workspace guide — sub-agent definitions, delegation rules, multi-agent coordination |
TOOLS.md | ~/clawd/ | Environment notes — available tools, system capabilities, and integration details |
Config File Priority
When the agent makes a decision, it consults these files in order:
RULES.md— Hard rules always take precedenceSOUL.md— Personality and behavioral defaultsUSER.md— Your preferences and contextMEMORY.md— Learned facts and accumulated knowledgeMESSAGING.md— Channel-specific routing
3. Essential CLI Commands
Installation and Setup
bash1# Install OpenClaw globally 2npm install -g @anthropic-ai/openclaw 3 4# Run the onboarding wizard — sets up config, API keys, and first channel 5openclaw onboard 6 7# Verify installation 8openclaw --version
Starting and Stopping
bash1# Start the Gateway (foreground) 2openclaw start 3 4# Start the Gateway (background/daemon) 5openclaw start --daemon 6 7# Stop the Gateway 8openclaw stop 9 10# Restart the Gateway 11openclaw restart 12 13# Check if the Gateway is running and healthy 14openclaw status
Configuration
bash1# Open the main config file in your default editor 2openclaw config 3 4# View current configuration (read-only) 5openclaw config --show 6 7# Set a specific config value 8openclaw config set <key> <value> 9 10# Set your default AI model 11openclaw config set model claude-sonnet-4-20250514 12 13# Set up API keys 14openclaw config set anthropicApiKey sk-ant-xxxxx 15openclaw config set openaiApiKey sk-xxxxx
Skills
bash1# Browse available skills on ClawHub 2openclaw skill list 3 4# Search for a specific skill 5openclaw skill search <keyword> 6 7# Install a skill 8openclaw skill install <skill-name> 9 10# Uninstall a skill 11openclaw skill uninstall <skill-name> 12 13# List installed skills 14openclaw skill installed 15 16# Update all installed skills 17openclaw skill update
Channels
bash1# List available channel types 2openclaw channel list 3 4# Add a new channel 5openclaw channel add <channel-type> 6 7# Remove a channel 8openclaw channel remove <channel-name> 9 10# Test a channel connection 11openclaw channel test <channel-name>
Memory and Logs
bash1# View recent memory entries 2openclaw memory list 3 4# Search memory 5openclaw memory search <query> 6 7# Clear memory (use with caution) 8openclaw memory clear 9 10# View Gateway logs 11openclaw logs 12 13# View logs with filtering 14openclaw logs --level error 15openclaw logs --tail 50
Diagnostics
bash1# Full system diagnostic — checks all components, connections, and configs 2openclaw doctor 3 4# Test AI model connectivity 5openclaw test model 6 7# Test a specific channel 8openclaw test channel <channel-name>
4. Channel Quick-Start
iMessage
Requires macOS with Messages app configured. Uses the Shortcuts bridge.
json1{ 2 "channels": { 3 "imessage": { 4 "enabled": true, 5 "pairedDevices": ["+1234567890"] 6 } 7 } 8}
Slack
Create a Slack app at api.slack.com/apps, get a Bot Token.
json1{ 2 "channels": { 3 "slack": { 4 "enabled": true, 5 "botToken": "xoxb-your-bot-token", 6 "appToken": "xapp-your-app-token", 7 "signingSecret": "your-signing-secret" 8 } 9 } 10}
Uses the WhatsApp Business API or community bridges.
json1{ 2 "channels": { 3 "whatsapp": { 4 "enabled": true, 5 "phoneNumber": "+1234567890", 6 "bridge": "whatsapp-web" 7 } 8 } 9}
Telegram
Create a bot via @BotFather, get the token.
json1{ 2 "channels": { 3 "telegram": { 4 "enabled": true, 5 "botToken": "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11" 6 } 7 } 8}
Discord
Create an application at discord.com/developers, get a bot token.
json1{ 2 "channels": { 3 "discord": { 4 "enabled": true, 5 "botToken": "your-discord-bot-token", 6 "guildId": "your-server-id" 7 } 8 } 9}
Signal
Uses the signal-cli bridge. Requires a dedicated phone number.
json1{ 2 "channels": { 3 "signal": { 4 "enabled": true, 5 "phoneNumber": "+1234567890" 6 } 7 } 8}
WebChat
Built-in, no external setup required. Available immediately after starting the Gateway.
http://localhost:18789
5. Security Defaults
These are the recommended safe defaults for a new installation. Adjust only after reading the full Security Guide.
DM and Group Policies
json1{ 2 "security": { 3 "dmPolicy": "paired-only", 4 "groupPolicy": "allowlisted", 5 "allowlistedGroups": [] 6 } 7}
| Policy | Setting | What It Means |
|---|---|---|
dmPolicy | paired-only | Only respond to DMs from paired/approved contacts |
dmPolicy | open | Respond to DMs from anyone (use with caution) |
groupPolicy | allowlisted | Only respond in explicitly allowlisted groups |
groupPolicy | all | Respond in any group the agent is added to |
Sandboxing
json1{ 2 "security": { 3 "sandboxEnabled": true, 4 "allowedPaths": ["~/Documents", "~/Downloads"], 5 "networkAccess": "restricted", 6 "maxTokensPerRequest": 4096 7 } 8}
API Key Safety
- Store API keys in
openclaw.json, not in.mdconfig files - Use environment variables as an alternative:
ANTHROPIC_API_KEY,OPENAI_API_KEY - Never commit
~/.openclaw/openclaw.jsonto version control - Set spending limits on your AI provider dashboards
- Rotate keys periodically
Quick Security Checklist
| Item | Safe Default | Risk If Wrong |
|---|---|---|
dmPolicy | paired-only | Agent responds to strangers |
groupPolicy | allowlisted | Agent talks in unexpected groups |
sandboxEnabled | true | Agent can access full filesystem |
| API key spending limits | Set | Runaway costs |
| Memory access | Session-scoped | Cross-session data leakage |
6. Cron Job Examples
Cron jobs are defined in openclaw.json under the cron array. The schedule uses standard cron syntax.
Cron Syntax Quick Reference
┌────────── minute (0-59)
│ ┌──────── hour (0-23)
│ │ ┌────── day of month (1-31)
│ │ │ ┌──── month (1-12)
│ │ │ │ ┌── day of week (0-7, 0 and 7 = Sunday)
│ │ │ │ │
* * * * *
| Pattern | Meaning |
|---|---|
0 7 * * * | Every day at 7 AM |
0 7 * * 1-5 | Weekdays at 7 AM |
*/30 * * * * | Every 30 minutes |
0 9 * * 1 | Every Monday at 9 AM |
0 8 1 * * | First day of every month at 8 AM |
0 17 * * 5 | Every Friday at 5 PM |
Practical Examples
Morning briefing (weekdays at 7 AM):
json1{ 2 "schedule": "0 7 * * 1-5", 3 "prompt": "Deliver my daily briefing: weather, calendar, top tasks, and any overnight alerts.", 4 "channel": "imessage" 5}
Email triage (three times daily on weekdays):
json1{ 2 "schedule": "0 8,12,17 * * 1-5", 3 "prompt": "Check my inbox for new messages since the last check. Triage by urgency. Draft responses for routine items.", 4 "channel": "slack" 5}
Weekly review (Friday at 5 PM):
json1{ 2 "schedule": "0 17 * * 5", 3 "prompt": "Weekly review: summarize what I accomplished this week, what's still open, and what's on deck for next week. Check memory for commitments I made.", 4 "channel": "slack" 5}
Competitor monitoring (Monday at 10 AM):
json1{ 2 "schedule": "0 10 * * 1", 3 "prompt": "Weekly competitive intelligence: search for news, product updates, and social media activity from [Competitor A], [Competitor B], and [Competitor C] in the past 7 days.", 4 "channel": "slack" 5}
Hydration reminder (every 2 hours during work hours):
json1{ 2 "schedule": "0 9,11,13,15,17 * * 1-5", 3 "prompt": "Quick reminder: drink some water.", 4 "channel": "imessage" 5}
Monthly invoice reminder (1st of each month):
json1{ 2 "schedule": "0 8 1 * *", 3 "prompt": "It's the first of the month. List all active clients and the invoices I need to send today. Include amounts if I've told you.", 4 "channel": "imessage" 5}
7. Common Troubleshooting
Gateway Will Not Start
Symptoms: openclaw start exits immediately or shows a port conflict error.
Fixes:
bash1# Check if something else is using port 18789 2lsof -i :18789 3 4# Kill the existing process if needed 5kill -9 <PID> 6 7# Or change the port in openclaw.json 8openclaw config set port 18790 9 10# Check Node.js version (requires 22+) 11node --version
Agent Not Responding to Messages
Symptoms: You send a message through a channel but get no response. The Gateway is running.
Fixes:
- Check channel connection:
openclaw channel test <channel-name> - Check dmPolicy: If set to
paired-only, make sure your number/account is in the paired list - Check logs for errors:
openclaw logs --level error --tail 20 - Verify API key:
openclaw test model - Restart the Gateway:
openclaw restart
"Model Not Found" or API Errors
Symptoms: Errors mentioning model names, rate limits, or authentication failures.
Fixes:
bash1# Verify your API key is set 2openclaw config --show | grep -i apikey 3 4# Test model connectivity 5openclaw test model 6 7# Check your provider dashboard for: 8# - API key validity 9# - Spending limits reached 10# - Rate limit status
Common model names:
- Anthropic:
claude-sonnet-4-20250514,claude-opus-4-0-20250115 - OpenAI:
gpt-4o,gpt-4o-mini - Google:
gemini-2.0-flash,gemini-2.5-pro
Memory Not Persisting
Symptoms: The agent forgets things you told it in previous sessions.
Fixes:
- Check that memory is enabled in config:
json
1{ 2 "memory": { 3 "enabled": true, 4 "backend": "local" 5 } 6} - Verify MEMORY.md exists:
ls ~/clawd/MEMORY.md - Check memory manually:
openclaw memory list - Ensure you are not clearing memory on restart — check for
clearOnRestart: truein your config
Cron Jobs Not Firing
Symptoms: Scheduled tasks do not run at the expected time.
Fixes:
- Verify the Gateway is running:
openclaw status - Check cron syntax: Use crontab.guru to validate your schedule
- Check timezone: Cron schedules use your system timezone. Verify with
date - Check the cron config is valid JSON: Common issue is trailing commas or missing brackets
- Check logs at the scheduled time:
openclaw logs --tail 50right after the cron should have fired - Verify the channel exists and is connected: The cron output needs somewhere to go
High API Costs
Symptoms: Your AI provider bill is higher than expected.
Fixes:
- Review cron frequency: Every-minute crons add up fast. Do you really need
*/1 * * * *? - Set
maxTokensPerRequestin your security config to cap individual responses - Use cheaper models for simple tasks: Route briefings to
gpt-4o-miniorclaude-haiku - Check for runaway sessions:
openclaw logs | grep "session"to look for stuck loops - Set spending limits on your provider dashboards (Anthropic, OpenAI, Google)
8. Quick Recipes
Minimal copy-paste snippets for common setups.
Minimal SOUL.md
markdownYou are my personal assistant. Be concise and direct. No pleasantries unless I initiate them. Prefer bullet points over paragraphs. When uncertain, ask rather than guess.
Minimal USER.md
markdown1## About Me 2- Name: [Your name] 3- Location: [City, State] 4- Timezone: [e.g., America/Los_Angeles] 5- Work: [Job title] at [Company] 6- Communication preference: Brief and direct
Minimal RULES.md
markdown1## General Rules 2- Never share my personal information with anyone 3- If you are unsure about something, ask before acting 4- Save important facts I tell you to memory automatically 5- When I say "remind me," create a reminder and confirm the time
Minimal openclaw.json (Core Structure)
json1{ 2 "model": "claude-sonnet-4-20250514", 3 "anthropicApiKey": "sk-ant-xxxxx", 4 "port": 18789, 5 "security": { 6 "dmPolicy": "paired-only", 7 "groupPolicy": "allowlisted", 8 "sandboxEnabled": true 9 }, 10 "channels": { 11 "imessage": { 12 "enabled": true, 13 "pairedDevices": ["+1234567890"] 14 } 15 }, 16 "cron": [ 17 { 18 "schedule": "0 7 * * *", 19 "prompt": "Good morning. Deliver my daily briefing.", 20 "channel": "imessage" 21 } 22 ], 23 "memory": { 24 "enabled": true, 25 "backend": "local" 26 } 27}
9. Model Routing
OpenClaw supports multiple AI providers simultaneously. You can route different tasks to different models based on cost and capability.
| Use Case | Recommended Model | Why |
|---|---|---|
| Complex reasoning | claude-opus-4-0-20250115 | Highest capability for nuanced tasks |
| General tasks | claude-sonnet-4-20250514 | Best balance of quality and cost |
| Quick responses | claude-haiku or gpt-4o-mini | Fast and cheap for simple tasks |
| Cron summaries | gpt-4o-mini | Low cost for routine scheduled tasks |
| Code generation | claude-sonnet-4-20250514 | Strong code capabilities at moderate cost |
Fallback Configuration
json1{ 2 "model": "claude-sonnet-4-20250514", 3 "fallbackModels": ["gpt-4o", "gemini-2.0-flash"], 4 "fallbackOnError": true 5}
If Claude is unavailable, OpenClaw will try GPT-4o, then Gemini, before failing.
10. Environment Variables
Alternative to storing values in openclaw.json — useful for deployments and version control safety.
| Variable | Purpose |
|---|---|
ANTHROPIC_API_KEY | Anthropic (Claude) API key |
OPENAI_API_KEY | OpenAI (GPT) API key |
GOOGLE_AI_API_KEY | Google (Gemini) API key |
OPENCLAW_PORT | Gateway port (default: 18789) |
OPENCLAW_HOME | Config directory (default: ~/.openclaw) |
OPENCLAW_CLAWD | Personality files directory (default: ~/clawd) |
OPENCLAW_LOG_LEVEL | Logging level: debug, info, warn, error |
Set them in your shell profile:
bashexport ANTHROPIC_API_KEY="sk-ant-xxxxx" export OPENAI_API_KEY="sk-xxxxx"
Or in a .env file in ~/.openclaw/ (never commit this file).
11. Useful Links
| Resource | URL |
|---|---|
| GitHub Repository | github.com/anthropics/openclaw |
| ClawHub (Skills) | clawhub.com |
| Community Discord | discord.gg/openclaw |
| Subreddit | r/OpenClaw |
| This Guide | learnopenclaw.com |
| Security Checklist | learnopenclaw.com/security/network-security |
| Use Case Playbooks | learnopenclaw.com/playbooks |