Install
openclaw skills install self-improving-compoundCapture durable lessons from debugging, user corrections, missing capabilities, and repeated workflow friction so future sessions avoid the same mistakes. Hybrid design: actual-self-improvement execution core + self-improving-compound HOT/WARM/COLD memory tiers + legacy promotion/hook guidance. Use immediately when a non-obvious failure is diagnosed, before the final reply after a workaround succeeds, when the user corrects or updates the agent, when a project/tool convention is discovered, when a missing capability is requested, or when a solved issue should be promoted into shared memory. Also use to audit whether a lesson was captured. Do not use for trivial typos, expected failures, straightforward retries, or one-off noise with no reusable lesson.
openclaw skills install self-improving-compoundCapture, review, promote, and extract durable lessons so future sessions avoid repeating the same mistakes.
Use this skill for reusable learning, not for every bump in the road.
Before a final reply, run this quick check:
If yes, search existing learnings first, then log the lesson before replying. Do not rely on a “mental note.”
A good entry usually has at least one of these properties:
Do not log routine noise such as obvious typos, expected validation failures, or errors that were solved immediately with no transferable lesson.
This skill merges three design lineages into one portable package:
| Lineage | Role | What We Kept |
|---|---|---|
| actual-self-improvement | Execution core | Python CLI (scripts/learnings.py), structured logging, JSON evals, search-before-log dedupe |
| self-improving-compound | Memory architecture | HOT/WARM/COLD tiers (memory.md, projects/, domains/, archive/), corrections.md quick table, index.md auto-index |
| self-improving-agent-local | Promotion & hooks | Quantified promotion thresholds, OpenClaw hook guidance, pattern-key recurrence rules |
learning/self-improving/learning/self-improving/
├── memory.md # HOT tier (always loaded)
├── corrections.md # Structured correction log (quick table)
├── index.md # Auto-maintained index + Pattern-Key index
├── projects/ # WARM tier (project-specific)
├── domains/ # WARM tier (domain-specific)
└── archive/ # COLD tier (inactive)
There are two different roots in this skill:
Skill root — where bundled resources live:
scripts/...references/...hooks/...Workspace root — where the project or active workspace lives:
learning/self-improving/memory.mdlearning/self-improving/corrections.mdlearning/self-improving/index.mdlearning/self-improving/projects/learning/self-improving/domains/learning/self-improving/archive/CLAUDE.md, AGENTS.md, .github/copilot-instructions.md, SOUL.md, TOOLS.mdNever write learnings into the installed skill directory. Always target the workspace root.
| Situation | What to do |
|---|---|
| User corrects you or updates a fact | Log a correction |
| Non-obvious command / API / tool failure | Log an error |
| User asks for a missing capability | Log a feature request |
| You discover a reusable workaround or convention | Log a learning |
| A pattern keeps recurring | Search related entries, link with See Also, and consider promotion |
| A lesson is broadly applicable or repeated | Promote it into project memory |
| A resolved, general pattern could help other projects | Extract a new skill |
Before reading or writing learning/self-improving/, determine WORKSPACE_ROOT.
Good defaults:
OPENCLAW_WORKSPACE env var)If unsure, prefer the directory containing .git, AGENTS.md, CLAUDE.md, or the user's active project files.
learning/self-improving/ if neededUse the helper instead of creating files manually:
python3 scripts/learnings.py --root /absolute/path/to/workspace init
This creates:
learning/self-improving/memory.mdlearning/self-improving/corrections.mdlearning/self-improving/index.mdlearning/self-improving/projects/learning/self-improving/domains/learning/self-improving/archive/Review first when:
Use the helper:
python3 scripts/learnings.py --root /absolute/path/to/workspace status
python3 scripts/learnings.py --root /absolute/path/to/workspace search "pnpm" --limit 5
# --root can also be placed after the subcommand
python3 scripts/learnings.py status --root /absolute/path/to/workspace --format json
Always search for related entries before creating a new one.
python3 scripts/learnings.py --root /absolute/path/to/workspace search "keyword or pattern" --limit 10
If a similar entry already exists:
See AlsoPattern-Key for recurring issuesUse for user corrections and updated facts. Written to corrections.md as a quick-scan table row.
python3 scripts/learnings.py --root /absolute/path/to/workspace log-correction \
--summary "Used wrong format for Telegram" \
--correct "Use lists, not tables" \
--pattern telegram-format
Use for corrections, knowledge gaps, best practices, and durable conventions. Written to memory.md.
python3 scripts/learnings.py --root /absolute/path/to/workspace log-learning \
--summary "Project uses pnpm workspaces, not npm" \
--details "Attempted npm install. Lockfile and workspace config showed pnpm." \
--pattern pnpm-workspace
Use for non-obvious failures, exceptions, or tool/API issues worth remembering. Written to memory.md.
python3 scripts/learnings.py --root /absolute/path/to/workspace log-error \
--summary "Docker build failed on Apple Silicon due to platform mismatch" \
--details "docker build -t myapp . on Apple Silicon" \
--pattern docker-platform
Use when the user wants a missing capability or a recurring friction point should become a feature. Written to memory.md.
python3 scripts/learnings.py --root /absolute/path/to/workspace log-feature \
--summary "User needs report export to CSV" \
--details "Needed for sharing weekly reports with non-technical stakeholders" \
--pattern csv-export
The old log subcommand is preserved for compatibility:
python3 scripts/learnings.py --root /absolute/path/to/workspace log "Used wrong format" \
--type COR --pattern telegram-format --correct "Use lists" --force
Promote when the learning is broad, repeated, or something any future contributor should know.
Common targets:
CLAUDE.md — durable project facts and conventionsAGENTS.md — workflow rules and automation guidance.github/copilot-instructions.md — shared Copilot contextSOUL.md — behavioural principles in OpenClaw workspacesTOOLS.md — tool-specific gotchas in OpenClaw workspacesWrite promotions as short prevention rules, not long incident write-ups.
Example:
pnpm install in this repo; it is a pnpm workspace."When a learning is promoted, update the original entry's status to promoted or promoted_to_skill and record the destination.
Extract a new skill when the solution is:
Use the helper:
bash scripts/extract-skill.sh my-skill-name /absolute/path/to/workspace
Entries carry metadata (First-Seen, Last-Seen, Recurrence-Count, Status, Area) so the system can make deterministic lifecycle decisions without guessing.
| Tier | Location | Size guidance | Behavior |
|---|---|---|---|
| HOT | memory.md, corrections.md | <=100 lines each | Always loaded; most active patterns |
| WARM | projects/, domains/ | <=200 lines each | Loaded on context match |
| COLD | archive/ | Unlimited | Loaded on explicit query |
Use python3 scripts/learnings.py maintain --root <workspace> to review:
| Condition | Threshold | Action |
|---|---|---|
| HOT -> WARM | 30 days unused | Move stale entry to domains/ or projects/ based on Area metadata |
| WARM -> COLD | 90 days unused | Move stale entry to archive/<source-name>.md |
| WARM -> HOT | Recurrence-Count >= 3 or 3 uses within 7 days | Flag for promotion to memory.md |
| Compaction | File exceeds limit | Merge/summarize; never erase confirmed preferences |
maintain defaults to --dry-run. Use --apply to execute safe moves. It never deletes content.
When patterns contradict:
project > domain > global| Condition | Threshold | Action |
|---|---|---|
| HOT -> WARM | 30 days unused | Move stale entry to domains/ or projects/ based on Area metadata |
| WARM -> COLD | 90 days unused | Move stale entry to archive/<source-name>.md |
| WARM -> HOT | 3 uses within 7 days | Move to memory.md |
| To AGENTS/SOUL/TOOLS | Recurrence-Count >= 3 + spans 2+ tasks + within 30 days | Promote as short prevention rule |
| To skill | Proven + broadly applicable | Extract as skill |
Use these only when needed:
references/entry-formats.md — full field schemas and manual templatesreferences/promotion-and-extraction.md — promotion rules and skill extraction criteriareferences/platform-setup.md — Claude Code, Codex, Copilot, and OpenClaw setup notesHook helpers are intentionally optional and workspace-root aware.
Available hook scripts:
hooks/activator.sh — lightweight reminder at prompt starthooks/error-detector.sh — lightweight error reminder after failed Bash-like commandsHook configuration examples live in references/platform-setup.md.
A mature use of this skill has a loop:
capture → dedupe → promote → extract → evaluate
That means:
evals/