How to Set Up Self-Learning Skills in OpenClaw
Purpose
Traditional AI agents require manual skill creation. I wanted OpenClaw to learn from my sessions automatically. This post shows how I set up self-learning with score-based feedback.
Environment
- OpenClaw (stable release)
- macOS 14
- Python automation workflows
The Problem
Manual skill creation takes effort:
- Writing detailed instructions from scratch
- Knowledge loss when patterns aren captured
- Maintenance overhead without auto-updates
- Rewriting similar workflows repeatedly
I wanted OpenClaw to observe my work and generate skills automatically.
Step 1: Enable Observation Hooks
Hooks capture 100% of interactions. Without them, only 50-80% of patterns get detected.
{ "hooks": { "PreToolUse": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "~/.openclaw/hooks/observe.sh pre" }] }], "PostToolUse": [{ "matcher": "*", "hooks": [{ "type": "command", "command": "~/.openclaw/hooks/observe.sh post" }] }] }}Step 2: Initialize Learning Directory
Create directories for learned behaviors:
mkdir -p ~/.openclaw/learned/{skills,patterns,feedback}touch ~/.openclaw/observations.jsonlStep 3: Configure Cron System
OpenClaw’s cron system reliably fires subagents. I set reasonable intervals:
{ "cron": { "enabled": true, "schedule": { "pattern_detection": "*/15 * * * *", "skill_generation": "0 * * * *", "feedback_request": "*/30 * * * *" }, "subagents": { "observer": { "model": "lightweight", "task": "detect_patterns" }, "skill_creator": { "model": "standard", "task": "generate_skill" } } }}Pattern detection runs every 15 minutes. Skill generation runs hourly.
Step 4: Implement Score-Based Feedback
OpenClaw asks me to rate generated skills. I use a 1-10 scale:
---name: feedback-requesttrigger: "after skill generation"---
When generating a new skill, ask the user:
"I've identified a pattern and created a skill: [skill_name].How would you rate its usefulness? (1-10 scale)
1-3: Not useful, discard4-6: Moderately useful, needs refinement7-9: Very useful, approve10: Essential behavior
Please provide your score and any corrections."This prevents the self-evaluation bias problem I saw in Hermes.
Step 5: Configure Learning Thresholds
Set thresholds for automatic decisions:
{ "learning": { "min_observation_count": 3, "auto_approve_threshold": 7.5, "discard_threshold": 3.0, "confidence_decay_rate": 0.05 }}- Skills need 3+ observations before generation
- Scores above 7.5 auto-approve
- Scores below 3.0 auto-discard
- Confidence decays if skills aren used
Step 6: Test the Workflow
I tested with PDF rotation:
- I performed: “Rotate this PDF by 90 degrees”
- Hooks captured the workflow
- Cron triggered pattern detection
- Subagent identified the pattern
- Skill generator created markdown file
- System asked: “Rate 1-10?”
- I rated: “8/10, add error handling”
- System refined the skill
- Saved to
~/.openclaw/learned/skills/
The generated skill:
---name: pdf-rotationdescription: Rotate PDF files with error handlingconfidence: 0.8source: "pattern-observation"generated: "2026-04-07T10:30:00Z"feedback_score: 8---
# PDF Rotation Skill
## Workflow
1. Validate PDF file exists2. Check rotation degrees (90, 180, 270)3. Apply rotation using pdfplumber4. Save rotated file5. Verify output
## Error Handling
If rotation fails:- Check file permissions- Verify PDF integrity- Report specific error to user
## Notes
Added error handling based on user feedback (score: 8/10)Step 7: Monitor Learned Skills
Check what OpenClaw has learned:
# List all learned skillsls ~/.openclaw/learned/skills/
# Check a specific skillcat ~/.openclaw/learned/skills/pdf-rotation.mdThe system continues asking for feedback as it refines skills.
Common Mistakes
Mistake 1: Skipping Observation Hooks
Hooks must be enabled for full detection. Without them, patterns are missed.
Mistake 2: Not Providing Feedback
Skills stagnate without user input. The system needs my ratings to improve.
Mistake 3: Unrealistic Cron Schedules
Too frequent: overwhelms the system Too infrequent: patterns are missed
Use 15-60 minute intervals for pattern detection.
Mistake 4: Ignoring Thresholds
Auto-approving all skills creates noise. Discarding too aggressively wastes patterns.
Calibrate thresholds based on feedback history.
Mistake 5: Not Reviewing Skills
Generated skills might have errors. Periodically review the learned directory.
Summary
In this post, I showed how to set up self-learning skills in OpenClaw. The key point is combining observation hooks for pattern capture, cron-triggered subagents for processing, and score-based feedback for quality control. This creates controlled learning without the self-evaluation bias I saw in Hermes.
Final Words + More Resources
My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me
Here are also the most important links from this article along with some further resources that will help you in this scope:
Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!
Comments