Back to Skills

Self-Improving Agent (With Self-Reflection)

Self-reflection, self-criticism, and self-learning framework that lets your AI agent evaluate its own work, catch mistakes, and permanently improve through a tiered memory system.

by Iván
Productivity & TasksProductivity

# Self-Improving Agent (With Self-Reflection) Self-reflection, self-criticism, and self-learning framework that lets your AI agent evaluate its own work, catch mistakes, and permanently improve through a tiered memory system. Self-Improving Agent is a behavioral framework that adds self-reflection, self-criticism, self-learning, and self-organizing memory to your AI agent. The agent evaluates its own work after completing tasks, catches mistakes through automatic detection triggers, and stores learnings in a persistent tiered memory system that compounds knowledge over time without manual maintenance. ## How It Works The skill creates a ~/self-improving/ directory with a tiered memory structure: HOT memory ( memory.md , always loaded, up to 100 lines), WARM storage (per-project and per-domain files loaded on demand), and COLD archive for decayed patterns. The agent automatically detects corrections, preference signals, and repeating patterns during conversation, logging them to corrections.md and promoting entries to HOT memory after they are validated three times. Patterns unused for 30 days are demoted to WARM, and those unused for 90 days are archived to COLD. ## Key Features - **Self-Reflection**: Agent pauses after significant work to evaluate whether the outcome met expectations and what could be improved - **Automatic Detection Triggers**: Recognizes corrections, preference signals, and repeating patterns from natural conversation - **Tiered Memory System**: HOT (always loaded, 100 lines max), WARM (per-project/domain, on demand), and COLD (archived) storage tiers with automatic promotion and demotion - **Corrections Log**: Maintains the last 50 corrections with context, reflection, and lesson entries - **Pattern Promotion**: Tracks candidate patterns and promotes them to permanent memory after 3 successful validations in 7 days - **Memory Queries**: Ask what the agent knows, view recent learnings, check memory stats, or export the entire memory - **Namespace Isolation**: Separate memory files per project and domain with inheritance (global to domain to project) - **Conflict Resolution**: Most specific wins (project over domain over global), most recent wins at the same level ## Requirements - **File System Access**: The agent needs read/write access to the ~/self-improving/ directory ## Use Cases - **Long-Running Projects**: Maintain context and learnings across hundreds of agent sessions without repeating yourself - **Coding Workflows**: Agent remembers your coding conventions, preferred patterns, and past mistakes - **Quality Improvement**: Agent self-evaluates after multi-step tasks to catch issues before you do - **Preference Learning**: Stop repeating instructions by letting the agent permanently record your preferences - **Knowledge Compounding**: Build up domain-specific expertise over time that persists across conversations ## Installation Install via: `npx clawhub@latest install self-improving`

Installation

1

Run in your terminal

npx clawhub@latest install self-improving
2

Click the Install button at the top of this page for one-click setup