A self-learning system for Claude Code that captures corrections, positive feedback, and preferences — then syncs them to CLAUDE.md and AGENTS.md.
# Add to your Claude Code skills
git clone https://github.com/BayramAnnakov/claude-reflectA two-stage system that helps Claude Code learn from user corrections.
Stage 1: Capture (Automatic)
Hooks detect correction patterns ("no, use X", "actually...", "use X not Y") and queue them to ~/.claude/learnings-queue.json.
Stage 2: Process (Manual)
User runs /reflect to review and apply queued learnings to CLAUDE.md files.
| Command | Purpose |
|---------|---------|
| /reflect | Process queued learnings with human review |
| /reflect --scan-history | Scan past sessions for missed learnings |
| /reflect --dry-run | Preview changes without applying |
| /reflect-skills | Discover skill candidates from repeating patterns |
| /skip-reflect | Discard all queued learnings |
| /view-queue | View pending learnings without processing |
Remind users about /reflect when:
High-confidence corrections:
~/.claude/CLAUDE.md - Global learnings (model names, general patterns)./CLAUDE.md - Project-specific learnings (conventions, tools, structure)commands/*.md - Skill improvements (corrections during skill execution)A self-learning system for Claude Code that captures corrections and discovers workflow patterns — turning them into permanent memory and reusable skills.
When you correct Claude ("no, use gpt-5.1 not gpt-5"), it remembers forever.
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ You correct │ ──► │ Hook captures │ ──► │ /reflect adds │
│ Claude Code │ │ to queue │ │ to CLAUDE.md │
└─────────────────┘ └─────────────────┘ └─────────────────┘
(automatic) (automatic) (manual review)
Analyzes your session history to find repeating tasks that could become reusable commands.
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Your past │ ──► │ /reflect-skills │ ──► │ Generates │
│ sessions │ │ finds patterns │ │ /commands │
└─────────────────┘ └─────────────────┘ └─────────────────┘
(68 sessions) (AI-powered) (you approve)
User: no, use gpt-5.1 not gpt-5 for reasoning tasks
Claude: Got it, I'll use gpt-5.1 for reasoning tasks.
[Hook captures this correction to queue]
User: /reflect
Claude: Found 1 learning queued. "Use gpt-5.1 for reasoning tasks"
Scope: global
Apply to ~/.claude/CLAUDE.md? [y/n]
Example: You've asked "review my productivity" 12 times → suggests creating /daily-review
| Feature | What it does |
|---------|--------------|
| Permanent Memory | Corrections sync to CLAUDE.md — Claude remembers across sessions |
| Skill Discovery | Finds repeating patterns in your history → generates commands |
| Multi-language | AI understands corrections in any language |
| Skill Improvement | Corrections during /deploy improve the deploy skill itself |
# Add the marketplace
claude plugin marketplace add bayramannakov/claude-reflect
# Install the plugin
claude plugin install claude-reflect@claude-reflect-marketplace
# IMPORTANT: Restart Claude Code to activate the plugin
After installation, restart Claude Code (exit and reopen). Then hooks auto-configure and commands are ready.
First run? When you run
/reflectfor the first time, you'll be prompted to scan your past sessions for learnings.