Help us improve
Share bugs, ideas, or general feedback.
From cc-best
Manages project checkpoints: verifies code and tests, commits via git with Conventional Commits, updates progress.md docs, suggests /clear. Supports save, restore, list, --archive.
npx claudepluginhub xiaobei930/cc-best --plugin cc-bestHow this command is triggered — by the user, by Claude, or both
Slash command
/cc-best:checkpoint [save|restore|list] [--archive]This command is limited to the following tools:
The summary Claude sees in its command listing — used to decide when to auto-load this command
# /checkpoint - 检查点管理 任务完成时执行检查点,确保状态持久化到文档。**核心原则:文档是上下文的持久化存储。** ## 核心理念 > **/clear 后 Claude 只能从文档了解项目状态,检查点是跨会话记忆的关键** --- ## 检查点流程 ### 1. 验证 ### 2. 提交 **提交类型:** - `feat`: 新功能 - `fix`: 修复 bug - `docs`: 文档更新 - `refactor`: 重构 - `test`: 测试相关 - `chore`: 构建/工具 ### 3. 更新文档(最重要!) **必须更新 `memory-bank/progress.md`:** **文档更新原则:** - 写给 /clear 后的下一个 Claude 实例看 - 包含足够的上下文让它能继续工作 - 明确说明下一步是什么 ### 4. 保存会话状态(可选) 如果启用了 Memory Persistence hooks,会话状态会自动保存到 `~/.claude/sessions/`。 **手动保存会话笔记:** ### 5. 建议 /clear 任务完成后,告知用户: --- ## 检查清单 ### 代码检查点 - [ ] 无语法错误 - [ ] 可以正常导入/构建 - ...
/checkpointSaves a Markdown checkpoint capturing session progress, git state, open questions, and prioritized next steps to .claude/checkpoints/<timestamp>.md. Updates CLAUDE.md and commits changes.
/checkpointManages workflow checkpoints by creating, verifying, and listing snapshots of code state with automatic verification checks.
/checkpointCreates a descriptive git commit of relevant changes and writes .claude/handoff.md with completed work, pending tasks, learnings, and context.
/devkit.lra.checkpointCreates git checkpoint: verifies clean state (tests/server/lint), commits changes with summary arg, updates .lra/progress.txt log, outputs formatted session summary.
/checkpointManages workflow checkpoints by creating, verifying, and listing snapshots of code state with automatic verification checks.
/checkpointSaves or restores git working directory checkpoints capturing staged/unstaged changes and untracked files. Supports list, diff, delete subcommands with optional --tag.
Share bugs, ideas, or general feedback.
任务完成时执行检查点,确保状态持久化到文档。核心原则:文档是上下文的持久化存储。
/clear 后 Claude 只能从文档了解项目状态,检查点是跨会话记忆的关键
验证 → 提交 → 更新文档 → 保存会话状态 → 建议 /clear
# 代码验证(根据项目类型选择)
# Python
python -m py_compile <file.py>
pytest <test_file.py> -v
# TypeScript/Node
npm run build
npm test
# 通用
git diff --check # 检查空白错误
# 检查变更
git status
git diff
# 提交(Conventional Commits)
git add <files>
git commit -m "type(scope): description"
提交类型:
feat: 新功能fix: 修复 bugdocs: 文档更新refactor: 重构test: 测试相关chore: 构建/工具必须更新 memory-bank/progress.md:
# 项目进度
## 当前状态
- **阶段**: [阶段名称]
- **最后更新**: [YYYY-MM-DD HH:MM]
- **last_checkpoint**: [YYYY-MM-DD HH:MM]
## 已完成
- [x] 完成的任务1
- [x] 完成的任务2
## 进行中
- [ ] 当前任务(如有)
## 待办
- [ ] 下一个任务
- [ ] 后续任务
## 下一步
[明确说明下一个要做什么]
## 决策记录
| 日期 | 角色 | 决策 | 依据 | 置信度 |
| ---- | ---- | ---- | ---- | ------ |
## 检查点历史
| 时间 | 完成内容 | Git Commit |
| ---- | -------- | ---------- |
文档更新原则:
如果启用了 Memory Persistence hooks,会话状态会自动保存到 ~/.claude/sessions/。
手动保存会话笔记:
# 会话笔记 - YYYY-MM-DD
## 本次会话完成
- [完成的内容]
## 遇到的问题
- [问题及解决方案]
## 下次会话注意
- [需要注意的事项]
## 需要加载的上下文
- memory-bank/progress.md
- [其他相关文件]
任务完成后,告知用户:
检查点完成。文档已更新。
建议执行 /clear 清除上下文,然后 /cc-best:iterate 继续下一个任务。
下一个任务: [具体任务名称]
/cc-best:checkpoint # 执行完整检查点流程
/cc-best:checkpoint verify # 只验证,不提交
/cc-best:checkpoint docs # 只更新文档
/cc-best:checkpoint restore # 从上一个检查点恢复状态
/cc-best:checkpoint --archive # 归档旧记录(当 progress.md 过大时)
当 progress.md 满足以下任一条件时,建议执行归档:
/cc-best:checkpoint --archive 流程检测文件大小
wc -l memory-bank/progress.md
移动旧记录到归档
progress-archive.md 的 "已完成任务"progress-archive.md 的 "决策记录归档"progress-archive.md 的 "检查点历史"更新归档日志
在 progress-archive.md 的 "归档日志" 表格添加记录
验证
确保 progress.md 行数 < 150 行
| 区域 | 保留数量 | 超出处理 |
|---|---|---|
| 最近完成 | 5 项 | 移到归档 |
| 最近决策 | 5 条 | 移到归档 |
| 最近检查点 | 5 个 | 移到归档 |
| 待办 | 10 项 | 超出的移到 backlog.md |
❌ 问题场景:
progress.md 累积 10000+ 行 → 无法一次读取 → /cc-best:iterate 失败
✅ 解决方案:
滚动窗口 + 自动归档 → progress.md 始终 < 300 行 → 快速读取
当上下文丢失或需要从检查点恢复时:
读取检查点信息
memory-bank/progress.mdlast_checkpoint 时间恢复状态
验证代码状态
git log --oneline -5 # 确认最近提交
git status # 检查工作区状态
输出恢复报告
在 settings.local.json 中配置自动检查点提醒:
{
"hooks": {
"SessionEnd": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "echo '[Checkpoint] 建议更新 progress.md 再结束会话'"
}
]
}
]
}
}
会话1: 完成任务A → 更新 progress.md → /clear
会话2: /cc-best:iterate → 读取 progress.md → 知道任务A已完成 → 继续任务B
如果不更新文档:
会话1: 完成任务A → 没更新文档 → /clear
会话2: /cc-best:iterate → 读取 progress.md → 不知道任务A完成了 → 重复工作!
记住:检查点不仅是保存代码,更是保存上下文。好的检查点让下一个 Claude 实例能无缝继续工作。