reflect

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Reflect

复盘

Extract learnings from sessions and persist to skill files.
从会话中提炼经验并保存至技能文件。

When to Reflect

何时进行复盘

Run
/reflect
after sessions with:
  • 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 updates
Note: 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:
IssueProblem
#16227Stop hook output is silent (not shown to user)
#10412Plugin Stop hooks fail with exit code 2
#10875Plugin JSON output not captured
#3656Blocking 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钩子进行自动检测并不可靠:
问题编号具体问题
#16227Stop钩子输出无提示(用户不可见)
#10412插件Stop钩子执行失败,退出码为2
#10875插件JSON输出未被捕获
#3656阻塞功能被部分移除
Stop钩子会触发但无法回传信息——导致其无法用于提醒。其他自我改进技能实现(如autoskill、reflect-skill)也因此采用手动触发方式。

Process

流程

  1. Source - Determine conversation source (see Data Sources below)
  2. Analyze - Find corrections, successes, patterns
  3. Classify - High/Medium/Low confidence learnings
  4. Propose - Show suggested skill updates
  5. Approve - Wait for user confirmation before writing
  1. 来源 - 确定对话来源(见下方数据源)
  2. 分析 - 找出修正内容、成功案例、有效模式
  3. 分类 - 将经验分为高/中/低置信度
  4. 提议 - 展示建议的技能更新内容
  5. 确认 - 等待用户确认后再写入文件

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
    .claude-plugin/
    → update skill in-place
  • Otherwise → prompt: project
    .claude/skills/
    or global
    ~/.claude/skills/
  • 若在包含
    .claude-plugin/
    的仓库中 → 就地更新技能
  • 否则 → 提示选择:项目目录下的
    .claude/skills/
    或全局目录
    ~/.claude/skills/

References

参考资料

  • analysis-patterns.md - Pattern detection rules
  • analysis-patterns.md - 模式检测规则