If you've been using OpenClaw and your agent still feels like a generic chatbot, chances are your SOUL.md is either missing, half-baked, or doing more harm than good. This guide will fix that.
SOUL.md is the single most important file in your OpenClaw workspace. It defines who your agent is — its personality, expertise, communication style, decision-making framework, and boundaries. Think of it as the DNA of your AI agent.
I've spent months refining SOUL.md configurations across dozens of use cases, and I'm going to share everything I've learned.
What Is SOUL.md, Exactly?
When OpenClaw boots up an agent session, one of the first things it does is read SOUL.md from your workspace. This file gets injected into the agent's context, shaping every response it generates.
Without a SOUL.md, your agent defaults to generic behavior. With a well-crafted one, it becomes a specialized tool that understands your domain, speaks your language, and makes decisions aligned with your goals.
Here's the minimal structure:
# SOUL.md
## Identity
You are [Agent Name], a [role description].
## Personality
- Communication style
- Tone preferences
- Behavioral traits
## Expertise
- Domain knowledge areas
- Tools and technologies
## Rules
- Hard boundaries
- Decision-making guidelines
But a minimal structure gets you minimal results. Let's go deeper.
The Five Pillars of an Effective SOUL.md
1. Identity — Who Is Your Agent?
This isn't just a name. It's a complete professional identity. The more specific you are, the more consistent your agent's behavior becomes.
Weak:
You are a helpful assistant.
Strong:
You are Marcus, a senior DevOps engineer with 12 years of experience
in cloud infrastructure. You specialize in AWS, Kubernetes, and
CI/CD pipelines. You've seen every deployment disaster imaginable
and you approach problems with calm pragmatism.
The difference is night and day. The second version gives the agent a mental model to work from. It knows how to think about problems, not just that it should be "helpful."
2. Communication Style — How Does It Talk?
This is where most people stop at "be concise" or "be friendly." You need to be more intentional.
Consider these dimensions:
- Formality level: Casual peer? Professional consultant? Academic researcher?
- Response length preference: Terse one-liners? Detailed explanations? Adaptive based on question complexity?
- Technical depth: Assume expertise? Explain from basics? Match the user's level?
- Proactive vs. reactive: Should it volunteer information? Or only answer what's asked?
## Communication Style
- Default to concise, actionable responses
- Use code examples over lengthy explanations
- When the user asks "why," go deep — explain the reasoning
- Never use corporate jargon or filler phrases
- If something is risky, say so directly — don't hedge
- Match the user's energy: casual question → casual answer
3. Domain Knowledge — What Does It Know?
This is where you encode the specialized knowledge that makes your agent actually useful. Don't just list topics — provide context, preferences, and opinions.
## Domain Knowledge
- Primary stack: Python, FastAPI, PostgreSQL, Redis
- Deployment: Always containerized, always on AWS ECS
- Testing philosophy: Integration tests > unit tests for APIs
- Code style: Follow Google Python Style Guide
- When choosing between libraries, prefer well-maintained
ones with >1000 GitHub stars over cutting-edge alternatives
- Database: Always use migrations (Alembic). Never modify
schemas directly.
This kind of specificity prevents your agent from suggesting solutions that don't fit your environment.
4. Decision Framework — How Does It Choose?
When your agent faces ambiguity (and it will), what principles should guide its decisions?
## Decision Framework
- Security > convenience, always
- Prefer boring technology over shiny new tools
- If a task takes >30 minutes of agent time, suggest
breaking it into subtasks
- When unsure between two approaches, pick the one
that's easier to reverse
- Don't optimize prematurely — make it work first
This section is criminally underused. Most SOUL.md files skip it entirely, and then people wonder why their agent makes weird choices.
5. Boundaries and Safety — What Should It Never Do?
Every agent needs guardrails. Be explicit about what's off-limits.
## Boundaries
- Never execute destructive commands (rm -rf, DROP TABLE)
without explicit confirmation
- Don't access or modify files outside the project directory
- Never commit directly to main/master branch
- If a request seems to involve PII or credentials,
flag it and ask for confirmation
- Don't make assumptions about production environments —
always ask first
Advanced Techniques
Context Layering
Your SOUL.md doesn't have to work alone. The best setups use a layered approach:
-
SOUL.md— Core identity and personality (rarely changes) -
USER.md— Information about the human you're working with -
MEMORY.md— Long-term context and learned preferences -
memory/YYYY-MM-DD.md— Daily session notes
This separation keeps your SOUL.md clean and focused while allowing the agent to accumulate knowledge over time.
Dynamic Behavior Blocks
You can include conditional instructions that activate based on context:
## Mode: Code Review
When reviewing code:
- Check for security vulnerabilities first
- Then correctness, then style
- Be direct about issues — don't sugarcoat
- Always suggest a fix, not just point out problems
## Mode: Brainstorming
When brainstorming:
- Generate quantity over quality initially
- Don't self-censor ideas
- Build on previous suggestions
- Ask clarifying questions to narrow scope
Tool-Specific Instructions
If your agent uses specific tools, encode your preferences:
## Tool Preferences
- Git: Always use conventional commits format
- Search: Prefer official documentation over Stack Overflow
- File operations: Create backups before bulk edits
- Browser: Use for verification, not primary research
Real-World SOUL.md Templates
Here's a complete example for a full-stack development agent:
# SOUL.md — Atlas
## Identity
You are Atlas, a senior full-stack engineer. You've shipped
products at startups and enterprises. You value clean architecture
but know when to cut corners for speed.
## Style
- Direct and practical
- Code-first explanations
- Admit uncertainty — say "I'm not sure" when appropriate
- Use humor sparingly but naturally
## Stack
- Frontend: React, TypeScript, Tailwind
- Backend: Node.js, Express, PostgreSQL
- Infrastructure: Docker, AWS, GitHub Actions
- Testing: Vitest, Playwright
## Principles
- Type safety everywhere
- API-first design
- Progressive enhancement
- Accessibility is not optional
## Rules
- Never skip error handling
- Always validate inputs at API boundaries
- Use environment variables for all configuration
- Write tests for business logic, not implementation details
Common Pitfalls to Avoid
- Being too vague — "Be helpful and smart" tells the agent nothing
- Being too rigid — Don't micromanage every response format
- Contradicting yourself — If you say "be concise" but also "always explain in detail," the agent will be confused
- Ignoring the context window — A 5000-word SOUL.md eats into your available context. Keep it under 1500 words
- Never updating it — Your needs evolve. Your SOUL.md should too
Getting Started
If you're starting from scratch, here's my recommendation:
- Start simple — Write a 200-word SOUL.md covering identity, style, and basic rules
- Use it for a week — Note where the agent's behavior doesn't match your expectations
- Iterate — Add specificity where it's needed, remove what's not working
- Layer in context — Add USER.md and MEMORY.md as your workflow matures
The difference between a generic agent and one with a well-crafted SOUL.md is like the difference between hiring a random freelancer and working with someone who's been on your team for years. The investment in writing a good SOUL.md pays for itself within the first session.
Resources
If you want to skip the trial-and-error phase, I've put together some ready-to-use templates:
Free SOUL.md Starter Pack — 5 battle-tested templates covering the most common use cases (developer, writer, researcher, ops, and general assistant). Great starting point if you're new to OpenClaw.
SOUL.md 20 Templates Pack — 20 specialized templates for specific roles and workflows. Includes templates for code review agents, content creation, data analysis, project management, and more. Each one has been refined through real-world usage.
SOUL.md Mega Pack — 100 Templates — The complete collection. 100 templates covering every use case I've encountered, plus a guide on customization and advanced techniques. If you're serious about getting the most out of OpenClaw, this is the fastest path.
Every template follows the five-pillar structure outlined in this guide and is ready to drop into your workspace.
Recommended Tools
Building with OpenClaw? I'd love to hear how you're using SOUL.md — drop a comment below or find me on the OpenClaw community.
Top comments (0)