How OpenClaw System Prompts Work
It’s annoying when an AI agent loses track of its environment. You expect it to know which tools it has or where its files are, but instead, it acts like it just woke up with amnesia. I’ve spent too much time manually pasting context into chats just to get a model to behave.
OpenClaw handles this by building a custom system prompt for every run. It doesn’t use the default prompts from the underlying model providers. Instead, it assembles a compact, fixed-section prompt that tells the agent exactly what it needs to know about your workspace, its skills, and its safety boundaries.
What You’ll Need
Section titled “What You’ll Need”- OpenClaw installed and running.
- A workspace directory defined in your settings.
- Local documentation files (optional but recommended).
Quick Start
Section titled “Quick Start”You can get your agent’s system prompt configured in about five minutes. Here is the path to get it running:
- Set your workspace: Define
agents.defaults.workspaceso the agent knows where to find your files. - Add bootstrap files: Place files like
AGENTS.md,SOUL.md,TOOLS.md, orIDENTITY.mdin your workspace. OpenClaw injects these automatically. - Configure your timezone: Set
agents.defaults.userTimezoneandagents.defaults.timeFormat(12or24) so the agent understands your local context. - Verify the output: Run
/context listor/context detailin the chat to see exactly how much each file contributes to the prompt.
OpenClaw uses different promptMode settings internally. While you don’t configure these directly, it’s helpful to know they exist. The full mode includes everything from tooling to heartbeats. The minimal mode, used for sub-agents, strips away things like skills and memory recall to keep the focus sharp.
How Skills and Docs are Handled
Section titled “How Skills and Docs are Handled”OpenClaw keeps the base prompt small by not loading every skill instruction at once. Instead, it injects a list that looks like this:
<available_skills> <skill> <name>...</name> <description>...</description> <location>...</location> </skill></available_skills>The prompt tells the model to use the read tool to load the specific SKILL.md file only when it needs it.
Also, the prompt points the agent to your local documentation. It instructs the model to check local docs first for architecture or configuration questions before asking you for help. If it needs to check its own status, it is told to run openclaw status.
Troubleshooting
Section titled “Troubleshooting”Files are being truncated
If your bootstrap files (like SOUL.md) are very large, OpenClaw might cut them off. The default limit is 20,000 characters. You can change this by adjusting agents.defaults.bootstrapMaxChars.
The agent doesn’t know the exact current time
To keep the prompt cache-stable, the system prompt only includes your time zone, not a ticking clock. If the agent needs the exact time, it should use session_status, which includes a live timestamp.
Skills are missing from the prompt The Skills section is omitted if no eligible skills are found. Ensure your skills are in the correct workspace, managed, or bundled locations.
If you need more help getting your prompts dialed in, check out the AI Setup Assistant.
What’s Next
Section titled “What’s Next”OpenClaw Expert
Still stuck?
If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.