Description
Before the conversation is compressed by Summarize, proactively externalize detailed memory to the Memory Bank to avoid losing important context.
Trigger Conditions
- "memory checkpoint", "checkpoint", "save"
- "save memory", "externalize memory"
- 「sync memory」、「dump context」
- Proactively trigger when the conversation is long (recommended every 10-15 rounds of conversation or after significant progress)
⚠️ Why is this Skill needed?
When the conversation is too long, the system will automatically Summarize the conversation history, which may cause:
- Detailed code change records to be omitted
- The discussion context behind decisions to be lost
- File paths and specific implementation details to become vague
- Time needed to rebuild context
Solution: Before being Summarized, proactively write key memories to the memory-bank/ directory.
📋 Checkpoint Contents
1️⃣ activeContext.md - Current work focus
## 當前工作焦點
<!-- 當前正在做什麼 -->
## 進行中的變更
<!-- 具體的檔案和修改 -->
## 待處理事項
<!-- 下一步要做什麼 -->
## 關鍵決策
<!-- 本次對話做的重要決定 -->
## 相關檔案
<!-- 涉及的檔案路徑列表 -->
2️⃣ progress.md - Progress tracking
## Done (已完成)
- [x] 具體完成的事項(含檔案路徑)
## Doing (進行中)
- [ ] 正在進行的工作
## Next (下一步)
- [ ] 計劃要做的事項
3️⃣ decisionLog.md - Decision log
## YYYY-MM-DD
### 決策:[決策標題]
- **背景**:為什麼需要這個決定
- **選項**:考慮過的方案
- **決定**:最終選擇
- **原因**:選擇的理由
4️⃣ architect.md - Architecture record (if changed)
## 架構變更記錄
### YYYY-MM-DD: [變更標題]
- **變更內容**:
- **影響範圍**:
- **相關檔案**:
🚀 Checkpoint Execution Steps
Automatic execution (recommended)
When the following situations are detected, the AI should proactively execute a Checkpoint:
-
Conversation length indicators
- Conversation exceeds 10 rounds
- More than 5 files modified cumulatively
- Completion of an important feature/fix
-
Work phase transition
- Transition from design phase to implementation
- Completion of a PR or Commit
- Switching to a different feature area
-
Explicit indicators
- User says "make a note first", "checkpoint"
- User says "continue later", "I have to go do something"
Manual execution
The user can say at any time:
- "memory checkpoint"
- "sync memory bank"
- "save current progress"
📝 Checkpoint Template
Quick Checkpoint
Update activeContext.md:
# Active Context
> Last checkpoint: 2024-XX-XX HH:MM
## 🎯 當前焦點
[一句話描述當前在做什麼]
## 📝 本次對話摘要
1. [做了什麼 1]
2. [做了什麼 2]
3. [做了什麼 3]
## 📁 變更的檔案
- `path/to/file1.py` - [變更摘要]
- `path/to/file2.ts` - [變更摘要]
## ⚠️ 待解決
- [ ] 問題 1
- [ ] 問題 2
## 💡 重要決定
- 決定 A:[原因]
- 決定 B:[原因]
## 🔜 下一步
1. [下一步 1]
2. [下一步 2]
Full Checkpoint
Update all relevant Memory Bank files:
memory-bank/
├── activeContext.md ← 當前焦點 + 變更檔案
├── progress.md ← Done/Doing/Next
├── decisionLog.md ← 新決策(如有)
├── architect.md ← 架構變更(如有)
├── productContext.md ← 技術棧變更(如有)
└── systemPatterns.md ← 新模式/慣例(如有)
🔄 Integration with Other Skills
Works with git-precommit
git commit 前 → 觸發 memory-checkpoint → 同步 Memory Bank → commit
Works with memory-updater
memory-checkpoint = 批次更新
memory-updater = 增量更新
💬 Conversation Examples
User trigger
User: checkpoint
AI: 📸 執行記憶檢查點...
已更新 Memory Bank:
- ✅ activeContext.md - 記錄當前焦點與 5 個變更檔案
- ✅ progress.md - 新增 3 個已完成項目
- ✅ decisionLog.md - 記錄 2 個決策
下次對話可從此處繼續,即使被 Summarize 也不會遺失關鍵資訊。
AI proactive trigger
AI: 💡 偵測到對話較長且有多項進展,建議執行記憶檢查點。
是否要我同步 Memory Bank?
User: 好
AI: 📸 執行記憶檢查點...
[更新 Memory Bank]
⚙️ Configuration Options
In .vscode/settings.json configurable:
{
"claude.skills.memoryCheckpoint": {
"autoTrigger": true,
"triggerThreshold": {
"conversationTurns": 10,
"filesModified": 5
},
"includeFiles": [
"activeContext.md",
"progress.md",
"decisionLog.md"
]
}
}
📊 Checkpoint Quality Check
A good Checkpoint should include:
| Item | Required | Description |
|---|---|---|
| Current focus | ✅ | Describe in one sentence what is being done |
| Changed files list | ✅ | Full path + brief description |
| Pending issues | ✅ | Work not yet completed |
| Important decisions | ⚪ | If there are new decisions |
| Next steps | ✅ | What to do next |
| Timestamp | ✅ | Know when this state was from |
🛠️ Implementation Tips
Instructions for AI
In CLAUDE.md or AGENTS.md add:
## Memory Checkpoint 規則
1. **主動觸發時機**
- 對話超過 10 輪時,主動建議 checkpoint
- 完成重大功能後,主動執行 checkpoint
- 使用者說要離開時,主動執行 checkpoint
2. **Checkpoint 內容**
- 必須包含:具體檔案路徑、變更摘要、下一步
- 避免:過於籠統的描述、遺漏重要細節
3. **格式要求**
- 使用時間戳記
- 檔案路徑使用相對路徑
- 保持簡潔但完整