Scan and commit .claude/memory/ changes in the directory, including task status tracking.
Usage
/memory-commit # 自動分析並 commit 所有 memory 變更
/memory-commit --dry # 僅顯示會 commit 的內容,不執行
Memory directory structure
.claude/memory/
├── tasks/ # 任務追蹤
│ ├── current.json # 當前工作流狀態
│ ├── history/ # 歷史記錄
│ └── dag/ # 任務依賴圖
├── research/ # 研究報告
├── plans/ # 實作計劃
├── implement/ # 實作記錄
├── review/ # 審查報告
└── workflows/ # 工作流輸出
Commit Message format
| Directory | Commit Type | Example |
|---|---|---|
| tasks/ | chore(tasks) | chore(tasks): complete phase 1 implementation |
| research/ | docs(research) | docs(research): user authentication analysis |
| plans/ | feat(plans) | feat(plans): todo system implementation plan |
| implement/ | feat(implement) | feat(implement): phase 1 memory integration |
| review/ | docs(review) | docs(review): code review findings |
| workflows/ | chore(workflow) | chore(workflow): update orchestrate output |
Execution steps
1. Check changes
# 顯示 memory 目錄變更
git status --porcelain .claude/memory/
2. Classify changes
Analyze changed files and classify by directory:
| Priority | Directory | Description |
|---|---|---|
| 1 | research/ | Commit research results first |
| 2 | plans/ | Plans depend on research |
| 3 | implement/ | Implementation records |
| 4 | review/ | Review reports |
| 5 | workflows/ | Workflow output |
| 6 | tasks/ | Task status last (may reference other commits) |
3. Generate Commit Message
For each category:
- Read the contents of changed files
- Summarize the main changes (title, status changes, etc.)
- Generate a commit message that conforms to the format
4. Execute Commit
# 按順序 commit
git add .claude/memory/research/
git commit -m "docs(research): <摘要>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>"
git add .claude/memory/plans/
git commit -m "feat(plans): <摘要>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>"
# ... 其他目錄
Example output
📝 Memory Commit
掃描 .claude/memory/ 變更...
變更統計:
research/ 2 files changed
plans/ 1 file changed
tasks/ 3 files changed
執行 commit:
[1/3] docs(research): add authentication flow analysis ✓
[2/3] feat(plans): todo system implementation plan ✓
[3/3] chore(tasks): update workflow status ✓
完成!3 個 commits 已建立。
Notes
- Only process
.claude/memory/changes under - Will not affect staged changes in other directories
- If a category has no changes, skip that category
- Use
--dryto preview without executing