claude-mem
Captures what your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions so work carries over. Works with Claude Code and several other coding agents.
A self-learning system for Claude Code that captures your corrections during sessions and reminds you to run /reflect to save them to CLAUDE.md as permanent memory. It also discovers recurring workflow patterns.
Claude Code
> /plugin marketplace add BayramAnnakov/claude-reflect> /plugin install claude-reflect@claude-reflect-marketplace
Codex
$ npx skills add BayramAnnakov/claude-reflect --skill claude-reflect -a codex
Cursor
$ npx skills add BayramAnnakov/claude-reflect --skill claude-reflect -a cursor
Gemini CLI
$ npx skills add BayramAnnakov/claude-reflect --skill claude-reflect -a gemini-cli
GitHub Copilot
$ copilot plugin marketplace add BayramAnnakov/claude-reflect$ copilot plugin install claude-reflect@claude-reflect-marketplace
OpenCode
$ npx skills add BayramAnnakov/claude-reflect --skill claude-reflect -a opencode
Windsurf
$ npx skills add BayramAnnakov/claude-reflect --skill claude-reflect -a windsurf


A self-learning system for Claude Code that captures corrections and discovers workflow patterns — turning them into permanent memory and reusable skills.
Two ways to run it:
| Plugin (Python) | Mod (reflect-mod, new in 3.3) | |
|---|---|---|
| You correct Claude | a hook queues it | a model check sees it at once, in any language |
| You review | later, with /reflect | right away, in a band above the prompt |
| Runs on | Claude Code, plus Codex/Cursor via AGENTS.md | Claude Code 2.1.286+ with mods |
Pick one. Install the plugin or the mod.
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)
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.
Claude Code mods run inside the session, so the same idea works without a queue you have to remember to review:
haiku by default) that decides whether it holds a reusable rule. It reads intent, not keywords,
so corrections in any language count ("нет, используй pnpm" works).×3).~/.claude/CLAUDE.md or ./CLAUDE.md, and the rule applies
in the current session at once. Nothing is written without a press.remember: <rule> skips the model. /reflect-queue lists what it found; /reflect-pause turns it off.claude plugin marketplace add bayramannakov/claude-reflect
claude plugin install reflect-mod@claude-reflect-marketplace
Needs Claude Code 2.1.286 or newer with mods enabled. Each checked prompt is one small model call on your
own Claude account. Install either the mod or the Python plugin above, not both: with both, every
correction is captured twice. The Python plugin stays the choice for /reflect --scan-history, --dedupe,
--organize, /reflect-skills, and for Codex/Cursor users. Details: mod/README.md.
| Command | Description |
|---|---|
/reflect | Process queued learnings with human review |
/reflect --scan-history | Scan ALL past sessions for missed learnings |
/reflect --dry-run | Preview changes without applying |
/reflect --targets | Show detected config files (CLAUDE.md, AGENTS.md) |
/reflect --review | Show queue with confidence scores and decay status |
/reflect --dedupe | Find and consolidate similar entries in CLAUDE.md |
/reflect --include-tool-errors | Include tool execution errors in scan |
/reflect-skills | Discover skill candidates from repeating patterns |
/reflect-skills --days N | Analyze last N days (default: 14) |
/reflect-skills --project <path> | Analyze specific project |
/reflect-skills --all-projects | Scan all projects for cross-project patterns |
/reflect-skills --dry-run | Preview patterns without generating skill files |
/skip-reflect | Discard all queued learnings |
/view-queue | View pending learnings without processing |
Stage 1: Capture (Automatic)
Hooks run automatically to detect and queue corrections:
| Hook | Trigger | Purpose |
|---|---|---|
session_start_reminder.py | Session start | Shows pending learnings reminder |
capture_learning.py | Every prompt | Detects correction patterns and queues them |
check_learnings.py | Before compaction | Backs up queue and informs user |
post_commit_reminder.py | After git commit | Reminds to run /reflect after completing work |
Stage 2: Process (Manual)
Run /reflect to review and apply queued learnings to CLAUDE.md.
Claude-reflect uses a hybrid detection approach:
1. Regex patterns (real-time capture)
Fast pattern matching during sessions detects:
"no, use X" / "don't use Y" / "actually..." / "that's wrong""Perfect!" / "Exactly right" / "Great approach""remember:" — highest confidence2. Semantic AI validation (during /reflect)
When you run /reflect, an AI-powered semantic filter:
Example: A Spanish correction like "no, usa Python" is correctly detected even though it doesn't match English patterns.
Each captured learning has a confidence score (0.60-0.95). The final score is the higher of regex and semantic confidence.
When you run /reflect, Claude presents a summary table with options:
Approved learnings are synced to:
~/.claude/CLAUDE.md (global - applies to all projects)./CLAUDE.md (project-specific)./**/CLAUDE.md (subdirectories - auto-discovered)./.claude/commands/*.md (skill files - when correction relates to a skill)AGENTS.md (if exists - works with Codex, Cursor, Aider, Jules, Zed, Factory)@filename includes or markdown links (bounded depth, cycles handled, code blocks/external URLs skipped) — useful when CLAUDE.md delegates guidance to standards.md, architecture.md, etc.Run /reflect --targets to see which files will be updated.
Run /reflect-skills to discover repeating patterns in your sessions that could become reusable skills:
/reflect-skills # Analyze current project (last 14 days)
/reflect-skills --days 30 # Analyze last 30 days
/reflect-skills --all-projects # Analyze all projects (slower)
/reflect-skills --dry-run # Preview patterns without generating files
Features:
.claude/commands/How it works:
The skill discovers patterns by analyzing your session history semantically. Different phrasings of the same intent are recognized:
Session 1: "review my productivity for today"
Session 2: "how was my focus this afternoon?"
Session 3: "check my ActivityWatch data"
Session 4: "evaluate my work hours"
Claude reasons: "These 4 requests have the same intent - reviewing productivity data. The workflow is: fetch time tracking data → categorize activities → calculate focus score. This is a strong candidate for /daily-review."
Example output:
════════════════════════════════════════════════════════════
SKILL CANDIDATES DISCOVERED
════════════════════════════════════════════════════════════
Found 2 potential skills from analyzing 68 sessions:
1. /daily-review (High) — from my-productivity-tools
→ Review productivity using time tracking data
Evidence: 15 similar requests
Corrections learned: "use local timezone", "chat apps can be work"
2. /deploy-app (High) — from my-webapp
→ Deploy application with pre-flight checks
Evidence: 10 similar requests
Corrections learned: "always run tests first"
════════════════════════════════════════════════════════════
Which skills should I generate?
> [1] /daily-review, [2] /deploy-app
Where should each skill be created?
┌──────────────────────┬─────────────────────────┐
│ /daily-review │ my-productivity-tools │
│ /deploy-app │ my-webapp │
└──────────────────────┴─────────────────────────┘
Skills created:
~/projects/my-productivity-tools/.claude/commands/daily-review.md
~/projects/my-webapp/.claude/commands/deploy-app.md
Generated skill file example:
---
description: Deploy application with pre-flight checks
allowed-tools: Bash, Read, Write
---
## Context
Deployment scripts in ./scripts/deploy/
## Your Task
Deploy the application to the specified environment.
### Steps
1. Run test suite
2. Build production assets
3. Deploy to target environment
4. Verify deployment health
### Guardrails
- Always run tests before deploying
- Never deploy to production on Fridays
- Check for pending migrations
---
*Generated by /reflect-skills from 10 session patterns*
See 12 claude-reflect alternatives
Captures what your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions so work carries over. Works with Claude Code and several other coding agents.
Gives Claude Code long-term memory through Hindsight. It recalls relevant past context before answering, retains durable facts as the agent learns them, and reflects over stored memory.
Local-first memory for Claude Code. It stores conversations verbatim in a private palace you can search before answering about past work, people, projects, or decisions, with optional shared-brain hub setup.
Gives Claude Code a private memory that stays on your machine. It stores past conversations word for word, so you can ask what was decided, what happened before, or who was involved and get the original context back. It can also hand tasks to other agents.
Install it with the command on its page. It includes claude-reflect. Its skills do not fire on their own yet. Free and open source.
Is this plugin yours?
Claim it with GitHubSubmit a pluginPromote it