handoff

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Handoff

会话交接

Generate a bootstrap prompt that enables seamless conversation continuity in a new session.
生成引导提示词,实现在新会话中无缝延续对话。

Process

流程

1. Analyze Current Session

1. 分析当前会话

Identify and categorize:
  • Goal state: What is the user trying to accomplish? What's the end state?
  • Current progress: What's been done? What's working?
  • Blockers/open questions: What's unresolved? What decisions are pending?
  • Key artifacts: Files modified, commands run, errors encountered
  • Critical context: Domain knowledge, constraints, or preferences established
识别并分类以下内容:
  • 目标状态:用户想要完成什么?最终状态是什么?
  • 当前进度:已经完成了哪些工作?哪些内容是可行的?
  • 障碍/待解决问题:哪些问题尚未解决?哪些决策有待确定?
  • 关键工件:修改过的文件、执行过的命令、遇到的错误
  • 关键上下文:已确立的领域知识、约束条件或偏好

2. Apply Token Efficiency Heuristics

2. 应用Token优化策略

Include:
  • Specific file paths, function names, error messages (hard to rediscover)
  • Decisions made and their rationale (prevents re-discussion)
  • Current hypothesis or approach being tested
  • Exact reproduction steps for bugs
Exclude:
  • General knowledge Claude already has
  • Verbose explanations of standard concepts
  • Full file contents (use paths + line numbers instead)
  • Conversation pleasantries or meta-discussion
Compress:
  • Use bullet points over prose
  • Reference files by path, not content
  • Summarize long error traces to key lines
  • Use "established: X" for agreed-upon decisions
需包含的内容
  • 具体文件路径、函数名称、错误信息(这些内容难以重新获取)
  • 已做出的决策及其理由(避免重复讨论)
  • 当前正在测试的假设或方法
  • 错误的精确复现步骤
需排除的内容
  • Claude已具备的通用知识
  • 对标准概念的冗长解释
  • 完整文件内容(改用路径+行号替代)
  • 对话中的客套话或元讨论内容
压缩技巧
  • 使用项目符号而非段落文本
  • 通过路径引用文件,而非内容
  • 将冗长的错误追踪信息总结为关键行
  • 对已达成共识的决策使用“已确立:X”的格式

3. Structure the Bootstrap Prompt

3. 构建引导提示词结构

markdown
undefined
markdown
undefined

Context

上下文

[1-2 sentence goal statement]
[1-2句话的目标说明]

Progress

进度

  • [Completed item with outcome]
  • [Completed item with outcome]
  • [已完成事项及结果]
  • [已完成事项及结果]

Current State

当前状态

[What's happening right now - the exact point to resume from]
[当前的具体情况 - 即需要从中恢复的精确节点]

Key Files

关键文件

  • path/to/file.ext
    - [role/status]
  • path/to/file.ext
    - [作用/状态]

Open Items

待办事项

  • [Next immediate action]
  • [Subsequent action]
  • [下一步立即行动]
  • [后续行动]

Constraints/Decisions

约束条件/已做决策

  • [Established constraint or decision]
undefined
  • [已确立的约束条件或决策]
undefined

4. Output

4. 输出

Copy the bootstrap prompt to clipboard using:
bash
echo "PROMPT_CONTENT" | pbcopy  # macOS
Confirm with: "Bootstrap prompt copied to clipboard. Paste it to start a new session."
使用以下命令将引导提示词复制到剪贴板:
bash
echo "PROMPT_CONTENT" | pbcopy  # macOS
复制完成后确认提示:“引导提示词已复制到剪贴板。粘贴即可启动新会话。”

Adaptive Sizing

自适应调整

Simple tasks (bug fix, small feature): 100-200 tokens
  • Goal, current file, error/behavior, next step
Medium tasks (feature implementation, refactor): 200-400 tokens
  • Goal, progress list, current state, key files, next steps
Complex tasks (architecture, multi-system): 400-800 tokens
  • Full structure above, plus constraints and decision rationale
简单任务(bug修复、小型功能开发):100-200 tokens
  • 包含目标、当前文件、错误/行为、下一步操作
中等任务(功能实现、重构):200-400 tokens
  • 包含目标、进度列表、当前状态、关键文件、下一步操作
复杂任务(架构设计、多系统协作):400-800 tokens
  • 包含上述完整结构,外加约束条件和决策理由

Example Output

示例输出

markdown
undefined
markdown
undefined

Context

上下文

Adding OAuth login to the Express app, Google provider first.
为Express应用添加OAuth登录功能,优先实现Google提供商。

Progress

进度

  • Installed passport, passport-google-oauth20
  • Created
    src/auth/google.ts
    with strategy config
  • Added
    /auth/google
    and
    /auth/google/callback
    routes
  • 已安装passport、passport-google-oauth20
  • 已创建
    src/auth/google.ts
    并配置策略
  • 已添加
    /auth/google
    /auth/google/callback
    路由

Current State

当前状态

Callback route returns "Failed to serialize user into session" - need to implement serializeUser/deserializeUser in passport config.
回调路由返回“Failed to serialize user into session”错误 - 需要在passport配置中实现serializeUser/deserializeUser方法。

Key Files

关键文件

  • src/auth/google.ts
    - strategy setup (working)
  • src/routes/auth.ts:45
    - callback handler (error here)
  • src/app.ts
    - passport.initialize() added, missing session serialize
  • src/auth/google.ts
    - 策略配置(可用)
  • src/routes/auth.ts:45
    - 回调处理程序(此处出错)
  • src/app.ts
    - 已添加passport.initialize(),缺少会话序列化配置

Open Items

待办事项

  • Add serialize/deserialize to passport config
  • Test full OAuth flow
  • Add session persistence (currently memory store)
  • 为passport配置添加序列化/反序列化方法
  • 测试完整OAuth流程
  • 添加会话持久化(当前为内存存储)

Constraints

约束条件

  • Using express-session with default memory store for now
  • Google OAuth credentials in .env (GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET)
undefined
  • 目前使用express-session的默认内存存储
  • Google OAuth凭据存储在.env文件中(GOOGLE_CLIENT_ID、GOOGLE_CLIENT_SECRET)
undefined