# Claude Reflect — Self-Learning for Claude Code > A Claude Code plugin that captures corrections and preferences during development, then syncs learnings to CLAUDE.md automatically. Makes Claude remember across sessions. 870+ stars. ## Install Save the content below to `.claude/skills/` or append to your `CLAUDE.md`: ## Quick Use 1. Install the plugin via Claude Code: ``` claude plugin marketplace add bayramannakov/claude-reflect claude plugin install claude-reflect@claude-reflect-marketplace ``` 2. Restart Claude Code to activate hooks. 3. Use normally — corrections are captured automatically. 4. Run `/reflect` to review and approve captured learnings. 5. Run `/reflect-skills` to discover workflow patterns. --- ## Intro Claude Reflect is an open-source Claude Code plugin that makes Claude learn from your corrections and discover your workflow patterns. With 870+ GitHub stars and MIT license, it automatically detects when you correct Claude ("no, use X instead"), queues the correction for review, and syncs approved learnings to `CLAUDE.md` — so Claude remembers your preferences across sessions. It also analyzes session history to identify repeating tasks and suggests reusable commands. Think of it as a persistent memory layer that gets smarter the more you use Claude Code. Best for: Claude Code power users who want their AI to remember corrections and adapt to their coding style. Works with: Claude Code (macOS, Linux, Windows). Setup time: under 1 minute. --- ## Claude Reflect — How It Works ### Two-Stage Architecture **Stage 1: Automatic Capture (via Hooks)** Claude Reflect installs hooks that monitor your Claude Code sessions in real-time. When you make a correction — phrases like "no, use X instead", "actually, do Y", "don't do that" — the system detects it using a combination of: - **Regex patterns** — Fast, real-time detection of common correction phrases - **Semantic AI validation** — Accurate interpretation across any language Corrections are queued silently without interrupting your workflow. **Stage 2: Review & Sync (via Commands)** | Command | Purpose | |---------|---------| | `/reflect` | Review queued corrections, approve/reject, sync to CLAUDE.md | | `/reflect-skills` | Analyze session history for repeating patterns | | `/reflect --dedupe` | Consolidate duplicate or similar learnings | | `/reflect --scan-history` | Recover corrections from past sessions | ### Key Features #### Permanent Memory Approved corrections sync to `CLAUDE.md` at three levels: - **Global** (`~/.claude/CLAUDE.md`) — Applies to all projects - **Project** (`.claude/CLAUDE.md`) — Project-specific preferences - **Skills** (`.claude/skills/`) — Domain-specific knowledge #### Multi-Language Support The semantic AI detector understands corrections in any language — English, Chinese, Japanese, etc. No configuration needed. #### Duplicate Detection When a new correction is similar to an existing one, Claude Reflect offers to: - **Merge** — Combine related learnings - **Replace** — Update with newer preference - **Skip** — Keep existing, discard new #### Workflow Pattern Discovery `/reflect-skills` uses AI reasoning to find semantic similarities across different phrasings in your session history. It suggests new reusable commands and skill files based on your actual usage patterns. ### Example Workflow ``` You: Fix the login bug Claude: [uses console.log for debugging] You: No, always use the logger module, not console.log → Claude Reflect captures: "User prefers logger module over console.log" → You run /reflect, approve it → Added to CLAUDE.md: "Always use the logger module for debugging, never console.log" → Claude remembers this in all future sessions ``` ### Requirements - Claude Code - Python 3.6+ - macOS, Linux, or Windows ### FAQ **Q: What is Claude Reflect?** A: A Claude Code plugin that captures your corrections during development and syncs them to CLAUDE.md, making Claude remember your preferences across sessions and projects. **Q: Is Claude Reflect free?** A: Yes, fully open-source under MIT license. **Q: Does it slow down Claude Code?** A: No. Corrections are captured asynchronously via lightweight hooks. The AI validation only runs when you invoke `/reflect`. --- ## Source & Thanks > Created by [Bayram Annakov](https://github.com/BayramAnnakov). Licensed under MIT. > > [claude-reflect](https://github.com/BayramAnnakov/claude-reflect) — ⭐ 870+ Thank you to Bayram Annakov for making Claude Code learn from its mistakes. --- ## 快速使用 1. 安装插件: ``` claude plugin marketplace add bayramannakov/claude-reflect claude plugin install claude-reflect@claude-reflect-marketplace ``` 2. 重启 Claude Code 激活 hooks。 3. 正常使用——纠正会被自动捕获。 4. 运行 `/reflect` 审核并批准学习内容。 --- ## 简介 Claude Reflect 是一个开源 Claude Code 插件,让 Claude 从你的纠正中学习并发现工作流模式。拥有 870+ GitHub Star 和 MIT 许可证,它自动检测你对 Claude 的纠正("不,用 X 代替"),排队等待审核,审核通过后同步到 `CLAUDE.md`——让 Claude 跨会话记住你的偏好。还能分析历史会话识别重复任务,建议可复用命令。 适合人群:希望 AI 记住纠正并适应编码风格的 Claude Code 深度用户。 兼容平台:Claude Code(macOS、Linux、Windows)。 安装时间:1 分钟以内。 --- ## 工作原理 ### 两阶段架构 **阶段 1:自动捕获(通过 Hooks)** 监控会话中的纠正短语,结合正则匹配和语义 AI 验证,支持任何语言。 **阶段 2:审核与同步(通过命令)** - `/reflect` — 审核纠正,批准后同步到 CLAUDE.md - `/reflect-skills` — 分析历史发现工作流模式 - `/reflect --dedupe` — 合并重复学习内容 - `/reflect --scan-history` — 从历史会话恢复纠正 ### 核心功能 - **永久记忆**:同步到全局、项目和 Skill 三级 CLAUDE.md - **多语言支持**:AI 语义检测器理解任何语言的纠正 - **去重检测**:合并/替换/跳过相似学习内容 - **模式发现**:从使用历史中识别重复任务 ### FAQ **Q: Claude Reflect 是什么?** A: Claude Code 插件,捕获你的纠正并同步到 CLAUDE.md,让 Claude 跨会话记住偏好。 **Q: 免费吗?** A: MIT 开源免费。 --- ## 来源与感谢 > Created by [Bayram Annakov](https://github.com/BayramAnnakov). Licensed under MIT. > > [claude-reflect](https://github.com/BayramAnnakov/claude-reflect) — ⭐ 870+ --- Source: https://tokrepo.com/en/workflows/47d7c959-8340-4390-a163-39cf2e41f7b3 Author: TokRepo精选