Skip to content

How to Set Up Self-Learning Skills in OpenClaw

Feedback Loop Improvement

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.

Enable hooks configuration
{
"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:

Create directory structure
mkdir -p ~/.openclaw/learned/{skills,patterns,feedback}
touch ~/.openclaw/observations.jsonl

Step 3: Configure Cron System

OpenClaw’s cron system reliably fires subagents. I set reasonable intervals:

Cron configuration
{
"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:

Feedback skill template
---
name: feedback-request
trigger: "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, discard
4-6: Moderately useful, needs refinement
7-9: Very useful, approve
10: 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:

Threshold configuration
{
"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:

  1. I performed: “Rotate this PDF by 90 degrees”
  2. Hooks captured the workflow
  3. Cron triggered pattern detection
  4. Subagent identified the pattern
  5. Skill generator created markdown file
  6. System asked: “Rate 1-10?”
  7. I rated: “8/10, add error handling”
  8. System refined the skill
  9. Saved to ~/.openclaw/learned/skills/

The generated skill:

Generated skill example
---
name: pdf-rotation
description: Rotate PDF files with error handling
confidence: 0.8
source: "pattern-observation"
generated: "2026-04-07T10:30:00Z"
feedback_score: 8
---
# PDF Rotation Skill
## Workflow
1. Validate PDF file exists
2. Check rotation degrees (90, 180, 270)
3. Apply rotation using pdfplumber
4. Save rotated file
5. 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 learned skills
# List all learned skills
ls ~/.openclaw/learned/skills/
# Check a specific skill
cat ~/.openclaw/learned/skills/pdf-rotation.md

The 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