OpenClaw Skill

self-reflection

Continuous self-improvement through structured reflection and memory

Install

$npx clawhub@latest install self-reflection-1-1-1
All-time installs7
Active installs7
Stars0

๐Ÿชž Self-Reflection

A skill for continuous self-improvement. The agent tracks mistakes, lessons learned, and improvements over time through regular heartbeat-triggered reflections.

Quick Start

bash
# Check if reflection is needed
self-reflection check

# Log a new reflection
self-reflection log "error-handling" "Forgot timeout on API call" "Always add timeout=30"

# Read recent lessons
self-reflection read

# View statistics
self-reflection stats

How It Works

Heartbeat (60m) โ†’ Agent reads HEARTBEAT.md โ†’ Runs self-reflection check
                                                      โ”‚
                                            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                                            โ–ผ                   โ–ผ
                                           OK              ALERT
                                            โ”‚                   โ”‚
                                       Continue            Reflect
                                                               โ”‚
                                                     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                                                     โ–ผ                   โ–ผ
                                                   read               log
                                              (past lessons)     (new insights)

Commands

CommandDescription
check [--quiet]Check if reflection is due (OK or ALERT)
log <tag> <miss> <fix>Log a new reflection
read [n]Read last n reflections (default: 5)
statsShow reflection statistics
resetReset the timer

OpenClaw Integration

Enable heartbeat in ~/.openclaw/openclaw.json:

json
{
  "agents": {
    "defaults": {
      "heartbeat": {
        "every": "60m",
        "activeHours": { "start": "08:00", "end": "22:00" }
      }
    }
  }
}

Add to your workspace HEARTBEAT.md:

markdown
## Self-Reflection Check (required)
Run `self-reflection check` at each heartbeat.
If ALERT: read past lessons, reflect, then log insights.

Configuration

Create ~/.openclaw/self-reflection.json:

json
{
  "threshold_minutes": 60,
  "memory_file": "~/workspace/memory/self-review.md",
  "state_file": "~/.openclaw/self-review-state.json",
  "max_entries_context": 5
}

Author

Created by hopyky

License

MIT

Persistent memory

Give your OpenClaw agent a memory layer

Mem0 remembers users and context across sessions so you send fewer tokens and get better answers.

Try Mem0Mem0 + OpenClaw guide