ruminate

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Ruminate

Ruminate

Mine conversation history for brain-worthy knowledge that was never captured. Complements
reflect
(current session) and
meditate
(brain vault audit) by looking at the full archive of past conversations across both providers.
挖掘对话历史中值得存入brain的未被捕获的知识。该功能通过查看两个提供商的全部过往对话存档,对
reflect
(当前会话反思)和
meditate
(brain库审计)形成补充。

Process

流程

Use Tasks to track progress. Create a task for each step below (TaskCreate), mark each in_progress when starting and completed when done (TaskUpdate). Check TaskList after each step.
使用Tasks功能跟踪进度。 为以下每个步骤创建一个任务(TaskCreate),开始时标记为进行中,完成时标记为已完成(TaskUpdate)。每完成一步后检查TaskList。

1. Read the brain

1. 读取brain

Build a brain snapshot:
sh .claude/skills/meditate/scripts/snapshot.sh brain/ /tmp/brain-snapshot-ruminate.md
. Pass the snapshot path to each analysis agent. This avoids loading the full brain into the ruminate orchestrator's context.
构建brain快照:
sh .claude/skills/meditate/scripts/snapshot.sh brain/ /tmp/brain-snapshot-ruminate.md
。将快照路径传递给每个分析Agent。这样可以避免将完整的brain加载到ruminate编排器的上下文中。

2. Locate conversations

2. 定位对话

Find both provider roots:
  1. Claude project directory:
    ~/.claude/projects/-<cwd-with-dashes-replacing-slashes>/
  2. Codex sessions root:
    ~/.codex/sessions/
For example,
/Users/lauren/code/noodle
maps to
~/.claude/projects/-Users-lauren-code-noodle/
for Claude and uses
~/.codex/sessions/
for Codex.
找到两个提供商的根目录:
  1. Claude项目目录:
    ~/.claude/projects/-<cwd-with-dashes-replacing-slashes>/
  2. Codex会话根目录:
    ~/.codex/sessions/
例如,
/Users/lauren/code/noodle
对应的Claude目录为
~/.claude/projects/-Users-lauren-code-noodle/
,对应的Codex目录为
~/.codex/sessions/
。

3. Extract conversations

3. 提取对话

Run the extraction script to parse both JSONL formats into readable text and split into batches:
bash
SKILL_DIR="$(dirname "$(realpath "$0")")/.."  # adjust path as needed
CLAUDE_DIR="$HOME/.claude/projects/-<project-slug>"
CODEX_DIR="$HOME/.codex/sessions"
OUT_DIR="/tmp/ruminate-$(date +%s)"

python3 "$SKILL_DIR/scripts/extract-conversations.py" "$OUT_DIR" \
  --claude-dir "$CLAUDE_DIR" \
  --codex-dir "$CODEX_DIR" \
  --cwd "$PWD" \
  --batches N
Choose N based on total extracted conversations (Claude + Codex): ~1 batch per 20 conversations, minimum 2, maximum 10.
运行提取脚本,将两种JSONL格式解析为可读文本并拆分为批次:
bash
SKILL_DIR="$(dirname "$(realpath "$0")")/.."  # adjust path as needed
CLAUDE_DIR="$HOME/.claude/projects/-<project-slug>"
CODEX_DIR="$HOME/.codex/sessions"
OUT_DIR="/tmp/ruminate-$(date +%s)"

python3 "$SKILL_DIR/scripts/extract-conversations.py" "$OUT_DIR" \
  --claude-dir "$CLAUDE_DIR" \
  --codex-dir "$CODEX_DIR" \
  --cwd "$PWD" \
  --batches N
根据提取的对话总数(Claude + Codex)选择N值:每20条对话约1个批次,最少2个,最多10个。

4. Spawn analysis team

4. 生成分析团队

Create an agent team (TeamCreate) with N agents (one per batch, matching the batch count from step 3), each with
subagent_type: general-purpose
and
model: opus
. Run all N in parallel.
Each agent's prompt should include:
  • The batch manifest path (
    $OUT_DIR/batches/batch_N.txt
    )
  • The output path (
    $OUT_DIR/findings_N.md
    )
  • The list of topics already captured in the brain (compiled from step 1) — so agents skip known knowledge
  • A reminder that each extracted file includes provider/source metadata headers (
    [PROVIDER]
    ,
    [CWD]
    ,
    [SOURCE_FILE]
    ) and should be used as evidence context
  • Instructions to extract from each conversation:
    • User corrections: times the user corrected the assistant's approach, code, or understanding
    • Recurring preferences: things the user explicitly asked for or pushed back on repeatedly
    • Technical learnings: codebase-specific knowledge, gotchas, patterns discovered
    • Workflow patterns: how the user prefers to work
    • Frustrations: friction points, wasted effort, things that went wrong
    • Skills wished for: capabilities the user expressed wanting
Agents write structured findings to their output files.
创建一个包含N个Agent的团队(TeamCreate),每个批次对应一个Agent(与第3步的批次数量一致),每个Agent的配置为
subagent_type: general-purpose
、
model: opus
。并行运行所有N个Agent。
每个Agent的提示词应包含:
  • 批次清单路径(
    $OUT_DIR/batches/batch_N.txt
    )
  • 输出路径(
    $OUT_DIR/findings_N.md
    )
  • brain中已捕获的主题列表(由第1步整理)—— 以便Agent跳过已知知识
  • 提醒:每个提取的文件都包含提供商/来源元数据头(
    [PROVIDER]
    、
    [CWD]
    、
    [SOURCE_FILE]
    ),应作为证据上下文使用
  • 从每条对话中提取以下内容的指令:
    • 用户修正:用户纠正助手的方法、代码或理解的场景
    • 重复出现的偏好:用户明确要求或反复反对的内容
    • 技术收获:特定代码库的知识、坑点、发现的模式
    • 工作流模式:用户偏好的工作方式
    • 痛点:摩擦点、无效努力、出问题的地方
    • 期望的技能:用户表达过想要的功能
Agent将结构化的发现写入各自的输出文件。

5. Synthesize

5. 综合整理

After all agents complete, read all findings files. Cross-reference with existing brain content. Deduplicate across batches.
Filter by frequency and impact. Most findings won't be worth adding. Apply these filters before presenting:
  • Frequency: Did this come up in multiple conversations, or was the user correcting the same mistake repeatedly? One-off corrections are usually not worth a brain entry — the brain should capture patterns, not incidents.
  • Factual accuracy: Is something in the brain now wrong? (e.g. a rule was disabled but the brain still documents it as active). These are always worth fixing regardless of frequency.
  • Impact: Would failing to capture this cause repeated wasted effort in future sessions? A gotcha that cost 5 minutes once is low-impact. A pattern that caused 3 rounds of corrections is high-impact.
Discard aggressively. It's better to present 3 high-signal findings than 9 that include noise. If a finding only happened once and isn't a factual correction, skip it.
所有Agent完成后,读取所有发现文件,与现有brain内容交叉比对,跨批次去重。
按频率和影响筛选。 大多数发现都不值得添加。展示前应用以下筛选条件:
  • 频率:该问题是否在多次对话中出现,或者用户是否反复纠正同一个错误?一次性的修正通常不值得存入brain——brain应该记录模式,而非单个事件。
  • 事实准确性:brain中是否有内容现在已经错误?(例如,某个规则已被禁用,但brain中仍记录为有效)。无论频率如何,这类问题都值得修复。
  • 影响:如果不捕获该内容,是否会在未来会话中导致重复的无效努力?一个只耽误过5分钟的坑点是低影响的,而一个导致3轮修正的模式则是高影响的。
大胆舍弃。 与其展示9条包含噪音的发现,不如呈现3条高价值的发现。如果某条发现只出现过一次且不是事实修正,直接跳过。

6. Present and apply

6. 展示与应用

Present findings to the user in a table with columns: finding, frequency/evidence, and proposed action. Be honest about which findings are one-offs vs. recurring patterns — let the user decide what's worth adding.
Route skill-specific learnings. Check if any findings are about how a specific skill should work — its process, prompts, edge cases, or troubleshooting. Update the skill's SKILL.md or references/ directly. Read the skill first to avoid duplicating or contradicting existing content.
Apply only the changes the user approves. Follow brain writing conventions:
  • One topic per file, organized in directories
  • Use
    [[wikilinks]]
    to connect related notes
  • Update
    brain/index.md
    after all changes
  • Default to updating existing notes over creating new ones
以表格形式向用户展示发现,列包括:发现内容、频率/证据、建议操作。如实说明哪些发现是一次性事件,哪些是重复出现的模式——让用户决定哪些值得添加。
归类特定技能的收获。 检查是否有关于特定技能应如何运作的发现——包括其流程、提示词、边界情况或故障排除。直接更新该技能的SKILL.md或references/目录。先阅读现有技能内容,避免与已有内容重复或矛盾。
仅应用用户批准的更改。遵循brain编写规范:
  • 每个文件一个主题,按目录组织
  • 使用
    [[wikilinks]]
    连接相关笔记
  • 所有更改完成后更新
    brain/index.md
  • 优先更新现有笔记,而非创建新笔记

7. Clean up

7. 清理

Remove the temporary extraction directory:
bash
rm -rf "$OUT_DIR"
删除临时提取目录:
bash
rm -rf "$OUT_DIR"

Guidelines

准则

  • Filter aggressively. Most conversations will have low signal — automated tasks, trivial exchanges, already-captured knowledge. Only surface what's genuinely new and impactful.
  • Prefer reduction. If a finding is a special case of an existing brain principle, update the existing note rather than creating a new one.
  • Quote the user. When a finding stems from a direct user correction, include the user's words and source file path — they carry the most signal about what matters.
  • Shut down agents when analysis is complete. Don't leave them idle.
  • 大胆筛选。 大多数对话的信号价值很低——自动化任务、琐碎交流、已捕获的知识。只呈现真正新颖且有影响力的内容。
  • 优先精简。 如果某条发现是现有brain原则的特例,更新现有笔记而非创建新笔记。
  • 引用用户原话。 如果发现来自用户的直接修正,附上用户的原话和源文件路径——这些内容最能体现什么是重要的。
  • 分析完成后关闭Agent,不要让它们闲置。