Install
openclaw skills install checkpointsRecords full context of AI-generated code and binds it to git commits. When the agent writes and commits code, capture prompts, conversation history, reasoning steps, decision logic, and token/metadata, then associate that checkpoint with the commit. Use when committing AI-produced changes or when the user wants to save or audit why and how code was generated.
openclaw skills install checkpointsCheckpoints 用于自动记录 AI 生成代码的完整上下文,并与对应的**代码提交(Commit)**绑定,便于回溯、审计和复现“这段代码是怎么来的”。
在生成或提交 AI 代码时,将以下信息与 commit 绑定:
| 内容 | 说明 |
|---|---|
| 提示词(Prompts) | 用户或系统触发生成的那条(或几条)主要 prompt,可做脱敏。 |
| 对话记录 | 与本次改动相关的对话摘要或关键轮次(可精简为要点)。 |
| 推理步骤 | 模型/智能体的推理链:先做了什么判断、尝试了哪些方案、为何选当前实现。 |
| 决策逻辑 | 关键决策点(例如:为何用 A 库而非 B、为何采用这种结构)。 |
| 元数据 | 可选:Token 消耗量、模型/版本、时间戳、涉及文件列表等。 |
| 关联 Commit | 明确对应的 commit hash(或 branch + 即将提交的说明),保证可追溯。 |
.checkpoints/ 或 docs/checkpoints/),每个 commit 对应一个文件,命名包含 commit hash 或时间戳,便于通过 hash 查找。按项目约定或用户指定选择一种方式,并保持一致。
若用文件形式保存,可采用结构化格式(便于后续解析和展示),例如:
{
"commit": "abc123...",
"timestamp": "ISO8601",
"prompts": ["用户请求的原始或摘要 prompt"],
"conversation_summary": "与本次改动相关的对话要点",
"reasoning_steps": ["步骤1", "步骤2", "..."],
"decisions": ["决策1及原因", "..."],
"files_changed": ["path/a", "path/b"],
"meta": {
"model": "optional",
"tokens_used": "optional",
"agent_version": "optional"
}
}
也可用 Markdown 书写,便于人工阅读,但需固定章节(Prompts、对话摘要、推理步骤、决策、元数据、Commit)。
.gitignore 若仅本地使用;若团队需要共享审计,则纳入版本库并提交。