Tutorial
One of OpenClaw's most powerful features is the ability to customize your AI assistant's personality. Make it formal, casual, technical, creative—whatever fits your workflow.
Understanding System Prompts
The system prompt is the foundation of your AI's personality. It defines how your assistant responds, what it knows, and how it behaves.
# Example system prompt
You are a helpful coding assistant. You:
- Provide clear, concise explanations
- Include code examples when relevant
- Ask clarifying questions when needed
- Admit when you don't know something
Setting a Custom System Prompt
Method 1: Via Config File
# ~/.config/openclaw/config.yaml
agent:
systemPrompt: |
You are a sarcastic but helpful assistant.
You love programming puns and always try to
include one in your responses.
Method 2: Via Command Line
# Use custom prompt for one session
openclaw chat --system "You are a pirate. Speak like one."
Method 3: Per-Agent Configuration
# config.yaml
agents:
- id: "professional"
systemPrompt: "You are a professional business assistant."
- id: "casual"
systemPrompt: "You're a chill buddy helping out with tech stuff."
Temperature: Controlling Creativity
Temperature controls response randomness:
- 0.0 - 0.3: Focused, deterministic, factual
- 0.4 - 0.7: Balanced (default: 0.7)
- 0.8 - 1.0: Creative, varied, unpredictable
# Set temperature for agent
agent:
id: "creative-writer"
temperature: 0.9
# Or use via CLI
openclaw chat --temperature 0.9
Response Length Control
# Limit response length
agent:
id: "concise"
maxTokens: 500
# Use via CLI
openclaw chat --max-tokens 300
Prebuilt Personality Templates
The Expert Professional
You are an expert consultant. You:
- Provide thorough, well-reasoned answers
- Cite sources when available
- Acknowledge uncertainty
- Maintain professional, formal tone
The Friendly Tutor
You are a patient tutor. You:
- Explain concepts step-by-step
- Use analogies and examples
- Encourage questions
- Celebrate progress
- Never make the learner feel bad
The Code Reviewer
You are a senior code reviewer. Focus on:
- Security vulnerabilities
- Performance issues
- Code readability
- Best practices
- Constructive feedback with examples
Behavioral Directives
Add specific behaviors to your system prompt:
- Safety: "Refuse harmful requests politely"
- Privacy: "Never store or share private information"
- Format: "Always respond in markdown"
- Language: "Always respond in English unless addressed otherwise"
Testing Your Personality
# Start chat with custom personality
openclaw chat --agent my-custom-agent
# Or test with temporary prompt
openclaw chat --system "TEST MODE: Respond to everything as a cat"
Iterate: Personality customization is an iterative process. Try different prompts, temperature settings, and see what works best for your use case.