Self-improvement through conversation analysis. Extracts learnings from corrections and success patterns, proposes updates to agent files or creates new skil...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install reflect-learn或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install reflect-learn⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/reflect-learn/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: reflect description: | Self-improvement through conversation analysis. Extracts learnings from corrections and success patterns, proposes updates to agent files or creates new skills. Philosophy: "Correct once, never again."
Use when: (1) User explicitly corrects behavior ("never do X", "always Y"), (2) Session ending or context compaction, (3) User requests /reflect, (4) Successful pattern worth preserving. version: 2.0.0 author: Claude Code Toolkit allowed-tools: - Read - Write - Edit - Grep - Glob - Bash ---
| Command | Action | |---------|--------| | /reflect | Analyze conversation for learnings | | /reflect on | Enable auto-reflection | | /reflect off | Disable auto-reflection | | /reflect status | Show state and metrics | | /reflect review | Review low-confidence learnings | | /reflect [agent] | Focus on specific agent |
"Correct once, never again."
When users correct behavior, those corrections become permanent improvements encoded into the agent system - across all future sessions.
Check and initialize state files using the state manager:
# Check for existing state
python scripts/state_manager.py init
# State directory is configurable via REFLECT_STATE_DIR env var
# Default: ~/.reflect/ (portable) or ~/.claude/session/ (Claude Code)
State includes:
reflect-state.yaml - Toggle state, pending reviewsreflect-metrics.yaml - Aggregate metricslearnings.yaml - Log of all applied learningsUse the signal detector to identify learnings:
python scripts/signal_detector.py --input conversation.txt
| Confidence | Triggers | Examples | |------------|----------|----------| | HIGH | Explicit corrections | "never", "always", "wrong", "stop", "the rule is" | | MEDIUM | Approved approaches | "perfect", "exactly", accepted output | | LOW | Observations | Patterns that worked, not validated |
See signal_patterns.md for full detection rules.
Map each signal to the appropriate target:
Learning Categories:
| Category | Target Files | |----------|--------------| | Code Style | code-reviewer, backend-developer, frontend-developer | | Architecture | solution-architect, api-architect, architecture-reviewer | | Process | CLAUDE.md, orchestrator agents | | Domain | Domain-specific agents, CLAUDE.md | | Tools | CLAUDE.md, relevant specialists | | New Skill | .claude/skills/{name}/SKILL.md |
See agent_mappings.md for mapping rules.
Some learnings should become new skills rather than agent updates:
Skill-Worthy Criteria:
Quality Gates (must pass all):
See skill_template.md for skill creation guidelines.
Produce output in this format:
# Reflection Analysis
## Session Context
- **Date**: [timestamp]
- **Messages Analyzed**: [count]
- **Focus**: [all agents OR specific agent name]
## Signals Detected
| # | Signal | Confidence | Source Quote | Category |
|---|--------|------------|--------------|----------|
| 1 | [learning] | HIGH | "[exact words]" | Code Style |
| 2 | [learning] | MEDIUM | "[context]" | Architecture |
## Proposed Agent Updates
### Change 1: Update [agent-name]
**Target**: `[file path]`
**Section**: [section name]
**Confidence**: [HIGH/MEDIUM/LOW]
**Rationale**: [why this change]
--- a/path/to/agent.md +++ b/path/to/agent.md @@ -82,6 +82,7 @@ ## Section
* Existing rule +* New rule from learning
## Proposed New Skills
### Skill 1: [skill-name]
**Quality Gate Check**:
- [x] Reusable: [why]
- [x] Non-trivial: [why]
- [x] Specific: [trigger conditions]
- [x] Verified: [how verified]
- [x] No duplication: [checked against]
**Will create**: `.claude/skills/[skill-name]/SKILL.md`
## Conflict Check
- [x] No conflicts with existing rules detected
- OR: Warning - potential conflict with [file:line]
## Commit Message
reflect: add learnings from session [date]
Agent updates:
New skills:
Extracted: [N] signals ([H] high, [M] medium, [L] low confidence)
## Review Prompt
Apply these changes?
- `Y` - Apply all changes and commit
- `N` - Discard all changes
- `modify` - Adjust specific changes
- `1,3` - Apply only changes 1 and 3
- `s1` - Apply only skill 1
- `all-skills` - Apply all skills, skip agent updates
On Y (approve):
git add on modified filesOn N (reject):
On modify:
On selective (e.g., 1,3):
python scripts/metrics_updater.py --accepted 3 --rejected 1 --confidence high:2,medium:1
/reflect on
# Sets auto_reflect: true in state file
# Will trigger on PreCompact hook
/reflect off
# Sets auto_reflect: false in state file
/reflect status
# Shows current state and metrics
/reflect review
# Shows low-confidence learnings awaiting validation
Project-level (versioned with repo):
.claude/reflections/YYYY-MM-DD_HH-MM-SS.md - Full reflection.claude/reflections/index.md - Project summary.claude/skills/{name}/SKILL.md - New skillsGlobal (user-level):
~/.claude/reflections/by-project/{project}/ - Cross-project~/.claude/reflections/by-agent/{agent}/learnings.md - Per-agent~/.claude/reflections/index.md - Global summarySome learnings belong in auto-memory (~/.claude/projects/*/memory/MEMORY.md) rather than agent files:
| Learning Type | Best Target | |---------------|-------------| | Behavioral correction ("always do X") | Agent file | | Project-specific pattern | MEMORY.md | | Recurring bug/workaround | New skill OR MEMORY.md | | Tool preference | CLAUDE.md | | Domain knowledge | MEMORY.md or compound-docs |
When a signal is LOW confidence and project-specific, prefer writing to MEMORY.md over modifying agents.
git revert...
安装 Reflect 后,可以对 AI 说这些话来触发它
Help me get started with Reflect
Explains what Reflect does, walks through the setup, and runs a quick demo based on your current project
Use Reflect to self-improvement through conversation analysis
Invokes Reflect with the right parameters and returns the result directly in the conversation
What can I do with Reflect in my ai agent & automation workflow?
Lists the top use cases for Reflect, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/reflect-learn/ 目录(个人级,所有项目可用),或 .claude/skills/reflect-learn/(项目级)。重启 AI 客户端后,用 /reflect-learn 主动调用,或让 AI 根据上下文自动发现并使用。
Reflect 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Reflect 可免费安装使用。请查阅仓库了解许可证信息。
Self-improvement through conversation analysis. Extracts learnings from corrections and success patterns, proposes updates to agent files or creates new skil...
Reflect 属于「AI Agent & Automation」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my ai agent & automation tasks using Reflect
Identifies repetitive steps in your workflow and sets up Reflect to handle them automatically