What this unit solvesOpenClaw assembles an agent’s persona, memory, heartbeat, and tool conventions from a set of Markdown files stored in the workspace, so the agent “reads its own soul” before starting work each session. This unit starts from the actual files in the repository and dissects OpenClaw’s origins and positioning, its Gateway execution loop, heartbeat scheduling, memory system, and the exact responsibilities of each custom md file. Details that cannot be confirmed directly from the repository defer to official documentation. By the end of this unit you can summarize OpenClaw’s architecture and judge whether its design philosophy suits your own harness work.
Learning objectives
- Explain OpenClaw’s lineage (Warelay, Clawdbot, Moltbot, OpenClaw) and the problem it solves: letting an agent take real action inside the communication channels the user already uses
- Describe the role of the Gateway control plane and how the heartbeat schedule triggers periodic agent turns
- State the responsibility and load timing of each standard workspace md file (AGENTS.md, BOOTSTRAP.md, HEARTBEAT.md, IDENTITY.md, MEMORY.md, SOUL.md, TOOLS.md, USER.md)
- Summarize the system in one everyday analogy
- Evaluate whether OpenClaw’s “harness-as-visible-files” design could apply to your own agent configuration
1. Origins and positioning
OpenClaw did not appear out of nowhere. It has a traceable evolution, and the name itself tells the story: This naming axis records a rapid rebranding rather than a long evolution: author Peter Steinberger first published under the name Warelay (2025-11), became widely known as Clawdbot, renamed to Moltbot on 2026-01-27 after an Anthropic trademark complaint, and three days later (2026-01-30) settled on OpenClaw and open-sourced it on GitHub (VISION.md as of 2026-05). The problem it solves is straightforward: most AI assistants require the user to “switch to a new interface,” whereas OpenClaw inverts that, executing real tasks directly inside the communication channels the user already uses (WhatsApp, Telegram, Slack, Discord, and 20+ others). It is not another chat UI; it is a personal assistant daemon woven into the user’s existing conversation flow. Its positioning is “local-first personal agent harness”: written in TypeScript because “widely known, fast to iterate, easy to read and modify” — a consensus across engineering communities (VISION.md). In the taxonomy of agent shells it belongs to the “single-machine self-hosted, multi-channel routing, plugin-extensible” type: the core stays lean while optional capabilities are delivered as plugins, avoiding core bloat.The engineering implication of “local-first”Runs on your machine by default, accesses your local resources by default, uses the tools you already have by default. The cost: no enterprise SLA, no shared team infrastructure, no unified audit trail. If you need those, see 05-3 NemoClaw for the hardened shell pattern; OpenClaw itself does not address that problem.
2. Core technology: Gateway control plane and execution loop
The heart of the OpenClaw system is a Gateway control plane running persistently on the local machine. It is not the agent itself — it is “the bus that manages all agents, sessions, channels, tools, and events.” Abstracting this layer away from agent logic is the most consequential design decision in OpenClaw: the integration layer can change without forcing rewrites of the agent logic. The Gateway’s core responsibilities divide into four areas:- Multi-channel routing: messages arriving from any inbound channel are routed to isolated agent instances, each with its own workspace and session, with no context bleed between them
- Multi-agent isolation: each agent is an independent “person” with its own workspace, session, and memory; contexts are never shared
- Tool and permission management: which agent can call which tool, who authorized it, and whether it runs in a sandbox are all decided at this layer
- Event bus: all events (user messages, heartbeat ticks, cron triggers, tool returns) enter the same bus, and agents use it to know “what to do right now”
3. System structure: how the components fit together
OpenClaw places the agent’s “living space” by default at~/.openclaw/workspace, which is the relative root for the file tool. This can be overridden in openclaw.json.
~/.openclaw/
openclaw.json · workspace settings (paths, model, sandbox options)
workspace/ · agent working directory
AGENTS.md · operational instructions and memory usage rules
SOUL.md · persona, tone, boundaries
IDENTITY.md · name, creature type, vibe, emoji, avatar
USER.md · data about the user
TOOLS.md · local tool convention notes
HEARTBEAT.md · heartbeat task list
MEMORY.md · long-term memory distillation layer
memory/ · detailed logs (one file per day)
BOOTSTRAP.md · one-time first-run ritual (deleted when complete)
skills/ · reusable skills (plugins)
logs/ · Gateway and per-agent logs
- The workspace is not a sandbox. The workspace is only the agent’s working directory. Without
agents.defaults.sandboxenabled, the agent can still reach the host filesystem via absolute paths. Think of it as the agent’s “home,” not the agent’s “cage.” - Bootstrap is a ritual. A fresh workspace is seeded by the Gateway with standard md files and a
BOOTSTRAP.md; on first start the agent uses a question-and-answer exchange with the user to collaboratively fill inIDENTITY.mdandSOUL.md, then deletesBOOTSTRAP.md(bootstrapping docs). This “decide together who you are” ritual is not decoration; it is core to OpenClaw’s design philosophy: agent identity is negotiated jointly by the user and the agent, not hard-coded. - Plugins load from the
skills/directory. Skills are stored as~/.openclaw/workspace/skills/<skill>/SKILL.md; the central marketplace is ClawHub (clawhub.ai — as of 2026-05 per the README; check the official page for current marketplace status and availability). - The security model is permissive by default. The main session represents you personally and has full host access by default. Non-main sessions (groups, incoming channels) can be set to Docker / SSH / OpenShell sandboxes in
openclaw.jsonto restrict the tool set.
4. Custom md files, one by one
None of the workspace md files are decorative. Each has a defined responsibility and load timing. The responsibilities below come from the repository’sdocs/concepts/agent-workspace.md and docs/reference/templates/ (as of 2026-05):
Common points of confusion:
SOUL.mdvsUSER.md: the former is “who I am and how I speak”; the latter is “who you are and what you like.” The former belongs to the agent; the latter belongs to you.AGENTS.mdvsSOUL.md:AGENTS.mdis operational policy (“do A before B; call tool Y when you encounter X”), whileSOUL.mdis the persona layer (“direct tone, conclusion first, no emoji”). One governs “what to do”; the other governs “what kind of person to be.”MEMORY.mdvsmemory/YYYY-MM-DD.md:MEMORY.mdholds distilled long-term facts (“the user lives in Taichung, researches precision livestock AI”). The daily logs hold that day’s detailed records.MEMORY.mdis automatically truncated when it exceeds the bootstrap budget; the log files are preserved in full.TOOLS.mdvsskills/:TOOLS.mdholds environment-specific notes (“my camera is namedfront_door, SSH alias islab”).skills/holds shareable, reusable procedures. Keeping these two layers separate means upgrading a skill or switching machines does not leak your personal infrastructure.
Walking through a workspace bootstrapOn a fresh install, first Gateway startup:Why this matters: from this point on, every session start reassembles the agent’s persona and understanding of you from these files. If the files are empty, contradictory, or stale, behavior drifts from the very first line of each session.
1
Seed templates
Automatically plants AGENTS.md, SOUL.md, USER.md, IDENTITY.md, TOOLS.md, HEARTBEAT.md, MEMORY.md templates, and BOOTSTRAP.md
2
Q&A identity setup
The agent reads BOOTSTRAP.md and asks in sequence: “What would you like me to call you?” (written to USER.md); “What should I call myself, what creature, what emoji?” (written to IDENTITY.md); “What tone and limits should I use?” (written to SOUL.md)
3
Ritual complete
After confirmation, BOOTSTRAP.md is deleted and the session begins normally
5. What to take away: the harness concepts OpenClaw makes visible
OpenClaw’s biggest design contribution is not its model support or tool set; it is that it makes harness concepts that are usually buried in system prompts or source code fully visible as readable, diff-able md files. The engineering significance of that equals its product design significance: turning implicit configuration into explicit assets. Mapped against 01-6 Harness Engineering:
Design lessons worth internalizing:
- Lean core + plugin: OpenClaw’s core retains only what is essential; skills, channels, and policies are all extended through plugins and md files. Core bloat is where software decay starts, and the same applies to harnesses.
- Separate environment-specific from shareable behavior:
TOOLS.md(what your camera is called) andSOUL.md(this agent’s persona) are managed separately, so sharingSOUL.mdandskills/does not leak your infrastructure. - Ritual is not decoration:
BOOTSTRAP.mdforces the agent and user to sit down and agree on “who we are and how we will work together.” This produces more real behavioral constraint than a “default persona” written in documentation. - “Nothing to do, reply OK” is a cost-saving design: leaving
HEARTBEAT.mdempty skips even the model call — a zero-cost on/off switch for “installed but not yet in use” scenarios.
6. One everyday analogy
OpenClaw is like a flatmate with their own “life manual”: a note on the fridge that says “who I am and how I speak” (SOUL.md), leftover labels in the fridge from yesterday (MEMORY.md), a kitchen timer that rings every half hour asking “have I checked on the stove?” (HEARTBEAT.md), a notebook at the door for “what is this camera called, how do I SSH to that machine” (TOOLS.md), and each evening before sleep they review the day’s notes to decide what gets written into long-term memory (daily memory/YYYY-MM-DD.md distilled into MEMORY.md). The person is not the agent; the agent is the joint assembly of person and environment, and that life manual is the environment.
Hands-on exercises
1
Install locally and observe the bootstrap
Clone OpenClaw locally and run
openclaw onboard --install-daemon. Watch which md files are seeded into the workspace and how the bootstrap ritual builds IDENTITY.md and SOUL.md through a question-and-answer exchange. Verify that BOOTSTRAP.md is actually deleted when complete.2
Edit HEARTBEAT.md and observe a heartbeat turn
Add a task to
~/.openclaw/workspace/HEARTBEAT.md such as “every half hour, check whether my GitHub has any new issues assigned to me.” After 30 minutes, observe whether the heartbeat turn executes correctly and replies HEARTBEAT_OK or takes real action.3
Read the repository template directory
Read the
SOUL.md, AGENTS.md, and MEMORY.md templates under docs/reference/templates/ directly. Compare them against the versions generated by your local bootstrap. That diff is the “defaults vs your customization” boundary.Common pitfalls
- Writing
SOUL.mdlike a corporate manual: a wall of rules raises token cost while reducing compliance (an overly long high-priority layer gets ignored or diluted by the model). Short, behaviorally effective instructions work; keep it under one A4 page. - Packing detailed logs into
MEMORY.md:MEMORY.mdis a distillation layer, not a log. Detailed records belong inmemory/YYYY-MM-DD.md. FillingMEMORY.mdwith logs triggers bootstrap truncation and causes important information to be lost. - Forgetting to delete
BOOTSTRAP.md: if the ritual is completed but the file is not deleted, every startup re-runs the first-time setup (the agent treats the presence ofBOOTSTRAP.mdas “first run”). - Main session default full-host permissions: see the Warning in Section 3. Confusing “group / stranger channels” with “main session” is the most common exposure point in OpenClaw; a successful prompt injection gives the agent full host permissions to execute arbitrary commands.
- Treating plugins as “more is better”: each additional OpenClaw skill injects more context into every session, increasing token cost. Install only what you will actually use and audit regularly.
Self-check
The bar for passing this unit
- Without looking at the documentation, can you state the difference between
SOUL.md,IDENTITY.md, andMEMORY.md, and when each one is loaded? - Can you explain the division of responsibilities between heartbeat and cron jobs, and why a heartbeat turn does not create background task records?
- Can you explain to a colleague in one sentence “what OpenClaw hides in the workspace md files”?
- In your current agent configuration — whether Claude Code, Codex, Cursor, or anything else — is there any operational procedure that lives “scattered in a system prompt string, not version-controllable”? Could that piece also be made visible as a md file?
Sources and further reading
Factual claims are grounded in official documentation; fast-changing items are annotated as of 2026-05.- [1] OpenClaw Repository, GitHub. https://github.com/openclaw/openclaw (as of 2026-05)
- [2] OpenClaw, “Agent Workspace Concepts,” openclaw/openclaw, docs/concepts/agent-workspace.md. https://github.com/openclaw/openclaw/blob/main/docs/concepts/agent-workspace.md (as of 2026-05)
- [3] OpenClaw, “SOUL.md Persona Guide,” openclaw/openclaw, docs/concepts/soul.md. https://github.com/openclaw/openclaw/blob/main/docs/concepts/soul.md (as of 2026-05)
- [4] OpenClaw, “Heartbeat,” openclaw/openclaw, docs/gateway/heartbeat.md. https://github.com/openclaw/openclaw/blob/main/docs/gateway/heartbeat.md (as of 2026-05)
- [5] OpenClaw, “Memory,” openclaw/openclaw, docs/concepts/memory.md. https://github.com/openclaw/openclaw/blob/main/docs/concepts/memory.md (as of 2026-05)
- [6] OpenClaw, “Workspace Templates,” openclaw/openclaw, docs/reference/templates/. https://github.com/openclaw/openclaw/tree/main/docs/reference/templates (as of 2026-05)
- [7] OpenClaw, “Bootstrapping,” openclaw/openclaw, docs/start/bootstrapping.md. https://github.com/openclaw/openclaw/blob/main/docs/start/bootstrapping.md (as of 2026-05)
- [8] P. Steinberger, “VISION.md,” openclaw/openclaw. https://github.com/openclaw/openclaw/blob/main/VISION.md (as of 2026-05)
- Minimalist counterpart: 05-2 Hermes-Agent (Nous Research’s Python counterpart, using a three-layer system prompt assembly)
- Hardened shell counterpart: 05-3 NemoClaw (open-sourced by NVIDIA in 2026-03, wrapping OpenClaw in an OpenShell sandbox for enterprise readiness)
- Comparison: 05-4 Three-Approaches Comparison
- Prerequisite: 01-6 Harness Engineering (the conceptual foundation for this case study)