2026-01-08 02:20:18 +01:00
---
2026-01-30 03:15:10 +01:00
summary: "What the OpenClaw system prompt contains and how it is assembled"
2026-01-08 02:20:18 +01:00
read_when:
- Editing system prompt text, tools list, or time/heartbeat sections
- Changing workspace bootstrap or skills injection behavior
2026-01-31 16:04:03 -05:00
title: "System Prompt"
2026-01-08 02:20:18 +01:00
---
2026-01-31 21:13:13 +09:00
2026-01-08 02:20:18 +01:00
# System Prompt
2026-02-14 23:20:46 +08:00
OpenClaw builds a custom system prompt for every agent run. The prompt is **OpenClaw-owned** and does not use the pi-coding-agent default prompt.
2026-01-08 02:20:18 +01:00
2026-01-30 03:15:10 +01:00
The prompt is assembled by OpenClaw and injected into each agent run.
2026-01-08 02:20:18 +01:00
## Structure
The prompt is intentionally compact and uses fixed sections:
- **Tooling**: current tool list + short descriptions.
2026-01-31 15:50:15 +01:00
- **Safety**: short guardrail reminder to avoid power-seeking behavior or bypassing oversight.
2026-01-09 21:27:11 +01:00
- **Skills** (when available): tells the model how to load skill instructions on demand.
2026-01-30 03:15:10 +01:00
- **OpenClaw Self-Update**: how to run `config.apply` and `update.run` .
2026-01-09 12:44:23 +00:00
- **Workspace**: working directory (`agents.defaults.workspace` ).
2026-01-30 03:15:10 +01:00
- **Documentation**: local path to OpenClaw docs (repo or npm package) and when to read them.
2026-01-08 02:20:18 +01:00
- **Workspace Files (injected)**: indicates bootstrap files are included below.
2026-01-12 02:49:55 +00:00
- **Sandbox** (when enabled): indicates sandboxed runtime, sandbox paths, and whether elevated exec is available.
2026-01-15 22:26:31 +00:00
- **Current Date & Time**: user-local time, timezone, and time format.
2026-01-08 02:20:18 +01:00
- **Reply Tags**: optional reply tag syntax for supported providers.
- **Heartbeats**: heartbeat prompt and ack behavior.
2026-01-22 05:07:40 +00:00
- **Runtime**: host, OS, node, model, repo root (when detected), thinking level (one line).
2026-01-10 22:24:13 +01:00
- **Reasoning**: current visibility level + /reasoning toggle hint.
2026-01-08 02:20:18 +01:00
2026-01-31 15:50:15 +01:00
Safety guardrails in the system prompt are advisory. They guide model behavior but do not enforce policy. Use tool policy, exec approvals, sandboxing, and channel allowlists for hard enforcement; operators can disable these by design.
2026-01-16 00:28:43 +00:00
## Prompt modes
2026-01-30 03:15:10 +01:00
OpenClaw can render smaller system prompts for sub-agents. The runtime sets a
2026-01-16 00:28:43 +00:00
`promptMode` for each run (not a user-facing config):
- `full` (default): includes all sections above.
2026-01-30 03:15:10 +01:00
- `minimal` : used for sub-agents; omits **Skills** , **Memory Recall** , **OpenClaw
2026-01-16 00:28:43 +00:00
Self-Update**, **Model Aliases** , **User Identity** , **Reply Tags** ,
2026-01-31 15:50:15 +01:00
**Messaging** , **Silent Replies** , and **Heartbeats** . Tooling, **Safety** ,
Workspace, Sandbox, Current Date & Time (when known), Runtime, and injected
context stay available.
2026-01-16 00:28:43 +00:00
- `none` : returns only the base identity line.
When `promptMode=minimal` , extra injected prompts are labeled **Subagent
Context** instead of **Group Chat Context** .
2026-01-08 02:20:18 +01:00
## Workspace bootstrap injection
Bootstrap files are trimmed and appended under **Project Context** so the model sees identity and profile context without needing explicit reads:
- `AGENTS.md`
- `SOUL.md`
- `TOOLS.md`
- `IDENTITY.md`
- `USER.md`
- `HEARTBEAT.md`
- `BOOTSTRAP.md` (only on brand-new workspaces)
2026-02-10 20:06:23 +05:00
- `MEMORY.md` and/or `memory.md` (when present in the workspace; either or both may be injected)
All of these files are **injected into the context window** on every turn, which
means they consume tokens. Keep them concise — especially `MEMORY.md` , which can
grow over time and lead to unexpectedly high context usage and more frequent
compaction.
> **Note:** `memory/*.md` daily files are **not** injected automatically. They
> are accessed on demand via the `memory_search` and `memory_get` tools, so they
> do not count against the context window unless the model explicitly reads them.
2026-01-08 02:20:18 +01:00
2026-01-13 04:24:17 +00:00
Large files are truncated with a marker. The max per-file size is controlled by
2026-02-14 18:36:35 -05:00
`agents.defaults.bootstrapMaxChars` (default: 20000). Total injected bootstrap
content across files is capped by `agents.defaults.bootstrapTotalMaxChars`
2026-02-16 12:04:53 -05:00
(default: 150000). Missing files inject a short missing-file marker.
2026-01-08 02:20:18 +01:00
2026-02-10 20:06:23 +05:00
Sub-agent sessions only inject `AGENTS.md` and `TOOLS.md` (other bootstrap files
are filtered out to keep the sub-agent context small).
2026-01-18 05:24:47 +00:00
Internal hooks can intercept this step via `agent:bootstrap` to mutate or replace
the injected bootstrap files (for example swapping `SOUL.md` for an alternate persona).
2026-01-15 01:09:21 +00:00
To inspect how much each injected file contributes (raw vs injected, truncation, plus tool schema overhead), use `/context list` or `/context detail` . See [Context ](/concepts/context ).
2026-01-08 02:20:18 +01:00
## Time handling
2026-01-24 06:22:54 +00:00
The system prompt includes a dedicated **Current Date & Time** section when the
user timezone is known. To keep the prompt cache-stable, it now only includes
the **time zone** (no dynamic clock or time format).
2026-01-08 02:20:18 +01:00
2026-01-24 06:22:54 +00:00
Use `session_status` when the agent needs the current time; the status card
includes a timestamp line.
2026-01-08 02:20:18 +01:00
2026-01-15 22:26:31 +00:00
Configure with:
- `agents.defaults.userTimezone`
- `agents.defaults.timeFormat` (`auto` | `12` | `24` )
See [Date & Time ](/date-time ) for full behavior details.
2026-01-08 02:20:18 +01:00
## Skills
2026-01-30 03:15:10 +01:00
When eligible skills exist, OpenClaw injects a compact **available skills list**
2026-01-09 21:20:38 +01:00
(`formatSkillsForPrompt` ) that includes the **file path** for each skill. The
prompt instructs the model to use `read` to load the SKILL.md at the listed
2026-01-09 21:27:11 +01:00
location (workspace, managed, or bundled). If no skills are eligible, the
Skills section is omitted.
2026-01-08 02:20:18 +01:00
```
2026-01-09 21:20:38 +01:00
< available_skills >
< skill >
< name > ...< / name >
< description > ...< / description >
< location > ...< / location >
< / skill >
< / available_skills >
2026-01-08 02:20:18 +01:00
```
This keeps the base prompt small while still enabling targeted skill usage.
2026-01-18 15:00:14 +00:00
## Documentation
When available, the system prompt includes a **Documentation** section that points to the
2026-01-30 03:15:10 +01:00
local OpenClaw docs directory (either `docs/` in the repo workspace or the bundled npm
2026-01-18 15:00:14 +00:00
package docs) and also notes the public mirror, source repo, community Discord, and
2026-02-06 10:08:59 -05:00
ClawHub ([https://clawhub.com ](https://clawhub.com )) for skills discovery. The prompt instructs the model to consult local docs first
2026-01-30 03:15:10 +01:00
for OpenClaw behavior, commands, configuration, or architecture, and to run
`openclaw status` itself when possible (asking the user only when it lacks access).