Lessons Learned for Openclaw

An advanced error-learning and long-term memory system designed to prevent repeated mistakes and store user preferences for AI agents.

zxygeitio
v1.0.1
Feb 26, 2026
0
1.1k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install lessons-learned

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install lessons-learned using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Lessons Learned?

The Lessons Learned skill is a core behavioral framework within the Openclaw Skills ecosystem. It enables AI coding agents to maintain a persistent memory of user preferences, habits, and past failures. By analyzing operation outcomes and monitoring for prohibited commands, this skill ensures that the agent becomes more reliable and personalized over time. It transforms every interaction into a learning opportunity, moving beyond session-based limitations to provide a truly continuous and safe developer experience.

Lessons Learned Use Cases

  • Preventing accidental execution of high-risk commands like rm -rf, sudo, or unauthorized file deletions.
  • Automatically remembering language preferences or specific file-handling workflows expressed by the user.
  • Analyzing and documenting failed operations to generate preventative rules for future tasks.
  • Implementing a global emergency stop mechanism to immediately halt active agent processes.
  • Maintaining a centralized MEMORY.md for long-term knowledge persistence and context retention.

How Lessons Learned Works

  1. Scans user input for prohibited keywords and high-risk operations to trigger immediate safety halts or confirmation prompts.
  2. Monitors for emergency stop signals like stop, cancel, or abort to instantly terminate all agent activities.
  3. Matches current context against established user habits, such as preferred response languages or data extraction methods, to automate routine behaviors.
  4. Logs operation failures into MISTAKES.md and synthesizes them into actionable rules within LESSONS_LEARNED.md.
  5. Persists user-expressed preferences directly into MEMORY.md and HABITS.md for cross-session continuity and long-term memory.

Lessons Learned Setup

To integrate this functionality into your agent environment using Openclaw Skills, ensure the directory structure exists and register the necessary command triggers.

mkdir -p memory/lessons
touch memory/lessons/MISTAKES.md memory/lessons/LESSONS_LEARNED.md MEMORY.md

Manual triggers can be invoked directly in the chat interface:

/lessons_learned learn <error_description>    # Record a mistake
/lessons_learned check <operation>             # Verify an action against rules
/lessons_learned memory <content>              # Manually persist information

Lessons Learned Data Schema & Taxonomy

The skill organizes its intelligence across several Markdown files within a specific hierarchy to ensure clarity and accessibility:

File Purpose
memory/lessons/MISTAKES.md Raw logs of failed operations and error analysis.
memory/lessons/LESSONS_LEARNED.md Processed rules and mandatory standards derived from past mistakes.
memory/lessons/PROHIBITED.md Blocklist of high-risk commands and restricted keywords.
memory/lessons/HABITS.md Documented user behavior patterns and UI preferences.
memory/lessons/SYSTEM_PROMPT.md Injection templates for keeping rules active in agent context.
MEMORY.md The primary long-term memory store for general user context.

Lessons Learned Advanced Features

  • P0 to P3 Error Classification system for tiered response and recovery logic based on failure severity.
  • Automatic system prompt injection via dedicated templates to ensure the agent always respects learned lessons.
  • Context-aware language switching that automatically detects and matches the user's input language.
  • Proactive risk confirmation workflows for sensitive operations involving code commits, email sending, or system modifications.
  • Seamless integration with other Openclaw Skills for holistic agent behavior management and safety enforcement.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*