✓ Verified 🌐 Web Scrapers ✓ Enhanced Data

Error Driven Evolution

Structured error-to-rule learning system for AI agents.

Rating
4.5 (128 reviews)
Downloads
966 downloads
Version
1.0.0

Overview

Structured error-to-rule learning system for AI agents.

Complete Documentation

View Source →

Error-Driven Evolution

Turn mistakes into rules. Not reflections, not apologies — rules.

Core Concept

When an agent makes an error or gets corrected, it must:

  • Extract a rule (not a story)
  • Write it to lessons.md in its workspace
  • Scan relevant rules before future decisions in that domain
  • Optionally share anonymized rules to the community repo

lessons.md Format

File location: {workspace}/lessons.md

Each rule follows this structure:

markdown
### [CATEGORY] Short imperative title

- **When**: The specific situation/trigger
- **Do**: The correct action (imperative, specific)
- **Don't**: The wrong action that was taken
- **Why**: One sentence — what went wrong
- **Added**: YYYY-MM-DD

Categories

TagScope
DATAQuerying, interpreting, presenting data
COMMSMessaging, tone, audience, channels
SCOPERole boundaries, doing others' work
EXECTask execution, tools, file ops
JUDGMENTDecisions, priorities, assumptions
CONTEXTMemory, context window, info management
SAFETYSecurity, privacy, destructive ops
COLLABMulti-agent coordination, handoffs

When to Record

Record a rule when:

  • User corrects you — explicit feedback
  • User overrides your output — they redo your work
  • Same error twice — second occurrence MUST become a rule
  • Near miss — you catch yourself about to repeat a mistake
Do NOT record: one-off technical glitches, user preference changes (those go in MEMORY.md).

How to Record

  • Stop. Don't apologize at length.
  • Identify the category.
  • Write the rule in imperative form.
  • Append to lessons.md (never overwrite).
  • Confirm briefly: "Added to lessons: [title]"

Pre-Decision Scan

Before acting, scan lessons.md for applicable rules:

About to...Check
Present data[DATA]
Send message / write report[COMMS] + [SCOPE]
Make suggestion[JUDGMENT] + [SCOPE]
Execute multi-step task[EXEC] + [CONTEXT]
Start new sessionAll (skim titles)
Scan = read ### [TAG] headers, check if any When matches your situation.

Community Sharing

Share anonymized lessons to help other agents: https://github.com/anthropic-ai/agent-lessons

See references/community-sharing.md for the anonymization and submission process.

Setup

  • Create lessons.md in your workspace:
markdown
# Lessons
Rules extracted from mistakes. Append after failing, scan before deciding.
  • Copy community/top-100.md to your workspace as top-100.md — this is your pre-installed immune system. Small enough to skim on startup, covers the most common and costly mistakes across all agent deployments.
  • Add to your startup instructions:
markdown
- On startup: skim top-100.md titles (pre-installed community lessons)
- On correction/failure: append rule to lessons.md
- Before decisions: scan lessons.md + top-100.md for [CATEGORY] rules

Loading Strategy

Your agent has two rule files:

FileSourceLoad on startupSize target
lessons.mdYour own mistakesYes, fullyGrows organically
top-100.mdCommunity top picksYes, skim titles~8KB, curated
For deeper community search (beyond top-100), query community/{category}.md files on-demand when facing an unfamiliar situation.

Maintenance

When lessons.md exceeds 50 rules: review for duplicates, retire obsolete rules (mark don't delete), consider splitting by category.

Installation

Terminal bash

openclaw install error-driven-evolution
    
Copied!

💻Code Examples

- **Added**: YYYY-MM-DD

--added-yyyy-mm-dd.txt
### Categories

| Tag | Scope |
|-----|-------|
| `DATA` | Querying, interpreting, presenting data |
| `COMMS` | Messaging, tone, audience, channels |
| `SCOPE` | Role boundaries, doing others' work |
| `EXEC` | Task execution, tools, file ops |
| `JUDGMENT` | Decisions, priorities, assumptions |
| `CONTEXT` | Memory, context window, info management |
| `SAFETY` | Security, privacy, destructive ops |
| `COLLAB` | Multi-agent coordination, handoffs |

## When to Record

Record a rule when:
1. **User corrects you** — explicit feedback
2. **User overrides your output** — they redo your work
3. **Same error twice** — second occurrence MUST become a rule
4. **Near miss** — you catch yourself about to repeat a mistake

Do NOT record: one-off technical glitches, user preference changes (those go in MEMORY.md).

## How to Record

1. Stop. Don't apologize at length.
2. Identify the category.
3. Write the rule in imperative form.
4. Append to lessons.md (never overwrite).
5. Confirm briefly: "Added to lessons: [title]"

## Pre-Decision Scan

Before acting, scan `lessons.md` for applicable rules:

| About to... | Check |
|-------------|-------|
| Present data | `[DATA]` |
| Send message / write report | `[COMMS]` + `[SCOPE]` |
| Make suggestion | `[JUDGMENT]` + `[SCOPE]` |
| Execute multi-step task | `[EXEC]` + `[CONTEXT]` |
| Start new session | All (skim titles) |

Scan = read `### [TAG]` headers, check if any `When` matches your situation.

## Community Sharing

Share anonymized lessons to help other agents: https://github.com/anthropic-ai/agent-lessons

See references/community-sharing.md for the anonymization and submission process.

## Setup

1. Create `lessons.md` in your workspace:

Rules extracted from mistakes. Append after failing, scan before deciding.

rules-extracted-from-mistakes-append-after-failing-scan-before-deciding.txt
2. Copy `community/top-100.md` to your workspace as `top-100.md` — this is your pre-installed immune system. Small enough to skim on startup, covers the most common and costly mistakes across all agent deployments.

3. Add to your startup instructions:
example.md
### [CATEGORY] Short imperative title

- **When**: The specific situation/trigger
- **Do**: The correct action (imperative, specific)
- **Don't**: The wrong action that was taken
- **Why**: One sentence — what went wrong
- **Added**: YYYY-MM-DD
example.md
- On startup: skim top-100.md titles (pre-installed community lessons)
- On correction/failure: append rule to lessons.md
- Before decisions: scan lessons.md + top-100.md for [CATEGORY] rules

Tags

#browser_and-automation

Quick Info

Category Web Scrapers
Model Claude 3.5
Complexity Multi-Agent
Author marsnavi
Last Updated 3/10/2026
🚀
Optimized for
Claude 3.5
🧠

Ready to Install?

Get started with this skill in seconds

openclaw install error-driven-evolution