checkpoint

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Save 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.
StepActionKey Notes
1Determine locationFilename:
plans/reports/checkpoint-{YYMMDD-HHMM}-{slug}.md
2Gather contextTask, findings, files analyzed/modified, progress, decisions
3Write checkpoint fileStructured markdown with recovery instructions
4Update todo listMark 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确定存储位置文件名:
plans/reports/checkpoint-{YYMMDD-HHMM}-{slug}.md
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}.md

Instructions

使用说明

Create a checkpoint file with the following structure:
按照以下结构创建检查点文件:

Step 1: Determine Checkpoint Location

步骤1:确定检查点存储位置

bash
undefined
bash
undefined

Get current date for filename

Get current date for filename

date +%y%m%d-%H%M
undefined
date +%y%m%d-%H%M
undefined

Step 2: Gather Context

步骤2:收集上下文

Collect and document:
  1. Current Task - What are you working on?
  2. Key Findings - What have you discovered?
  3. Files Analyzed - Which files have been read/modified?
  4. Progress Summary - What's completed vs remaining?
  5. Important Context - Critical information to preserve
  6. Next Steps - What should be done next?
  7. Open Questions - Unresolved issues
收集并记录:
  1. 当前任务 - 你正在处理什么工作?
  2. 关键发现 - 你有什么新发现?
  3. 已分析文件 - 哪些文件已被读取/修改?
  4. 进度汇总 - 已完成和待完成的工作分别是什么?
  5. 重要上下文 - 需要留存的关键信息
  6. 后续步骤 - 接下来要做什么?
  7. 待解决问题 - 尚未解决的问题

Step 3: Write Checkpoint File

步骤3:写入检查点文件

Create a markdown file at
plans/reports/checkpoint-YYMMDD-HHMM-{task-slug}.md
with:
markdown
undefined
plans/reports/checkpoint-YYMMDD-HHMM-{task-slug}.md
路径下创建markdown文件,内容如下:
markdown
undefined

Memory 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

FilePurposeRelevance
path/to/file.cs[purpose]High/Medium/Low
FilePurposeRelevance
path/to/file.cs[purpose]High/Medium/Low

Modified Files

Modified Files

  • path/to/modified.ts
    - [change description]
  • path/to/modified.ts
    - [change description]

Pending Files

Pending Files

  • path/to/pending.cs
    - [why pending]
  • path/to/pending.cs
    - [why pending]

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

  1. [Immediate next action]
  2. [Following action]
  3. [Subsequent action]
  1. [Immediate next action]
  2. [Following action]
  3. [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:
  1. Read this checkpoint file
  2. Review [specific files] for context
  3. Continue from [specific point]

Checkpoint saved by Claude Code at [timestamp]
undefined
To resume this task after context reset:
  1. Read this checkpoint file
  2. Review [specific files] for context
  3. Continue from [specific point]

Checkpoint saved by Claude Code at [timestamp]
undefined

Step 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

最佳实践

  1. Save checkpoints frequently - Every 30-60 minutes during complex tasks
  2. Be specific - Include file paths, line numbers, exact findings
  3. Document decisions - Record why choices were made
  4. Link related files - Reference other analysis documents
  5. Include recovery steps - Make resumption easy
  1. 频繁保存检查点 - 处理复杂任务时每30-60分钟保存一次
  2. 内容具体 - 包含文件路径、行号、确切的发现结果
  3. 记录决策 - 记录做出各项选择的原因
  4. 关联相关文件 - 引用其他分析文档
  5. 包含恢复步骤 - 方便后续恢复任务

Related Commands

相关命令

  • /context
    - Load project context
  • /compact
    - Manually trigger context compaction
  • /watzup
    - Generate progress summary
  • /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
  • 始终将任务拆解为多个小型待办事项
  • 始终添加最终复盘待办项,在任务末尾回顾已完成工作,查找需要修复或优化的内容