Self-Reflection for Openclaw

Enable continuous self-improvement for AI agents through structured reflection, mistake tracking, and memory management.

hopyky
v1.1.1
Jan 31, 2026
43
18.2k
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install self-reflection

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 self-reflection 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 Self-Reflection?

The Self-Reflection skill is a specialized tool designed to facilitate long-term growth and error correction for AI agents. By utilizing a structured feedback loop, this skill allows agents to maintain a memory of past mistakes and the corresponding fixes. This ensures that the agent evolves over time, becoming more efficient and reliable as it integrates into various Openclaw Skills workflows.

This skill is particularly valuable for complex, long-running projects where maintaining a record of 'lessons learned' prevents the repetition of previous errors. It leverages the heartbeat mechanism to ensure that reflection isn't just an afterthought but a core part of the agent's operational lifecycle.

Self-Reflection Use Cases

  • Tracking and fixing recurring API timeout or error-handling issues.
  • Maintaining a log of logical improvements for complex coding tasks.
  • Implementing scheduled 'sanity checks' for autonomous agents during long sessions.
  • Generating statistics on agent learning progress and reliability over time.

How Self-Reflection Works

  1. The Openclaw Skills heartbeat triggers at a predefined interval (e.g., 60 minutes).
  2. The agent reads the workspace HEARTBEAT.md and executes the self-reflection check command.
  3. If the check returns an ALERT status, the agent is prompted to reflect on recent activities.
  4. The agent reads past lessons using the read command to maintain context of previous improvements.
  5. New insights, mistakes, and fixes are recorded using the log command, which updates the persistent memory file.
  6. The state is updated, and the reflection timer is reset until the next heartbeat interval.

Self-Reflection Setup

To install and configure the Self-Reflection skill, ensure you have the required dependencies (jq and date) installed on your system.

# Verify the installation by checking if reflection is due
self-reflection check

# Log an initial reflection to test the system
self-reflection log "setup" "manual-config" "automated-heartbeat-check"

Integrate the skill by adding the heartbeat configuration to your ~/.openclaw/openclaw.json and updating your workspace HEARTBEAT.md with the requirement to run self-reflection check.

Self-Reflection Data Schema & Taxonomy

The skill manages data across two primary files: a human-readable Markdown log and a JSON state file.

File Type Path Purpose
Memory File ~/workspace/memory/self-review.md Stores the history of tags, mistakes, and fixes.
State File ~/.openclaw/self-review-state.json Tracks the last reflection timestamp and configuration limits.
Context N/A Limits the number of past entries fed into the agent's active memory (default: 5).

Self-Reflection Advanced Features

  • Automated heartbeat-driven reminders ensuring constant agent optimization.
  • Customizable threshold timers to adjust reflection frequency based on project intensity.
  • Tag-based indexing for specific types of improvements (e.g., security, performance, syntax).
  • Statistical reporting via the stats command to visualize agent learning trends over time.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Requires
Bins jqdate
Github Stars: 0
forks: 0

Featured*