OpenClaw Operations Runbook
Diagnose and fix real problems. Every command here is tested and works.
Quick Health Check
Run this first when anything seems wrong. Copy-paste the whole block:
echo "=== GATEWAY ===" && \
ps aux | grep -c "[o]penclaw" && \
echo "=== CONFIG JSON ===" && \
python3 -m json.tool ~/.openclaw/openclaw.json > /dev/null 2>&1 && echo "JSON: OK" || echo "JSON: BROKEN" && \
echo "=== CHANNELS ===" && \
cat ~/.openclaw/openclaw.json | jq -r '.channels | to_entries[] | "\(.key): policy=\(.value.dmPolicy // "n/a") enabled=\(.value.enabled // "implicit")"' && \
echo "=== PLUGINS ===" && \
cat ~/.openclaw/openclaw.json | jq -r '.plugins.entries | to_entries[] | "\(.key): \(.value.enabled)"' && \
echo "=== CREDS ===" && \
ls ~/.openclaw/credentials/whatsapp/default/ 2>/dev/null | wc -l | xargs -I{} echo "WhatsApp keys: {} files" && \
for d in ~/.openclaw/credentials/telegram/*/; do bot=$(basename "$d"); [ -f "$d/token.txt" ] && echo "Telegram $bot: OK" || echo "Telegram $bot: MISSING"; done && \
[ -f ~/.openclaw/credentials/bird/cookies.json ] && echo "Bird cookies: OK" || echo "Bird cookies: MISSING" && \
echo "=== CRON ===" && \
cat ~/.openclaw/cron/jobs.json | jq -r '.jobs[] | "\(.name): enabled=\(.enabled) status=\(.state.lastStatus // "never") \(.state.lastError // "")"' && \
echo "=== RECENT ERRORS ===" && \
tail -10 ~/.openclaw/logs/gateway.err.log 2>/dev/null && \
echo "=== MEMORY DB ===" && \
sqlite3 ~/.openclaw/memory/main.sqlite "SELECT COUNT(*) || ' chunks, ' || (SELECT COUNT(*) FROM files) || ' files indexed' FROM chunks;" 2>/dev/null
File Map
~/.openclaw/
βββ openclaw.json # MAIN CONFIG β channels, auth, gateway, plugins, skills
βββ openclaw.json.bak* # Auto-backups (.bak, .bak.1, .bak.2 ...)
βββ exec-approvals.json # Exec approval socket config
β
βββ agents/main/
β βββ agent/auth-profiles.json # Anthropic auth tokens
β βββ sessions/
β βββ sessions.json # SESSION INDEX β keys are like agent:main:whatsapp:+1234
β βββ *.jsonl # Session transcripts (one JSON per line)
β
βββ workspace/ # Agent workspace (git-tracked)
β βββ SOUL.md # Personality, writing style, tone rules
β βββ IDENTITY.md # Name, creature type, vibe
β βββ USER.md # Owner context and preferences
β βββ AGENTS.md # Session behavior, memory rules, safety
β βββ BOOT.md # Boot instructions (autopilot notification protocol)
β βββ HEARTBEAT.md # Periodic task checklist (empty = skip heartbeat)
β βββ MEMORY.md # Curated long-term memory (main session only)
β βββ TOOLS.md # Contacts, SSH hosts, device nicknames
β βββ memory/ # Daily logs: YYYY-MM-DD.md, topic-chat.md
β βββ skills/ # Workspace-level skills
β
βββ memory/main.sqlite # Vector memory DB (Gemini embeddings, FTS5 search)
β
βββ logs/
β βββ gateway.log # Runtime: startup, channel init, config reload, shutdown
β βββ gateway.err.log # Errors: connection drops, API failures, timeouts
β βββ commands.log # Command execution log
β
βββ cron/
β βββ jobs.json # Job definitions (schedule, payload, delivery target)
β βββ runs/ # Per-job run logs: {job-uuid}.jsonl
β
βββ credentials/
β βββ whatsapp/default/ # Baileys session: ~1400 app-state-sync-key-*.json files
β βββ telegram/{botname}/token.txt # Bot tokens (one per bot account)
β βββ bird/cookies.json # X/Twitter auth cookies
β
βββ extensions/{name}/ # Custom plugins (TypeScript)
β βββ openclaw.plugin.json # {"id", "channels", "configSchema"}
β βββ index.ts # Entry point
β βββ src/ # channel.ts, actions.ts, runtime.ts, types.ts
β
βββ identity/ # device.json, device-auth.json
βββ devices/ # paired.json, pending.json
βββ media/inbound/ # Received images, audio files
βββ media/browser/ # Browser screenshots
βββ browser/openclaw/user-data/ # Chromium profile (~180MB)
βββ tools/signal-cli/ # Signal CLI binary
βββ subagents/runs.json # Sub-agent execution log
βββ canvas/index.html # Web canvas UI
βββ telegram/
βββ update-offset-coder.json # {"lastUpdateId": N} β Telegram polling cursor
βββ update-offset-sales.json # Reset these to 0 to replay missed messages
Troubleshooting: WhatsApp
"I sent a message but got no reply"
This is the #1 issue. The message arrives but the bot doesn't respond. Check in this order:
grep -i "whatsapp.*starting\|whatsapp.*listening" ~/.openclaw/logs/gateway.log | tail -5
grep -i "408\|499\|retry" ~/.openclaw/logs/gateway.err.log | tail -10
grep -i "cross-context.*denied" ~/.openclaw/logs/gateway.err.log | tail -10
cat ~/.openclaw/agents/main/sessions/sessions.json | jq -r 'to_entries[] | select(.key | test("whatsapp")) | "\(.key) | \(.value.origin.label // "?")"'
cat ~/.openclaw/openclaw.json | jq '.channels.whatsapp | {dmPolicy, allowFrom, selfChatMode, groupPolicy}'
cat ~/.openclaw/openclaw.json | jq '.channels.whatsapp.groupPolicy'
grep "lane wait exceeded" ~/.openclaw/logs/gateway.err.log | tail -5
grep "embedded run timeout" ~/.openclaw/logs/gateway.err.log | tail -5
"WhatsApp fully disconnected"
ls ~/.openclaw/credentials/whatsapp/default/ | wc -l
grep -i "pair\|link\|qr\|scan\|logged out" ~/.openclaw/logs/gateway.log | tail -10
grep -i "baileys\|DisconnectReason\|logout\|stream:error" ~/.openclaw/logs/gateway.err.log | tail -20
Troubleshooting: Telegram
"Bots have issues / forget things"
Two separate problems that look the same:
grep -i "telegram.*unrecognized\|telegram.*invalid\|telegram.*policy" ~/.openclaw/logs/gateway.err.log | tail -10
cat ~/.openclaw/openclaw.json | jq '.channels.telegram'
grep -i "telegram.*exit\|telegram.*timeout\|getUpdates" ~/.openclaw/logs/gateway.err.log | tail -10
cat ~/.openclaw/telegram/update-offset-coder.json
cat ~/.openclaw/telegram/update-offset-sales.json
grep -i "telegram.*starting\|telegram.*coder\|telegram.*sales" ~/.openclaw/logs/gateway.log | tail -10
cat ~/.openclaw/agents/main/sessions/sessions.json | jq -r 'to_entries[] | select(.key | tes