Skip to content
Guides

OpenClaw context

What the model actually receives each run, the system prompt and injected workspace files with their caps, why tool schemas cost more than the tool list, and the commands that inspect the window before it fills

7 min read

Context is not memory. Memory lives on disk and can be reloaded; context is what sits inside the model's window right now, and it is bounded. Knowing what is in there is the difference between an agent that forgets for a reason you understand and one that mystifies you. Here is what OpenClaw puts in the window, what it costs, and how to look.

What is in the window

  • The system prompt is rebuilt every run and carries the tool list with short descriptions, the skills list as metadata only, the workspace location, the time in coordinated universal time plus a converted local time when configured, runtime metadata such as host, operating system, model and thinking level, and the injected workspace files under a project context section.
  • Beyond the prompt, the window holds the conversation history for this session, every tool call and tool result, attachments such as images, audio and files, compaction summaries and pruning artefacts, and provider wrappers or hidden headers that never appear but still count.
  • By default OpenClaw injects a fixed set of workspace files when present, the agent instructions, a personality file, an identity file, a user file and a first-run bootstrap file; each is truncated with a per-file character cap that defaults to twenty thousand and a total cap that defaults to sixty thousand, and when truncation happens the prompt carries a concise built-in notice while the per-file names and sizes stay in diagnostics.
  • Tools cost twice: once as the tool list text in the system prompt, and once as the tool schemas in structured form, which are sent so the model can call them and count toward the window even though you never see them as plain text; the detailed inspection command breaks down the largest schemas so you can see what dominates.
Context is everything OpenClaw sends to the model for a run.

Looking inside

A status command gives the quick reading of how full the window is along with session settings. A list command shows what is injected with rough sizes per file and in total. A detailed view goes further: per file, per tool schema, per skill entry, the system prompt size, and how many transcript messages are actually compactable. A map command renders a treemap image of the tracked contributors, where rectangle area is proportional to tracked prompt characters and the conversation group grows turn over turn until compaction collapses it into a summaries tile; before a normal message has produced a run report, that map reports itself unavailable rather than rendering an estimate. The inspection prefers the system prompt captured from the last tool-capable run and falls back to an on-the-fly estimate, and either way it reports sizes and top contributors rather than dumping the prompt or the schemas.

Skills, commands and what persists

  • The skills list in the prompt is metadata only, name, description and location, and it has real overhead; skill instructions are not included by default because the model is expected to read the instruction file only when it needs it.
  • Slash commands behave in three ways: a message that is only a command runs as a command, a set of directives is stripped before the model sees the message and persists session settings when sent alone, and allowlisted senders can trigger inline shortcuts inside a normal message that run immediately and are stripped from what the model reads.
  • Persistence differs by mechanism: normal history stays in the session transcript until policy compacts or prunes it, compaction persists a summary into the transcript while keeping recent messages, and pruning drops old tool results from the in-memory prompt without rewriting the transcript, so the full history stays inspectable on disk.

OpenClaw compaction is what happens when the window fills and OpenClaw session pruning the lighter trim that delays it.

Reducing the bill

Three levers matter in practice. Keep skill descriptions short, because the list is always in the prompt while the instructions are not. Watch the tool schemas, since a single browser or shell schema can outweigh every workspace file you inject. Keep the injected files purposeful, because the caps truncate rather than refuse, and a truncated instruction file is worse than a short one. The meter in the control interface uses the last run's prompt budget while it still matches the selected model and cap, and after a model change it shows the plain context window until a new run supplies a matching estimate, so a stale number is an estimate rather than a warning. OpenClaw skills explains the catalog cost and OpenClaw context engines the layer that assembles all of this.

On Diali

On Diali the workspace files that become project context are generated from the dashboard and replaced at each release, so what the model sees is reproducible rather than hand-edited on a server. Hosted OpenClaw on Diali describes the hosted assistant and Diali pricing the plans it ships in.

  • The system prompt is rebuilt every run and is not free.
  • Tool schemas count even though you never see them.
  • Skill instructions are read on demand, not injected.
Get started

Stop reading about it, build one

Set up an agent, pick a channel, and have it working inside the app you already keep open.