Airsc is free for everyone. If it helps you, support it with $2–$20.

Support
SkillCautionAgent workflow & memoryBeginner friendly

claude-reflect-system

haddock-development · haddock-development/claude-reflect-system

A self-learning AI system for Claude Code that enables automatic skill improvement by remembering user corrections and avoiding past mistakes.

Continual Learning & Self-improving skills system for Claude Code - learn from corrections, never repeat mistakes

380 stars43License: No licenseUpdated 9 months ago0 opens

Preview

▍

What you can do with it

  • Teach Claude preferred development tools like uv instead of pip.
  • Enforce specific code style standards across all coding sessions.
  • Ensure Claude consistently applies project templates or security practices.

Safety check

Caution

Usable, but read the notes first.

  • ●No clear license: check with the author before using it in a commercial product.

Automated scan of the repo files. Always review code you run.

From the README

Claude Code Self-Learning Skills - Reflect System 🧠

"Correct once, never again" - AI that learns from your corrections and never repeats mistakes

Keywords: Claude Code, AI Learning, Self-Improving AI, LLM Skills, Machine Learning, Continuous Learning, AI Memory, Developer Tools, Code Automation, Python AI


🎯 What is this?

Reflect is a revolutionary self-learning AI system for Claude Code that enables automatic skill improvement through user corrections. Unlike traditional AI coding assistants that forget everything between sessions, Reflect creates permanent learning from your feedback.

Perfect for: Developers, AI engineers, automation enthusiasts, teams using Claude Code, anyone tired of repeating corrections to AI assistants.

Use Cases:

  • 🔧 Development workflows - Teach Claude your preferred tools (uv, pytest, ruff)
  • 🎨 Code style - Enforce your coding standards automatically
  • 📦 Project templates - Remember your preferred project structures
  • 🔐 Security practices - Never forget security checks again
  • 🚀 CI/CD pipelines - Consistent deployment patterns

The Problem

Session 1: Claude uses pip
You:      "No, use uv instead"
Claude:   "Ok, using uv"

Session 2: Claude uses pip again 😞
You:      "I told you to use uv!"

The Solution

Session 1: Claude uses pip
You:      "No, use uv instead"
          → /reflect → Skill learns ✅

Session 2: Claude uses uv ✨
Session 3: Claude uses uv ✨
Forever:  Claude uses uv ✨

🚀 Quick Start

Installation

# Copy to your Claude Code skills directory
cp -r reflect ~/.claude/skills/
cp -r python-project-creator ~/.claude/skills/

# Check status
/reflect-status

Basic Usage

  1. Work with Claude - Let it make a mistake
  2. Correct it - "No, use X instead of Y"
  3. Run reflection - /reflect
  4. Review changes - Approve with A
  5. Done! - Claude learned permanently

Commands

CommandAction
/reflectAnalyze current session manually
/reflect-onEnable auto-reflection at session end
/reflect-offDisable auto-reflection
/reflect-statusShow current configuration

📦 What's Included

🧠 Reflect System

The core learning engine with:

  • ✅ Pattern detection (HIGH/MEDIUM/LOW confidence)
  • ✅ Safe skill updates with backups
  • ✅ Git integration for version control
  • ✅ Interactive review flow
  • ✅ Auto-reflection via hooks

📖 Complete User Guide

🐍 Python Project Creator (Demo)

Example skill that demonstrates learning:

Initial state: Uses pip and unittest

After corrections:

  1. ✅ Learned: Use uv instead of pip
  2. ✅ Learned: Always pytest, never unittest

Result: Now always suggests uv and pytest!


🎓 How It Works

Three Confidence Levels

🔴 HIGH - Corrections

"No, use X instead of Y"
"Never do X"
"Always check Y"

→ Creates Critical Corrections section

🟡 MEDIUM - Approvals

"Yes, perfect!"
"That works well"
"Exactly right"

→ Adds to Best Practices

🟢 LOW - Observations

"Have you considered...?"
"What about...?"

→ Notes in Considerations

Safe Application

Every change includes:

  • ✅ Timestamped backup
  • ✅ YAML validation
  • ✅ User approval (manual mode)
  • ✅ Automatic rollback on errors
  • ✅ Git commit with description

⚡ Features & Benefits

Core Features

  • ✅ Pattern Recognition - Automatically detects corrections, approvals, and suggestions
  • ✅ Confidence-Based Learning - Three levels (HIGH/MEDIUM/LOW) for intelligent updates
  • ✅ Safe Updates - Timestamped backups, YAML validation, automatic rollback
  • ✅ Git Integration - Full version control of all learnings
  • ✅ Interactive Review - Always see changes before applying
  • ✅ Auto-Reflection - Optional automatic learning at session end
  • ✅ Zero Configuration - Works out of the box
  • ✅ Extensible - Add custom pattern detection easily

Why Choose Reflect?

FeatureTraditional AIReflect System
Memory❌ Forgets between sessions✅ Permanent learning
Corrections❌ Repeat every time✅ Once and done
Version Control❌ No history✅ Full Git integration
Transparency❌ Black box✅ See all changes
Customization❌ Limited✅ Fully customizable
Team Learning❌ Individual only✅ Shareable via Git

Technical Highlights

  • 🐍 Pure Python - No complex dependencies
  • 🔒 Privacy First - All data stays local
  • 📦 Modular Design - Use components independently
  • 🚀 Fast - Pattern detection in milliseconds
  • 🧪 Battle-Tested - Extensively used in production

📖 Example Learning Journey

Step 1: Initial Mistake

Claude uses pip install:

pip install fastapi
pip freeze > requirements.txt

Step 2: Your Correction

"No, use uv instead of pip! It's faster and modern."

Step 3: Reflection Detects

Signal detected:
- Type: HIGH confidence correction
- Pattern: "use X instead of Y"
- Old: pip
- New: uv

Step 4: Skill Updated

+## Critical Corrections
+
+**Use 'uv' instead of 'pip'**
+- ✗ Don't: pip install
+- ✓ Do: uv pip install

Step 5: Forever Learned

Next session, Claude automatically:

uv pip install fastapi
uv pip freeze > requirements.txt

No reminder needed! ✨


🛠️ Configuration

Manual Mode (Recommended for beginners)

/reflect-status  # Should show "Disabled"

Run /reflect after sessions with corrections.

Auto Mode (For continuous learning)

/reflect-on

Runs automatically at session end via Stop hook.

Hook Setup

Already configured if you copied the skills! Check:

cat ~/.claude/settings.local.json | grep -A 5 hooks

Should show hook for reflect/scripts/hook-stop.sh.

View source on GitHub