ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

self-optimization

Turn mistakes, corrections, dead ends, and repeated fixes into durable improvements. Use when work reveals a non-obvious lesson, a recurring failure, a missing capability, or a rule that should be promoted into agent memory, workflow guidance, or a reusable skill.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/alethean-kaw/self-optimization
Or

Self-Optimization

Use this skill to close the loop after real work. The goal is not just to log what went wrong. The goal is to convert signal from mistakes, corrections, and repeated effort into stronger future behavior.

Core Loop

  1. Detect meaningful signal.
  2. Capture it in .learnings/.
  3. De-duplicate and link related entries.
  4. Promote stable patterns into durable guidance.
  5. Extract reusable skills when the pattern is broad and proven.

Quick Reference

SituationAction
Command, tool, or integration fails unexpectedlyAppend an entry to .learnings/ERRORS.md
User corrects the agent or provides missing factsAppend an entry to .learnings/LEARNINGS.md
A better repeatable approach is discoveredAppend an entry to .learnings/LEARNINGS.md
User asks for a missing capabilityAppend an entry to .learnings/FEATURE_REQUESTS.md
Same issue keeps reappearingLink entries, bump priority, and consider promotion
Pattern is stable across tasksPromote to AGENTS.md, CLAUDE.md, TOOLS.md, SOUL.md, or .github/copilot-instructions.md
Pattern is reusable beyond one repoExtract a new skill scaffold

Detection Triggers

Capture a learning when any of these happen:

  • The first attempt was wrong and needed correction.
  • A tool or command failed in a non-obvious way.
  • The user revealed a project convention that was not documented.
  • The agent discovered a stronger pattern than the one it started with.
  • The same workaround or warning has appeared more than once.
  • The user asked for a capability the current system does not provide.

Skip noisy one-off trivia. Capture things that would realistically save a future session time, confusion, or rework.

Log Files

Create a local .learnings/ directory in the workspace or in the OpenClaw workspace.

.learnings/
├── LEARNINGS.md
├── ERRORS.md
└── FEATURE_REQUESTS.md

LEARNINGS.md

Use for:

  • corrections
  • knowledge gaps
  • best practices
  • project conventions
  • improved workflows

Template:

## [LRN-YYYYMMDD-XXX] category

**Logged**: 2026-04-01T10:00:00Z
**Priority**: low | medium | high | critical
**Status**: pending
**Area**: frontend | backend | infra | tests | docs | config

### Summary
One-line statement of the lesson.

### Details
What was wrong, what changed, and what is now known to be correct.

### Suggested Action
What to do differently next time.

### Metadata
- Source: conversation | debugging | user_feedback | simplify-and-harden
- Related Files: path/to/file
- Tags: tag-a, tag-b
- See Also: LRN-20260401-001
- Pattern-Key: optional.stable.key
- Recurrence-Count: 1
- First-Seen: 2026-04-01
- Last-Seen: 2026-04-01

---

ERRORS.md

Use for:

  • command failures
  • exceptions
  • bad tool assumptions
  • API or integration breakage

Template:

## [ERR-YYYY...

Metadata

Stars4473
Views0
Updated2026-05-01
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-alethean-kaw-self-optimization": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.