You install OpenClaw on your workstation, run openclaw onboard, send a message from Telegram, and a reply comes back. That part is two minutes of setup. The part nobody walks you through is what is actually running between the bot token and the reply — there is a Gateway daemon, an embedded agent runtime, a workspace directory, a skills loader with a six-level precedence chain, a session store, and a channel bridge per chat app. When something misbehaves in production — a skill loads from the wrong place, memory loses context across a restart, the dashboard shows the agent thinking but no message ever comes back — debugging is impossible without the mental model. This article is the model.
What it is
OpenClaw is an open-source personal AI agent that runs as a long-lived Node.js process on your own hardware, with the Gateway as its core daemon and an embedded agent runtime built on the Pi agent core (OpenClaw docs). It is not a chat UI — there is a Control UI for inspection on http://127.0.0.1:18789/, but the primary interaction surfaces are the chat channels you wire in: WhatsApp, Telegram, Discord, Slack, Signal, iMessage, Matrix, Microsoft Teams, and several others (openclaw.ai integrations).
The runtime is single-tenant and local-first by default. The Gateway listens on 127.0.0.1:18789, the agent’s working directory lives under ~/.openclaw/workspace, the config sits at ~/.openclaw/openclaw.json, and the model calls go out to whichever LLM provider you configure — Anthropic, OpenAI, Google, MiniMax, an Ollama endpoint, or any of the fifty-plus providers in the registry (openclaw.ai integrations). The npm package is openclaw, the GitHub repository is github.com/openclaw/openclaw, and the recommended Node.js version is 24, with 22.16+ as the supported floor (OpenClaw docs).
Mental model
Think of OpenClaw as four concentric layers, each with a well-defined contract:
The outermost layer is the channel bridge. Each chat provider — Telegram bot via grammY, Slack via the Bolt SDK, Discord via discord.js, iMessage via the macOS bridge, WhatsApp via a bundled bridge — runs as a worker that translates platform-specific events into a normalized inbound-message shape and emits outbound messages back. Channel config lives under channels.<provider> in openclaw.json, with shared keys like enabled, botToken, dmPolicy, allowFrom, groupPolicy, and provider-specific extensions like Telegram’s groups map (OpenClaw docs).
Inside the bridge is the Gateway. The Gateway is the long-running daemon. It owns the HTTP listener (default port 18789), the session store, the cron scheduler, the channel workers, the dashboard, and the agent runtime spawn. Gateway config lives under gateway in openclaw.json with keys for port, bind, auth, channelHealthCheckMinutes, handshakeTimeoutMs, and push (OpenClaw docs). Restarting the Gateway is the granularity at which you reload config; channel workers and the agent runtime restart with it.
Inside the Gateway is the embedded agent runtime. There is one agent per Gateway, and one workspace per agent. On first session turn, the runtime injects six editable bootstrap files into the workspace — AGENTS.md, SOUL.md, TOOLS.md, IDENTITY.md, USER.md, and a one-shot BOOTSTRAP.md that the agent deletes after running. These files are not configuration that you set once — they are the persona and operating instructions that the agent itself can rewrite over time. Session transcripts persist as JSONL at ~/.openclaw/agents/<agentId>/sessions/<SessionId>.jsonl (OpenClaw docs).
The innermost layer is the skill set. Skills are AgentSkills-compatible directories with a SKILL.md file carrying YAML frontmatter — a name, a description, gating metadata, and a body of instructions. The runtime loads skills from six locations in precedence order: workspace skills, project agent skills, personal agent skills, managed skills under ~/.openclaw/skills, bundled skills shipped with the install, and any extra folders declared in config. If two skills share a name, the highest-precedence one wins (OpenClaw docs). Skills can also be gated at load time on binary availability, environment variables, config paths, or OS — so a skill that requires ffmpeg simply will not register on a host that does not have it.
The agent loop itself is conventional: receive a turn, decide on a tool call or a reply, execute the tool against the workspace (file read/write, shell exec, browser control, HTTP, scheduled-job creation, channel send), append to the session transcript, and either yield to the user or take another loop. The two non-obvious bits are persistent memory between sessions (handled by the workspace’s bootstrap files plus an opt-in memory engine like Honcho, QMD, or LanceDB) and the steering channel, which lets inbound messages mid-run be queued into the active session rather than starting a new run (OpenClaw docs).
How it works on the Stack Harbor stack
On a managed deployment you do not run OpenClaw on a developer laptop. You run it on a dedicated small VM — two vCPUs, 4 GB RAM is enough for the Gateway plus moderate channel traffic — with Node.js 22.16+ installed via the official Node.js distribution, the OpenClaw daemon installed via the install script, and the workspace directory on a backed-up volume so session transcripts and skill state survive disk loss.
Three deployment realities matter:
First, the LLM backend is an external dependency. If OpenClaw is configured against Anthropic’s API (Anthropic docs) or OpenAI (OpenAI docs), the API key is the most sensitive secret on the box. Treat it like a database root password — store it in your secrets manager, inject it as an environment variable, never commit it to openclaw.json. If you run a local backend with Ollama (Ollama docs), the model server lives on a separate GPU host and OpenClaw points at it via HTTP.
Second, the chat-channel side has its own auth surface. The Telegram bot token, the Slack signing secret, the Discord application ID — every channel is a separate set of credentials with a separate lifecycle. The dmPolicy defaults to pairing on most channels, meaning unknown senders need a pairing code before they can interact (OpenClaw docs). On a multi-user installation you treat this like SSO admission.
Third, the workspace directory is the persistence boundary. Everything that survives a restart — session transcripts, persistent memory, custom skills, cron job definitions in ~/.openclaw/cron/jobs.json, the agent’s editable persona files — lives there. A backup that covers ~/.openclaw/ covers OpenClaw. A backup that does not is silently losing state.
When to use vs not
OpenClaw is the right choice when you want a single agent that integrates a person’s working life across many chat surfaces and tools, runs on hardware you control, and can be extended with skills you write yourself. The compelling pattern is: “Telegram me the morning brief at 7 AM, watch this Gmail label, draft Linear tickets from voice memos in Obsidian, and run a Spotify playlist if my Hue lights say I’m in focus mode.” That is one agent with persistent memory across many surfaces, which is what OpenClaw is built for.
It is the wrong tool when you want a multi-user team chat UI (use Open WebUI or AnythingLLM with an OIDC frontend), a stateless inference proxy (use vLLM or LiteLLM directly), or a no-code workflow engine (use n8n or Activepieces). It is also the wrong tool when you cannot tolerate a long-lived process on a host — OpenClaw is a daemon, not a Lambda.
Common misconceptions
“OpenClaw is the same product as Open WebUI.” No. Open WebUI is a multi-user chat frontend that sits in front of an LLM endpoint. OpenClaw is a single-user agent that calls LLM endpoints as a client and acts on the world through tools and channels. The two are complementary, not substitutes.
“OpenClaw is an Anthropic product.” No. OpenClaw is an independent open-source project, MIT-licensed, hosted at github.com/openclaw/openclaw. It speaks Anthropic’s API as one of many backends but has no affiliation with Anthropic.
“Skills are plugins like in WordPress.” Skills are markdown files with YAML frontmatter and optional code, loaded from a precedence chain — closer to the AgentSkills convention than to a WordPress plugin. They are versioned in source control alongside your workspace, not shipped as compiled artifacts.
“The Gateway is the dashboard.” The dashboard at http://127.0.0.1:18789/ is one HTTP surface served by the Gateway. The Gateway also hosts the agent runtime, the channel workers, the cron scheduler, and the session store. The dashboard is the inspection UI; the Gateway is the system.
Related
- Installing OpenClaw and walking through the first run
- Persistent memory in OpenClaw: how it works and where it lives
- OpenClaw config file reference
Sources
- OpenClaw docs — agent runtime
- OpenClaw docs — getting started
- OpenClaw docs — configuration
- OpenClaw docs — skills
- OpenClaw docs — Telegram channel
- openclaw.ai integrations
- GitHub: openclaw/openclaw
- Anthropic API docs
- OpenAI API docs
- Ollama API docs
- Node.js docs
Last verified on OpenClaw current. Verify against the live docs at https://docs.openclaw.ai before standing up a production install — the runtime is moving quickly and config keys do shift.