checkpoint

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

/checkpoint

/checkpoint

What

功能

A quick mid-session save that banks the known-good state in two moves:
  1. Descriptive git commit — stage relevant changes and commit with a message that summarizes the work.
  2. Brief handoff note — write
    .claude/handoff.md
    so a resumed session (or you, after a botched refactor) knows exactly where things stand.
Checkpoint is the mid-session save;
/wrap-up
is the end-of-session ritual. Checkpoint commits and jots a note, then keeps working. Wrap-up does the full handoff plus learning extraction into
MEMORY.md
.
这是一个快速的会话中途保存操作,通过两步来记录已知的良好状态:
  1. 描述性git commit —— 暂存相关更改,并使用总结工作内容的消息提交。
  2. 简短交接笔记 —— 编写
    .claude/handoff.md
    文件,以便恢复会话时(或在重构失败后)能准确了解当前状态。
Checkpoint是会话中途保存功能;/wrap-up是会话结束流程。Checkpoint会提交更改并记录笔记,然后继续工作。Wrap-up会完成完整的交接,并将学习内容提取到
MEMORY.md
中。

When

使用场景

  • Before a risky refactor or destructive change — checkpoint the known-good state
  • When switching to a different task or feature mid-session
  • After completing a logical unit of work — bank it
  • User says "checkpoint", "save progress", "save state", "pause here"
  • If the session is actually ending, use
    /wrap-up
    for the full ritual
  • 在进行有风险的重构或破坏性更改之前——保存已知的良好状态
  • 会话中途切换到不同任务或功能时
  • 完成一个逻辑工作单元后——保存进度
  • 用户说出"checkpoint"、"save progress"、"save state"、"pause here"时
  • 如果会话实际要结束,请使用/wrap-up完成完整流程

How

操作步骤

  1. Assess state
    git status
    and
    git diff
    to see staged and unstaged changes.
  2. Stage changes — Stage specific files; never
    git add -A
    . Exclude generated files, build artifacts, and secrets (
    .env
    , credentials).
  3. Commit — Descriptive message following the repo's commit style (conventional prefixes:
    feat:
    ,
    fix:
    ,
    refactor:
    ). New commit, never amend. If there is nothing to commit, skip to the handoff.
  4. Write handoff note
    .claude/handoff.md
    , same format as
    /wrap-up
    but abbreviated: Completed, Pending (with specific next steps), Learned (only if something non-obvious surfaced), and Context (branch + commit hash). One file, always overwritten.
  5. Confirm — Report the commit hash and the handoff summary, then resume work.
  1. 评估状态 —— 使用
    git status
    git diff
    查看已暂存和未暂存的更改。
  2. 暂存更改 —— 暂存特定文件;切勿使用
    git add -A
    。排除生成文件、构建产物和敏感信息(
    .env
    、凭证)。
  3. 提交 —— 遵循仓库提交风格的描述性消息(常规前缀:
    feat:
    fix:
    refactor:
    )。创建新提交,切勿修改现有提交。如果没有可提交的内容,直接跳至交接步骤。
  4. 编写交接笔记 —— 写入
    .claude/handoff.md
    ,格式与/wrap-up相同但更为简洁:已完成项、待处理项(含具体下一步)、学到的内容(仅记录非显而易见的信息),以及上下文(分支 + 提交哈希)。始终覆盖该文件。
  5. 确认 —— 报告提交哈希和交接摘要,然后继续工作。

Safety Rules

安全规则

  • Never push, force-push, or touch remote branches
  • Never commit secrets
  • Never amend — a checkpoint is a new commit you can return to
  • No changes to commit? Update the handoff only
  • 切勿推送、强制推送或操作远程分支
  • 切勿提交敏感信息
  • 切勿修改现有提交——Checkpoint是一个可回溯的新提交
  • 无更改可提交?仅更新交接笔记即可

Example

示例

User: /checkpoint — about to try the EF Core split-query refactor

Claude: 3 files modified, 1 new.

  Commit a1b2c3d: "feat: add CreateOrder validation with FluentValidation"
  - src/Orders/Features/CreateOrder.cs
  - src/Orders/Features/CreateOrderValidator.cs (new)
  - tests/Orders.Tests/Features/CreateOrderTests.cs

  Handoff updated (.claude/handoff.md):
  ## Completed
  - [x] CreateOrder validation + 3 test scenarios
  ## Pending
  - [ ] Split-query refactor in GetOrderDetails (about to attempt)
  ## Context
  - Branch: feature/order-validation | Checkpoint: a1b2c3d

  Checkpoint saved — safe to proceed with the risky refactor.
User: /checkpoint — about to try the EF Core split-query refactor

Claude: 3 files modified, 1 new.

  Commit a1b2c3d: "feat: add CreateOrder validation with FluentValidation"
  - src/Orders/Features/CreateOrder.cs
  - src/Orders/Features/CreateOrderValidator.cs (new)
  - tests/Orders.Tests/Features/CreateOrderTests.cs

  Handoff updated (.claude/handoff.md):
  ## Completed
  - [x] CreateOrder validation + 3 test scenarios
  ## Pending
  - [ ] Split-query refactor in GetOrderDetails (about to attempt)
  ## Context
  - Branch: feature/order-validation | Checkpoint: a1b2c3d

  Checkpoint saved — safe to proceed with the risky refactor.

Related

相关功能

  • /wrap-up
    — End-of-session ritual: full handoff format definition plus learning extraction into MEMORY.md
  • /build-fix
    — Get the build green before checkpointing
  • /wrap-up
    —— 会话结束流程:完整交接格式定义,以及将学习内容提取到MEMORY.md中
  • /build-fix
    —— 在创建Checkpoint前修复构建问题