Tutorial
Prompt Mastery: The quality of OpenClaw's responses depends heavily on how you phrase your requests. Learn professional prompting techniques.
What Makes a Prompt Actually Work
Good prompts for OpenClaw usually have four things going for them:
- Context: What are you actually working on?
- The task: What do you need it to do?
- Constraints: Any limitations or weird requirements?
- Format: How should the response look?
Lead With Context
Don't make the AI guess. Tell it what you're doing upfront:
"I'm working on a React Native app for iOS. The back button breaks after deep linking and I can't figure out why."Ask It to Think Through Steps
Chain-of-thought prompting sounds fancy but it's just asking the model to show its work:
"Walk through this step by step. First analyze the problem, then identify causes, then give me solutions with code."Give It an Example
Show, don't just tell. Paste something that works and ask it to follow the same pattern:
"Here's a function pattern I like: [example]. Apply the same approach to: [new scenario]."Tell It How to Format the Output
You get better results when you specify the structure upfront:
"Format this way: 1) Issue 2) Root Cause 3) Fix 4) How to prevent it later"Don't Accept the First Draft
The first response is rarely perfect. Push back until it gets where you need it to go:
"That's close, but the error handling could be more solid."Customize the System Prompt
You can set a permanent personality for OpenClaw to follow:
openclaw config set personality.system_prompt="You're a senior software engineer. Prioritize security, performance, and maintainability."Prompt Patterns That Work
- Code review: "Look for security issues, performance problems, and style problems"
- Documentation: "Write JSDoc comments with parameter descriptions for each function"
- Debugging: "Explain why this error happens and how to stop it from happening again"
- Refactoring: "Make this more readable but don't change what it does"
Temperature and Thinking Settings
You can tune how OpenClaw responds. Temperature controls randomness (higher = more creative), thinking controls depth:
openclaw config set model.temperature=0.7 # Higher = more creative
openclaw config set model.thinking="high" # Deeper reasoning