self-improving-agent
Captures learnings, errors, and corrections from every session to enable continuous self-improvement for your AI coding agent.
by
pskoett
self-improving-agent Overview
self-improving-agent records errors, corrections, missing capabilities, and better approaches in a structured .learnings/ folder.
It turns recurring issues into durable project memory by logging consistently and promoting proven learnings into project instruction files.
How It Works
It activates on command failures, user corrections, missing features, API errors, outdated knowledge, or better approaches.
Events are appended to .learnings/ files with timestamps, category, context, and resolution notes.
Before major tasks, the agent reviews prior learnings to avoid repeating mistakes.
Confirmed learnings are promoted into project memory files like CLAUDE.md or AGENTS.md.
Key Features
Error Logging
Records unexpected command failures, tool errors, and API failures to .learnings/ERRORS.md.
Correction Capture
When a user says "No, that's wrong" or "Actually...", the correction is logged under the correction category.
Feature Request Tracking
Logs missing capabilities to .learnings/FEATURE_REQUESTS.md for later planning.
Knowledge Gap Detection
Identifies outdated or incorrect knowledge and logs it with category knowledge_gap.
Best Practice Discovery
Stores better approaches for recurring tasks under category best_practice.
Markdown-Based Storage
All learnings are stored as human-readable Markdown for easy review and version control.
OpenClaw Integration
Supports OpenClaw workspace injection and inter-session tools for sharing learnings.
Requirements
- No API keys needed.
- No required binaries; works through file read/write operations.
- Compatible with Claude Code, Cursor, Windsurf, and any agent that reads markdown context files.
Use Cases
Persistent Memory Across Sessions
Prevents the agent from repeating the same mistakes session after session.
Team Knowledge Base
Share the .learnings/ folder to accumulate collective agent knowledge.
Debugging Aid
Find the root cause of recurring errors by reviewing structured error logs.
Continuous Improvement Loop
Improve agent behavior over time without manual prompt engineering.
Feature Roadmap Input
Use feature requests to prioritize tooling improvements.
How to Install
npx clawhub@latest install self-improving-agentRun in your terminal, or click the Install button at the top of this page for one-click setup.
FAQ
Where are the learnings stored?
In the .learnings/ directory using LEARNINGS.md, ERRORS.md, and FEATURE_REQUESTS.md.
Does this skill require any API keys or external services?
No. It runs locally and only writes to markdown files.
How do learnings get promoted to long-term project memory?
Confirmed items are promoted into project instruction files like CLAUDE.md, AGENTS.md, TOOLS.md, or SOUL.md.
Which AI agents are compatible?
Any agent that reads markdown instructions can use it, including Claude Code, Cursor, and Windsurf.
What kinds of events get logged?
Failures, user corrections, missing features, tool/API errors, knowledge gaps, and better approaches.
How should I format entries?
Entries include a timestamp, category, summary, context, and suggested resolution in a consistent template.
Can I enable automatic reminders at session start?
Yes. The skill supports an optional OpenClaw hook for session-start reminders.