checkpoint
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSave Memory Checkpoint
保存内存检查点
Save current analysis, findings, and progress to an external memory file to prevent context loss during long-running tasks.
将当前分析结果、发现和进度保存到外部内存文件,防止长时间运行任务期间丢失上下文。
Summary
摘要
Goal: Persist current task context, findings, and progress to a checkpoint file for recovery after context compaction.
| Step | Action | Key Notes |
|---|---|---|
| 1 | Determine location | Filename: |
| 2 | Gather context | Task, findings, files analyzed/modified, progress, decisions |
| 3 | Write checkpoint file | Structured markdown with recovery instructions |
| 4 | Update todo list | Mark checkpoint creation complete |
Key Principles:
- Save checkpoints every 30-60 minutes during complex tasks
- Include file paths, line numbers, and exact findings -- be specific
- Always include recovery instructions for easy task resumption
目标: 持久化保存当前任务上下文、发现和进度到检查点文件,以便在上下文压缩后恢复。
| 步骤 | 操作 | 关键说明 |
|---|---|---|
| 1 | 确定存储位置 | 文件名: |
| 2 | 收集上下文 | 任务、发现、已分析/修改的文件、进度、决策 |
| 3 | 写入检查点文件 | 带有恢复说明的结构化markdown |
| 4 | 更新待办列表 | 标记检查点创建完成 |
核心原则:
- 执行复杂任务时每30-60分钟保存一次检查点
- 包含文件路径、行号和确切发现——内容要具体
- 始终包含恢复说明,方便后续恢复任务
Usage
使用场景
Use this command when:
- Working on complex multi-step tasks (investigation, planning, implementation)
- Before expected context compaction
- At key milestones during feature development
- After completing significant analysis phases
在以下情况使用本命令:
- 处理复杂的多步骤任务时(调研、规划、实现)
- 预计会发生上下文压缩之前
- 功能开发的关键里程碑节点
- 完成重要的分析阶段之后
Checkpoint File Location
检查点文件存储位置
Files are saved to:
plans/reports/checkpoint-{timestamp}-{slug}.md文件保存到:
plans/reports/checkpoint-{timestamp}-{slug}.mdInstructions
使用说明
Create a checkpoint file with the following structure:
按照以下结构创建检查点文件:
Step 1: Determine Checkpoint Location
步骤1:确定检查点存储位置
bash
undefinedbash
undefinedGet current date for filename
Get current date for filename
date +%y%m%d-%H%M
undefineddate +%y%m%d-%H%M
undefinedStep 2: Gather Context
步骤2:收集上下文
Collect and document:
- Current Task - What are you working on?
- Key Findings - What have you discovered?
- Files Analyzed - Which files have been read/modified?
- Progress Summary - What's completed vs remaining?
- Important Context - Critical information to preserve
- Next Steps - What should be done next?
- Open Questions - Unresolved issues
收集并记录:
- 当前任务 - 你正在处理什么工作?
- 关键发现 - 你有什么新发现?
- 已分析文件 - 哪些文件已被读取/修改?
- 进度汇总 - 已完成和待完成的工作分别是什么?
- 重要上下文 - 需要留存的关键信息
- 后续步骤 - 接下来要做什么?
- 待解决问题 - 尚未解决的问题
Step 3: Write Checkpoint File
步骤3:写入检查点文件
Create a markdown file at with:
plans/reports/checkpoint-YYMMDD-HHMM-{task-slug}.mdmarkdown
undefined在路径下创建markdown文件,内容如下:
plans/reports/checkpoint-YYMMDD-HHMM-{task-slug}.mdmarkdown
undefinedMemory Checkpoint: [Task Description]
Memory Checkpoint: [Task Description]
Checkpoint created to preserve analysis context during [task type].
Checkpoint created to preserve analysis context during [task type].
Session Info
Session Info
- Created: [timestamp]
- Task: [description]
- Branch: [git branch]
- Phase: [current phase]
- Created: [timestamp]
- Task: [description]
- Branch: [git branch]
- Phase: [current phase]
Current Task Summary
Current Task Summary
[Brief description of what you're working on]
[Brief description of what you're working on]
Key Findings
Key Findings
Analysis Results
Analysis Results
- [Finding 1]
- [Finding 2]
- [Finding N]
- [Finding 1]
- [Finding 2]
- [Finding N]
Patterns Discovered
Patterns Discovered
- [Pattern 1]
- [Pattern 2]
- [Pattern 1]
- [Pattern 2]
Dependencies Identified
Dependencies Identified
- [Dependency 1]
- [Dependency 2]
- [Dependency 1]
- [Dependency 2]
Files Context
Files Context
Analyzed Files
Analyzed Files
| File | Purpose | Relevance |
|---|---|---|
| path/to/file.cs | [purpose] | High/Medium/Low |
| File | Purpose | Relevance |
|---|---|---|
| path/to/file.cs | [purpose] | High/Medium/Low |
Modified Files
Modified Files
- - [change description]
path/to/modified.ts
- - [change description]
path/to/modified.ts
Pending Files
Pending Files
- - [why pending]
path/to/pending.cs
- - [why pending]
path/to/pending.cs
Progress Summary
Progress Summary
Completed
Completed
- [Completed item 1]
- [Completed item 2]
- [Completed item 1]
- [Completed item 2]
In Progress
In Progress
- [Current item]
- [Current item]
Remaining
Remaining
- [Remaining item 1]
- [Remaining item 2]
- [Remaining item 1]
- [Remaining item 2]
Important Context
Important Context
Critical Information
Critical Information
[Information that must not be lost]
[Information that must not be lost]
Assumptions Made
Assumptions Made
- [Assumption 1]
- [Assumption 2]
- [Assumption 1]
- [Assumption 2]
Decisions Made
Decisions Made
- [Decision 1] - [rationale]
- [Decision 2] - [rationale]
- [Decision 1] - [rationale]
- [Decision 2] - [rationale]
Next Steps
Next Steps
- [Immediate next action]
- [Following action]
- [Subsequent action]
- [Immediate next action]
- [Following action]
- [Subsequent action]
Open Questions
Open Questions
- [Question 1]
- [Question 2]
- [Question 1]
- [Question 2]
Recovery Instructions
Recovery Instructions
To resume this task after context reset:
- Read this checkpoint file
- Review [specific files] for context
- Continue from [specific point]
Checkpoint saved by Claude Code at [timestamp]
undefinedTo resume this task after context reset:
- Read this checkpoint file
- Review [specific files] for context
- Continue from [specific point]
Checkpoint saved by Claude Code at [timestamp]
undefinedStep 4: Update Todo List
步骤4:更新待办列表
Update your todo list to reflect checkpoint was created:
- [x] Create memory checkpoint at [timestamp]更新你的待办列表,标记检查点已创建:
- [x] Create memory checkpoint at [timestamp]Best Practices
最佳实践
- Save checkpoints frequently - Every 30-60 minutes during complex tasks
- Be specific - Include file paths, line numbers, exact findings
- Document decisions - Record why choices were made
- Link related files - Reference other analysis documents
- Include recovery steps - Make resumption easy
- 频繁保存检查点 - 处理复杂任务时每30-60分钟保存一次
- 内容具体 - 包含文件路径、行号、确切的发现结果
- 记录决策 - 记录做出各项选择的原因
- 关联相关文件 - 引用其他分析文档
- 包含恢复步骤 - 方便后续恢复任务
Related Commands
相关命令
- - Load project context
/context - - Manually trigger context compaction
/compact - - Generate progress summary
/watzup
- - 加载项目上下文
/context - - 手动触发上下文压缩
/compact - - 生成进度汇总
/watzup
IMPORTANT Task Planning Notes
重要任务规划说明
- Always plan and break many small todo tasks
- Always add a final review todo task to review the works done at the end to find any fix or enhancement needed
- 始终将任务拆解为多个小型待办事项
- 始终添加最终复盘待办项,在任务末尾回顾已完成工作,查找需要修复或优化的内容