All Cheatsheets
OpenClaw Cheatsheet
Cheatsheet

OpenClaw Cheatsheet

The OpenClaw quick reference you'll bookmark. Architecture overview, config files, CLI commands, channel setup, security defaults, cron examples, and common troubleshooting — all on one page.

Deepak KambojUpdated February 2026

OpenClaw Cheat Sheet

Everything you need on one page. Bookmark this.


1. Architecture at a Glance

You ──▶ Channel ──▶ Gateway ──▶ Agent ──▶ Skill
                        │                    │
                        ▼                    ▼
                     Memory              External APIs
ComponentOne-Line Description
GatewayThe central brain — routes messages, calls AI models, coordinates everything. Runs at ws://127.0.0.1:18789.
ChannelsCommunication bridges — iMessage, Slack, WhatsApp, Telegram, Discord, Signal, Teams, WebChat.
AgentsAI model instances that handle tasks. Simple questions use one agent; complex tasks spawn sub-agents.
SkillsExtensions from ClawHub that add capabilities — calendar, email, web search, smart home, and more.
MemoryPersistent knowledge store — remembers facts, preferences, and conversation history across sessions.
PluginsLow-level infrastructure — filesystem access, HTTP requests, database queries. Skills are built on top of these.
NodesDevice connectors — link iOS, Android, and macOS devices for device-specific features.
Pi RuntimeExecution sandbox where agents run with access to configured tools and skills.
SessionsConversation contexts — short (single Q&A) or long-running (multi-day projects).
LobsterVisual 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/.

FileLocationPurpose
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:

  1. RULES.md — Hard rules always take precedence
  2. SOUL.md — Personality and behavioral defaults
  3. USER.md — Your preferences and context
  4. MEMORY.md — Learned facts and accumulated knowledge
  5. MESSAGING.md — Channel-specific routing

3. Essential CLI Commands

Installation and Setup

bash
1# 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

bash
1# 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

bash
1# 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

bash
1# 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

bash
1# 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

bash
1# 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

bash
1# 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.

json
1{
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.

json
1{
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}

WhatsApp

Uses the WhatsApp Business API or community bridges.

json
1{
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.

json
1{
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.

json
1{
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.

json
1{
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

json
1{
2  "security": {
3    "dmPolicy": "paired-only",
4    "groupPolicy": "allowlisted",
5    "allowlistedGroups": []
6  }
7}
PolicySettingWhat It Means
dmPolicypaired-onlyOnly respond to DMs from paired/approved contacts
dmPolicyopenRespond to DMs from anyone (use with caution)
groupPolicyallowlistedOnly respond in explicitly allowlisted groups
groupPolicyallRespond in any group the agent is added to

Sandboxing

json
1{
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 .md config files
  • Use environment variables as an alternative: ANTHROPIC_API_KEY, OPENAI_API_KEY
  • Never commit ~/.openclaw/openclaw.json to version control
  • Set spending limits on your AI provider dashboards
  • Rotate keys periodically

Quick Security Checklist

ItemSafe DefaultRisk If Wrong
dmPolicypaired-onlyAgent responds to strangers
groupPolicyallowlistedAgent talks in unexpected groups
sandboxEnabledtrueAgent can access full filesystem
API key spending limitsSetRunaway costs
Memory accessSession-scopedCross-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)
│ │ │ │ │
* * * * *
PatternMeaning
0 7 * * *Every day at 7
AM
0 7 * * 1-5Weekdays at 7
AM
*/30 * * * *Every 30 minutes
0 9 * * 1Every Monday at 9
AM
0 8 1 * *First day of every month at 8
AM
0 17 * * 5Every Friday at 5
PM

Practical Examples

Morning briefing (weekdays at 7 AM):

json
1{
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):

json
1{
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):

json
1{
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):

json
1{
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):

json
1{
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):

json
1{
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:

bash
1# 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:

  1. Check channel connection: openclaw channel test <channel-name>
  2. Check dmPolicy: If set to paired-only, make sure your number/account is in the paired list
  3. Check logs for errors: openclaw logs --level error --tail 20
  4. Verify API key: openclaw test model
  5. Restart the Gateway: openclaw restart

"Model Not Found" or API Errors

Symptoms: Errors mentioning model names, rate limits, or authentication failures.

Fixes:

bash
1# 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:

  1. Check that memory is enabled in config:
    json
    1{
    2  "memory": {
    3    "enabled": true,
    4    "backend": "local"
    5  }
    6}
  2. Verify MEMORY.md exists: ls ~/clawd/MEMORY.md
  3. Check memory manually: openclaw memory list
  4. Ensure you are not clearing memory on restart — check for clearOnRestart: true in your config

Cron Jobs Not Firing

Symptoms: Scheduled tasks do not run at the expected time.

Fixes:

  1. Verify the Gateway is running: openclaw status
  2. Check cron syntax: Use crontab.guru to validate your schedule
  3. Check timezone: Cron schedules use your system timezone. Verify with date
  4. Check the cron config is valid JSON: Common issue is trailing commas or missing brackets
  5. Check logs at the scheduled time: openclaw logs --tail 50 right after the cron should have fired
  6. 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:

  1. Review cron frequency: Every-minute crons add up fast. Do you really need */1 * * * *?
  2. Set maxTokensPerRequest in your security config to cap individual responses
  3. Use cheaper models for simple tasks: Route briefings to gpt-4o-mini or claude-haiku
  4. Check for runaway sessions: openclaw logs | grep "session" to look for stuck loops
  5. Set spending limits on your provider dashboards (Anthropic, OpenAI, Google)

8. Quick Recipes

Minimal copy-paste snippets for common setups.

Minimal SOUL.md

markdown
You 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

markdown
1## 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

markdown
1## 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)

json
1{
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 CaseRecommended ModelWhy
Complex reasoningclaude-opus-4-0-20250115Highest capability for nuanced tasks
General tasksclaude-sonnet-4-20250514Best balance of quality and cost
Quick responsesclaude-haiku or gpt-4o-miniFast and cheap for simple tasks
Cron summariesgpt-4o-miniLow cost for routine scheduled tasks
Code generationclaude-sonnet-4-20250514Strong code capabilities at moderate cost

Fallback Configuration

json
1{
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.

VariablePurpose
ANTHROPIC_API_KEYAnthropic (Claude) API key
OPENAI_API_KEYOpenAI (GPT) API key
GOOGLE_AI_API_KEYGoogle (Gemini) API key
OPENCLAW_PORTGateway port (default: 18789)
OPENCLAW_HOMEConfig directory (default: ~/.openclaw)
OPENCLAW_CLAWDPersonality files directory (default: ~/clawd)
OPENCLAW_LOG_LEVELLogging level: debug, info, warn, error

Set them in your shell profile:

bash
export ANTHROPIC_API_KEY="sk-ant-xxxxx"
export OPENAI_API_KEY="sk-xxxxx"

Or in a .env file in ~/.openclaw/ (never commit this file).


ResourceURL
GitHub Repositorygithub.com/anthropics/openclaw
ClawHub (Skills)clawhub.com
Community Discorddiscord.gg/openclaw
Subredditr/OpenClaw
This Guidelearnopenclaw.com
Security Checklistlearnopenclaw.com/security/network-security
Use Case Playbookslearnopenclaw.com/playbooks
Was this cheatsheet helpful? Let us know!