Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

recall

召回:重建近期工作上下文

Before you start or resume work, you rebuild the user’s recent working context and hand back a tight capsule of where things stand now and what to do next.

开工或续工前,重建用户近期工作上下文,交回紧凑胶囊:现状如何、下一步做什么。

Keep it tight and on-topic. Read only what the in-scope threads need, then stop.

保持紧凑、切题。只读范围内线程需要的,然后停。

Your context lives in two records. Your own chat history holds what you did and decided. The shared record holds everything that happened around the same code under other names: the symptoms users keep reporting, the fixes that shipped and got reverted, the errors still firing in prod. That second record is what the why skill searches, across source control, the issue tracker, chat and issue channels, long-form docs, and error tracking. A feature with a long bug tail keeps most of its story there, so don’t reconstruct it from your transcripts alone.

你的上下文活在两份记录里。自己的聊天历史装着你做了什么、决定了什么。共享记录装着同一代码在别的名字下发生的一切:用户反复报告的症状、已合入又回滚的修复、生产里仍在响的错误。第二份记录是 why skill 搜的:源控、issue tracker、聊天与工单频道、长文文档、错误追踪。有长 bug 尾巴的功能,故事大半在那里,别只靠自己的 transcript 重建。

Transcripts live at ~/.cursor/projects/<slug>/agent-transcripts/<uuid>/<uuid>.jsonl, where <slug> is the workspace path with the leading slash dropped and each “/” turned into “-” (so /Users/you/proj becomes Users-you-proj). Every line is one chat message.

Transcript 在 ~/.cursor/projects/<slug>/agent-transcripts/<uuid>/<uuid>.jsonl,<slug> 是去掉前导斜杠、把 / 换成 - 的工作区路径(如 /Users/you/proj → Users-you-proj)。每行一条聊天消息。

  1. Classify, then route. One specific prior chat to resume is the session-pickup playbook, not this. Turning habits into a durable skill is automate-me. A human-readable summary of your work is a different task. Recall loads working context across recent chats before you act. If the user already gave you a full state capsule (paths, branch, the change), use it and skip the mining.

  2. Lock the scope before searching. Pin the window (“recent” is a real range, default the last 7 days), the topic if named, and the workspace (default the active one. Never read another project’s transcripts without being asked). State the scope back. Never quietly turn “all” into “recent N”.

  3. Fan out across your chat history. Spawn parallel subagents on a fast, cheap model, each taking a slice of the corpus. Tell every subagent to order candidates by real modification time (ls -t) and never by UUID name, grep the topic first and then read only the matching chats and only their relevant regions, and skip the current chat plus obvious noise (subagent, eval, and test chats). Each returns the same schema, one block per chat: topic, the user’s goal, decisions, open threads, struggles and corrections, and artifacts (PRs, tickets, branches), each citing the chat UUID. For one or two chats, skip the fan-out and search directly. The raw transcripts stay in the subagents. The main thread gets only their findings.

  4. Sweep the shared record whenever the topic names a feature, file, subsystem, area, or bug. This is the default, not a judgment call, and “my work on X” does not exempt it. Hand it to the why skill’s source investigators, but steer their question from “why was this built this way” to “what’s the current state, what’s been tried and didn’t hold, and what are users still reporting”. Reuse its per-source playbooks, run the investigators in parallel with the chat-history mining, and inherit its posture: one investigator per source, null results are findings, skip an unavailable MCP and say so. Fold what comes back into the brief. Skip this step only for pure activity recall with no named target (“what did I do this week”), where your own history and live state are the entire answer.

  5. Verify against live state. Take the PRs, branches, and tickets that the mining and the sweep surfaced and check them with git and gh. When the answer hinges on what an agent actually did (the tools it ran, files it read, errors it hit), read the full transcript, not just a trimmed local copy.

  6. Write the brief to the contract below. Group by thread. Stay on the named topic.

  7. 先分类再路由。续某一条具体旧聊天是 session-pickup playbook,不是本 skill。把习惯变成持久 skill 是 automate-me。给人看的工作摘要是另一任务。Recall 是在行动前跨近期聊天加载工作上下文。用户已给完整状态胶囊(路径、分支、改动)就用它,跳过挖掘。

  8. 搜索前锁范围。钉死窗口(「recent」是真实区间,默认最近 7 天)、若点名则钉主题、钉工作区(默认当前;没被要求别读别项目 transcript)。把范围复述回去。别悄悄把「全部」收成「最近 N」。

  9. 对聊天历史扇出。在又快又便宜的模型上 spawn 并行 subagent,各拿语料一片。告诉每个 subagent:按真实修改时间排序(ls -t),绝不按 UUID 名;先 grep 主题再只读匹配聊天及其相关区域;跳过当前聊天和明显噪声(subagent、eval、测试聊天)。各返回同一 schema,每聊天一块:主题、用户目标、决策、开放线程、挣扎与纠正、产物(PR、工单、分支),每项引用聊天 UUID。一两段聊天就跳过扇出、直接搜。原始 transcript 留在 subagent;主线程只要发现。

  10. 主题点名了功能、文件、子系统、区域或 bug 时,扫共享记录。这是默认,不是判断题,「我在 X 上的工作」也不豁免。交给 why skill 的 source investigators,但把问题从「为什么建成这样」拧成「现状如何、试过什么没站住、用户还在报什么」。复用其按源 playbook,与聊天历史挖掘并行跑,继承姿态:每源一个 investigator、空结果也是发现、不可用 MCP 就跳过并说明。把回来的折进简报。仅纯活动召回、无点名目标时跳过(「这周我干了啥」),那时自己的历史与 live 状态就是全部答案。

  11. 对照 live 状态验证。把挖掘与扫描挖出的 PR、分支、工单用 git 和 gh 核对。答案取决于 agent 实际做了什么(跑了哪些工具、读了哪些文件、撞了哪些错)时,读完整 transcript,不只裁剪本地副本。

  12. 按下面契约写简报。按线程分组。钉在点名主题上。

Output contract

输出契约

Lead with the capsule, then the thread status, then the problems, then the next move. Deeper detail goes below or gets cut.

先胶囊,再线程状态,再问题,再下一步。更深细节放下面或砍掉。

  • Capsule. At most 5 bullets. What this work is and where it stands overall.

  • Threads. One line each, prefixed with exactly one status tag: [merged #N], [open PR #N], [in flight <branch>], [verified, uncommitted], [reverted #N], or [planned, not started]. A thread with no tag is not done yet, so tag it.

  • Problems. At most 5, the recurring ones. Include the symptoms users keep reporting and any fix that shipped and was reverted, so the next attempt starts where the last one failed.

  • Next move. The single most useful next action, concrete.

  • Capsule。 最多 5 条子弹。这活是什么、整体停在哪。

  • Threads。 每线程一行,前缀恰好一个状态标签:[merged #N]、[open PR #N]、[in flight <branch>]、[verified, uncommitted]、[reverted #N] 或 [planned, not started]。没标签的线程不算做完,所以要标。

  • Problems。 最多 5 条反复出现的。含用户反复报的症状、以及已合入又回滚的修复,让下次尝试从上次失败处起步。

  • Next move。 最有用的下一步,具体。

An adjacent feature or ticket stays out unless it blocks this one. When the capsule and thread lines outgrow a screen, cut detail before you cut threads. Write the brief through the unslop skill, cite chat findings by UUID and shared-record findings by their source (PR #, ticket ID, chat permalink, error-tracker issue), and sanitize private context before any public output.

相邻功能或工单挡不了本活就别塞进来。胶囊和线程行超出一屏时,先砍细节再砍线程。经 unslop 写简报;聊天发现引 UUID,共享记录发现引来源(PR #、工单 ID、聊天永久链接、错误追踪 issue);任何公开输出前净化隐私上下文。

Reply: the brief, to the contract above.

回复: 按上面契约的简报。