How to Write a soul.md for OpenClaw?
soul.md is the most powerful customization tool in OpenClaw. It defines your agent's personality, knowledge, behavior rules, and restrictions. Think of it as the agent's DNA.
The file lives at ~/.openclaw/soul.md (or in a workspace directory). It's written in Markdown and loaded into the system prompt with every request to the AI model.
A good soul.md typically includes: - Identity: Who the agent is (name, role, tone) - Knowledge: Domain expertise, company info, product details - Rules: What the agent should and shouldn't do - Communication style: Formal/casual, verbose/concise, language - Restrictions: Forbidden topics, actions, or responses
Keep it concise — every word counts against your token budget. A 500-1000 word soul.md is typical. Avoid redundancy with information the model already knows.
Test your soul.md by chatting with the agent and checking if it follows your instructions. Iterate: add rules when the agent does something unexpected, remove rules that seem unnecessary.
The soul.md is version-controlled by OpenClaw. You can revert to previous versions if a change makes things worse.
Tip: Start minimal — just name, role, and 3-5 key rules. Add specifics only when the default behavior isn't what you want.
# My AI Assistant You are Alex, a helpful AI assistant. ## Personality - Friendly but professional - Concise — avoid unnecessary words - Use plain English, no jargon ## Rules - Never share personal data from conversations - Always cite sources when presenting facts - If unsure, say so — don't make things up ## Expertise - Project management - Technical writing - Web development