Skip to content

Instantly share code, notes, and snippets.

@lucataco
Created February 7, 2026 20:11
Show Gist options
  • Select an option

  • Save lucataco/12b37d03184dce0e79ed1ec88db504cd to your computer and use it in GitHub Desktop.

Select an option

Save lucataco/12b37d03184dce0e79ed1ec88db504cd to your computer and use it in GitHub Desktop.
openclaw-introspect skill
name description
openclaw-introspect
Explore, understand, and reconfigure your own OpenClaw gateway, agent harness, and system prompt. Use when you need to inspect or change OpenClaw configuration (openclaw.json), understand how the system prompt is built, debug session/channel/model issues, navigate the docs or source code, or tune agent defaults (models, thinking, sandbox, tools, heartbeat, compaction, channels, skills, plugins, cron, hooks). Also use for questions about OpenClaw architecture, the agent loop, context window, or how any OpenClaw feature works internally.

OpenClaw Self-Introspection

Explore and reconfigure your own harness. This skill gives you structured knowledge about the OpenClaw internals so you can inspect, debug, and tune the running gateway.

Quick commands

# Live config
openclaw status                          # gateway + session overview
openclaw health                          # gateway health check
openclaw doctor                          # diagnose config issues
openclaw sessions --json                 # dump all sessions
openclaw models status                   # model + auth overview
openclaw models list --all               # full model catalog

# Config inspection (RPC)
# Use the gateway tool: gateway action=config.get
# Use the gateway tool: gateway action=config.schema

Inspecting current config

Use gateway tool with action: "config.get" to retrieve the live config (includes hash for safe patching). Use gateway tool with action: "config.schema" for the full JSON Schema.

Changing config

  • Partial update (preferred): gateway tool with action: "config.patch", pass raw (JSON5 of keys to change) + baseHash from config.get.
  • Full replace: gateway tool with action: "config.apply", pass raw (entire config) + baseHash.
  • Both validate, write, and restart the gateway automatically.
  • Never guess the hash — always fetch it from config.get first.

Chat commands for live inspection

Send these as standalone messages:

  • /status — session + model + thinking + context usage
  • /context list — what's injected into the system prompt + sizes
  • /context detail — per-file, per-tool schema, per-skill entry sizes
  • /model — numbered model picker
  • /model status — detailed model + auth view
  • /usage tokens — per-reply token usage footer

Reference files (read on demand)

Organized by topic. Read only when the task requires it.

Topic File When to read
Architecture references/architecture.md Gateway components, WS protocol, connection lifecycle
Configuration references/configuration.md All config keys, structure, env vars, includes
Agent & sessions references/agent-sessions.md Agent loop, session keys, reset policies, compaction
Models & providers references/models-providers.md Model selection, fallbacks, auth, custom providers
Channels references/channels.md Channel setup (WhatsApp, Telegram, Discord, Slack, etc.)
Tools & sandbox references/tools-sandbox.md Tool profiles, allow/deny, elevated, sandbox config
System prompt references/system-prompt.md How the prompt is assembled, what's injected, context
Automation references/automation.md Cron, heartbeats, hooks, webhooks
Skills & plugins references/skills-plugins.md Skill gating, config, plugins, ClawHub

Diagnostic scripts

Script Purpose
scripts/dump-config.sh Print resolved config (redacted)
scripts/session-stats.sh Session count, sizes, recent activity
scripts/check-env.sh Check expected env vars and auth

Key file locations

~/.openclaw/
├── openclaw.json                    # Main config (JSON5)
├── .env                             # Global env fallback
├── agents/<agentId>/
│   ├── agent/
│   │   ├── models.json              # Provider catalog (auto-merged)
│   │   └── auth-profiles.json       # OAuth + API key store
│   └── sessions/
│       ├── sessions.json            # Session store (key → metadata)
│       └── <SessionId>.jsonl        # Session transcripts
├── credentials/
│   └── whatsapp/<accountId>/        # Baileys auth state
├── skills/                          # Managed/local skills
├── extensions/                      # Plugins
├── sandboxes/                       # Sandbox workspaces
└── workspace-<agentId>/             # Agent workspace
    ├── AGENTS.md, SOUL.md, ...      # Bootstrap files (injected into prompt)
    ├── MEMORY.md                    # Long-term memory
    ├── HEARTBEAT.md                 # Heartbeat checklist
    ├── memory/                      # Daily memory notes
    └── skills/                      # Workspace skills (highest precedence)

Docs location

Local docs: /home/lucataco/.npm-global/lib/node_modules/openclaw/docs Online: https://docs.openclaw.ai

Architecture TL;DR

  • Gateway: single long-lived daemon owning all channels + sessions + tools. WS API on port 18789.
  • Agent loop: intake → context assembly → model inference → tool execution → streaming replies → persistence. Serialized per session.
  • System prompt: OpenClaw-built per run. Includes tools, skills list, workspace files, runtime metadata.
  • Sessions: per-sender (DMs collapse to main by default). Daily reset at 4 AM. JSONL transcripts.
  • Config: ~/.openclaw/openclaw.json (JSON5). Strict validation. config.patch for safe partial updates.
  • Channels: WhatsApp (Baileys), Telegram (grammY), Discord (discord.js), Slack (Bolt), Signal (signal-cli), iMessage (imsg), Google Chat, MS Teams, WebChat, + extensions.
  • Tools: file ops, exec, browser, canvas, nodes, cron, sessions, messaging. Filtered by profiles + allow/deny.
  • Skills: bundled → managed → workspace (highest precedence). Gated by bins/env/config at load time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment