Lesson 09 — OpenClaw self-improving-agent: Let AI Automatically Log Mistakes and Keep Getting Better (2026)
Goal: Install the self-improving-agent Skill so OpenClaw automatically learns from every error or correction, getting smarter the more you use it.
What Is self-improving-agent?
Ordinary AI starts every conversation with a blank slate — you correct a mistake today, and it makes the same mistake tomorrow.
self-improving-agent solves exactly this problem. It listens in the background for three types of events:
| Trigger | Example |
|---|---|
| A command or action unexpectedly fails | Script execution error, API call failure |
| User actively corrects AI | "No, you should use pnpm, not npm" |
| User confirms something worked | "Yes, that's the right command — remember it" |
Each time one of these is triggered, the Skill automatically writes the "lesson learned" to a local file. On the next conversation, it injects that knowledge into the context, letting AI proactively avoid known pitfalls.
This is ClawHub's #1 most downloaded Skill (323k downloads). The core reason: it transforms AI from a "tool" into an "assistant that keeps getting to know you."
Step 1: Install self-improving-agent
In WebChat or Telegram, send:
/install @pskoett/self-improving-agent
After successful installation, you'll see a confirmation message. Verify:
pnpm openclaw skills list
# self-improving-agent should appear in the listStep 2: Understand Where Learning Files Are Stored
After the Skill is installed, it creates a learnings file in your workspace:
~/.openclaw/workspace/skills/self-improving-agent/
├── SKILL.md ← Skill main logic (don't modify manually)
└── learnings.md ← Experience library written by AI (you can view and edit this)
learnings.md is plain text — you can open it anytime to see what AI has learned, and you can manually delete any inaccurate entries.
Step 3: Three Ways to Trigger Automatic Learning
Method 1: Tell AI to Remember a Correct Approach
Just tell it directly:
Remember: in this project, start the dev server with pnpm dev, not npm run dev.
The Skill automatically writes to learnings.md:
## Project Start Command
- Use `pnpm dev` to start the dev server (not npm run dev)
- Recorded: 2026-03-30Method 2: Auto-Capture After a Failed Operation
When AI executes a command and it fails, it automatically records the failure reason and solution:
Running pnpm openclaw gateway start failed with error: port 18789 already in use
After AI applies the fix, it automatically learns:
## Gateway Port Conflict
- Error: `port 18789 already in use`
- Solution: First run `lsof -i :18789 | kill -9 <PID>`, then restart the gatewayMethod 3: Correcting AI's Behavior
When AI does something you don't want:
No — when I ask you to summarize, I don't need a list of sources, just the core points.
The Skill captures this correction, and next time AI does a summary it will automatically honor this preference.
Step 4: See What AI Has Learned
cat ~/.openclaw/workspace/skills/self-improving-agent/learnings.mdOr ask AI directly:
List all the experiences and preferences you currently have on record
Step 5: Clean Up Inaccurate Entries
If AI recorded a wrong lesson, open the file and delete that entry:
nano ~/.openclaw/workspace/skills/self-improving-agent/learnings.mdOr tell AI:
Delete your notes about the "start command" — that entry is wrong
Advanced: Combine with Other Skills
self-improving-agent stacks with any other Skill, and learning compounds:
/install @pskoett/self-improving-agent
/install @steipete/github
# Now mistakes AI makes while using the GitHub Skill will also be automatically recorded and learned
Practical examples:
- While using the GitHub Skill, AI once submitted a PR to the wrong branch → you corrected it → next time AI automatically checks the branch
- While using the Obsidian Skill, AI learned your preferred note naming format
- AI gradually adapts to your work style: prefers concise replies, no markdown tables, etc.
FAQ
How does OpenClaw make AI remember previous mistakes?
After installing the self-improving-agent Skill, AI will automatically record in three situations: command execution failure, user active correction, and user confirming that something worked. Learnings are written to the local learnings.md file and automatically injected into context at the start of the next conversation — no manual action needed.
What's the difference between self-improving-agent and a regular Skill?
Regular Skills are "single-injection" — they activate only when you call their slash command. self-improving-agent is "persistent listening" — once installed, it runs in the background throughout every conversation, continuously capturing learning opportunities without needing to be manually triggered.
Does what AI learns get uploaded to the cloud?
No. All learning records are saved locally in ~/.openclaw/workspace/skills/self-improving-agent/learnings.md. OpenClaw is a self-hosted solution — data never leaves your device.
Will a large learnings.md file slow things down?
It can, because the file content is injected into the context of every conversation. We recommend pruning it periodically and keeping only high-frequency learnings (20–30 entries is optimal). You can tell AI "organize learnings.md and remove duplicate or outdated entries."
Will learning records be lost if I uninstall the Skill?
The learnings.md file is not automatically deleted. Uninstalling the Skill only stops listening for new learning events. If you reinstall, historical records will still be active. To clear everything, manually delete the file.