reflect
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseReflect
复盘
Extract learnings from sessions and persist to skill files.
从会话中提炼经验并保存至技能文件。
When to Reflect
何时进行复盘
Run after sessions with:
/reflect- Corrections - "actually use X", "no, do it this way"
- Discoveries - patterns that worked well
- Failures - approaches that didn't work
在以下类型的会话结束后运行 :
/reflect- 修正内容 - “实际使用X”、“不对,应该这么做”
- 发现总结 - 有效的模式
- 失败教训 - 无效的方法
Usage
使用方法
/reflect # Analyze current session, suggest skill updates
/reflect skill-name # Target specific skill for updatesNote: This is manual-only. Run before ending sessions with learnings.
/reflect # 分析当前会话,建议技能更新
/reflect skill-name # 针对特定技能进行更新注意: 此功能仅支持手动触发。请在结束有经验可提炼的会话前运行。
Why Manual-Only?
为何仅支持手动触发?
Auto-detection via Stop hooks doesn't work reliably:
| Issue | Problem |
|---|---|
| #16227 | Stop hook output is silent (not shown to user) |
| #10412 | Plugin Stop hooks fail with exit code 2 |
| #10875 | Plugin JSON output not captured |
| #3656 | Blocking functionality partially removed |
Stop hooks fire but can't communicate back - making them useless for reminders. Other self-improving skill implementations (autoskill, reflect-skill) also use manual triggering for this reason.
通过Stop钩子进行自动检测并不可靠:
| 问题编号 | 具体问题 |
|---|---|
| #16227 | Stop钩子输出无提示(用户不可见) |
| #10412 | 插件Stop钩子执行失败,退出码为2 |
| #10875 | 插件JSON输出未被捕获 |
| #3656 | 阻塞功能被部分移除 |
Stop钩子会触发但无法回传信息——导致其无法用于提醒。其他自我改进技能实现(如autoskill、reflect-skill)也因此采用手动触发方式。
Process
流程
- Source - Determine conversation source (see Data Sources below)
- Analyze - Find corrections, successes, patterns
- Classify - High/Medium/Low confidence learnings
- Propose - Show suggested skill updates
- Approve - Wait for user confirmation before writing
- 来源 - 确定对话来源(见下方数据源)
- 分析 - 找出修正内容、成功案例、有效模式
- 分类 - 将经验分为高/中/低置信度
- 提议 - 展示建议的技能更新内容
- 确认 - 等待用户确认后再写入文件
Data Sources
数据源
Try sources in order, use first available:
按顺序尝试以下来源,使用第一个可用的:
1. ccrecall.db (Full History)
1. ccrecall.db(完整历史)
If user has ccrecall + mcp-sqlite-tools:
sql
SELECT timestamp, role, content FROM messages
WHERE session_id = (SELECT MAX(session_id) FROM sessions)
ORDER BY timestamp DESC LIMIT 100;如果用户安装了ccrecall + mcp-sqlite-tools:
sql
SELECT timestamp, role, content FROM messages
WHERE session_id = (SELECT MAX(session_id) FROM sessions)
ORDER BY timestamp DESC LIMIT 100;2. In-Context (Current Session)
2. 上下文内(当前会话)
Fallback when ccrecall unavailable:
- Analyze conversation visible in current context window
- Limited to ~100k tokens of recent history
- Still effective for single-session learnings
Note which mode is active:
[reflect] Using: ccrecall.db (full history)
-- or --
[reflect] Using: in-context (current session only)当ccrecall不可用时的备选方案:
- 分析当前上下文窗口中可见的对话内容
- 限制为约10万token的近期历史内容
- 对单会话经验提炼仍然有效
注意当前激活的模式:
[reflect] 使用:ccrecall.db(完整历史)
-- or --
[reflect] 使用:上下文内(仅当前会话)Destination Logic
目标路径逻辑
- In repo with → update skill in-place
.claude-plugin/ - Otherwise → prompt: project or global
.claude/skills/~/.claude/skills/
- 若在包含的仓库中 → 就地更新技能
.claude-plugin/ - 否则 → 提示选择:项目目录下的或全局目录
.claude/skills/~/.claude/skills/
References
参考资料
- analysis-patterns.md - Pattern detection rules
- analysis-patterns.md - 模式检测规则