关于 hindsight-cloud
hindsight-cloud 是使用 Hindsight Cloud 作为团队共享持久记忆的 Agent 技能。它指导 Agent 通过 Hindsight 命令行保存团队知识并检索相关上下文。
主要功能
- 01保存团队共享记忆
- 02任务前检索上下文
- 03通过 reflect 综合记忆
- 04指导 Cloud 命令行配置
- 05注明个人偏好归属
适用场景
- 01保存共享项目约定
- 02记录团队流程和修复方法
- 03为团队成员检索代码库上下文
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ vectorize-io/ hindsight --skill hindsight-cloud安装后在 Claude Code 中输入/hindsight-cloud确认已加载。
详细介绍
Hindsight 记忆技能(云端)
你通过 Hindsight Cloud 拥有持久记忆。这个记忆库是与团队共享的,因此存储在这里的知识会让所有参与此代码库工作的人受益。
主动存储团队知识并召回上下文,以提供更好的协助。
设置检查(仅首次)
在使用记忆命令之前,请确认 Hindsight CLI 已配置:
cat ~/.hindsight/config
如果该文件不存在或缺少凭据,帮助用户完成设置:
-
安装 CLI(如果找不到
hindsight命令):curl -fsSL https://hindsight.vectorize.io/get-cli | bash -
创建配置文件 — 询问用户的 API Key(从 https://ui.hindsight.vectorize.io 获取):
mkdir -p ~/.hindsight cat > ~/.hindsight/config << 'EOF' api_url = "https://api.hindsight.vectorize.io" api_key = "<user's API key>" EOF chmod 600 ~/.hindsight/config -
获取 bank ID — 询问用户其团队的 bank ID(例如
team-myproject)
设置完成后,在以下所有命令中使用该 bank ID。
Hindsight 的工作原理
当你调用 retain 时,Hindsight 不会按原样存储字符串。服务端会运行一条内部流水线,它会:
- 提取结构化事实,使用大模型从内容中提取
- 识别实体(人物、工具、概念)并关联相关事实
- 构建事实之间的时间与因果关系
- 生成嵌入,用于语义搜索
这意味着你应该传入丰富、包含完整上下文的内容——服务端比预先总结过的字符串更擅长提取关键信息。你的职责是决定何时存储,而不是提取什么。
命令
将 <bank-id> 替换为用户实际的 bank ID(例如 team-frontend)。
存储记忆
使用 memory retain 存储你学到的内容。传入完整上下文——原始观察、会话笔记或详细描述:
hindsight memory retain <bank-id> "The project uses ESLint configured with the Airbnb rule set and Prettier for formatting. Auto-fix on save is enabled in the editor config."
hindsight memory retain <bank-id> "Ran the test suite with NODE_ENV=test. Tests pass. Without NODE_ENV=test, the suite fails with a missing config error." --context procedures
hindsight memory retain <bank-id> "Build failed on Node 18 with error 'ERR_UNSUPPORTED_ESM_URL_SCHEME'. Switched to Node 20 and build succeeded." --context learnings
hindsight memory retain <bank-id> "Alice reviewed the PR and asked for verbose commit messages that explain the motivation, not just what changed." --context preferences
你也可以传入带时间戳的原始对话记录:
hindsight memory retain <bank-id> "[2026-03-16T10:12:03] User: The auth tests keep failing on CI but pass locally. Any idea?
[2026-03-16T10:12:45] Assistant: Let me check the CI logs. Looks like the tests are running without the TEST_DATABASE_URL env var set — they fall back to the production DB URL and hit a connection timeout.
[2026-03-16T10:13:20] User: Ah right, I never added that to the CI secrets. Adding it now.
[2026-03-16T10:15:02] User: That fixed it. All green now." --context learnings
召回记忆
在开始任务之前使用 memory recall 获取相关上下文:
hindsight memory recall <bank-id> "project conventions and coding standards"
hindsight memory recall <bank-id> "Alice preferences for this project"
hindsight memory recall <bank-id> "what issues have we encountered before"
hindsight memory recall <bank-id> "how does the auth module work"
反思记忆
使用 memory reflect 综合上下文:
hindsight memory reflect <bank-id> "How should I approach this task based on past experience?"
重要:何时存储记忆
这是一个共享的团队记忆库。存储对团队有益的知识。对于个人偏好,请包含该人员的姓名。
项目/团队约定(共享)
- 编码规范("项目使用 2 空格缩进")
- 必需的工具和版本("项目需要 Node 20+、PostgreSQL 15+")
- Lint 和格式化规则("ESLint 使用 Airbnb 配置")
- 测试约定("集成测试需要 Docker 处于运行状态")
- 分支命名和 PR 约定
个人偏好(归属于个人)
- 个人编码风格("Alice 偏好显式类型注解")
- 沟通偏好("Bob 偏好详细的 PR 描述")
- 工具偏好("Carol 使用 vim 键位绑定")
流程结果
- 成功完成任务的步骤
- 有效(或失败)的命令及其原因
- 发现的变通方法
- 解决问题的配置
任务中的经验教训
- 遇到的 Bug 及其解决方案
- 有效的性能优化
- 架构决策及其理由
- 依赖项或版本要求
团队知识
- 新团队成员的入职信息
- 常见陷阱及如何避免
- 架构决策及其理由
- 与外部系统的集成点
- 领域知识和业务逻辑说明
重要:何时召回记忆
始终召回,在以下情况之前:
- 开始任何非平凡任务
- 做出关于实现的决策
- 建议工具、库或方法
- 在项目的新领域编写代码
- 回答关于代码库的问题
- 当团队成员询问某些东西如何工作时
最佳实践
- 立即存储:当你发现某些内容时,立即将其存储起来
- 传递丰富的上下文:包含完整的观察结果,而不是预先总结的字符串——服务会自动提取事实
- 包含结果:存储发生了什么以及为什么,包括失败和解决方法
- 先回忆:在开始工作之前,始终检查相关上下文
- 以团队为先:存储能帮助其他团队成员的知识
- 归属个人偏好:存储“Alice 审查了 PR 并要求 X”,而不仅仅是“用户偏好 X”
- 区分项目与个人:项目约定适用于所有人;个人偏好因人而异
- 使用
--context表示元数据:--context标志用于标记记忆的类型(例如procedures、learnings、preferences),而不是替代完整内容