Summary: Provide continuity between sessions. Restore past context at start, persist state at end.
🔄 Triggers and Immediate Actions
At session start
WHEN A new session starts
DO Execute the following in order:
~/.musubix/sessions/Search files from the past 7 days from- Read the "Notes for Next Session" from the most recent session
- Notify the user of the handover content
find ~/.musubix/sessions/ -name "*.md" -mtime -7 2>/dev/null | head -5
Output format:
📋 前回セッションからの引き継ぎ
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📅 日時: [YYYY-MM-DD HH:MM]
📝 未完了: [タスクリスト]
💡 メモ: [重要コンテキスト]
📂 推奨ファイル: [パスリスト]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
続きから再開しますか?
At session end
WHEN Session ends/long interruption
DO Set state to ~/.musubix/sessions/YYYY-MM-DD-HH-MM.md save to
Save format:
# Session: [日付]
**Project:** [名前] | **Started:** [HH:MM] | **Updated:** [HH:MM]
## Completed
- [x] 完了タスク
## In Progress
- [ ] 進行中タスク
## Notes for Next Session
- 重要コンテキスト
## Context to Load
- `path/to/file`
Before context compression
WHEN Context compression is triggered
DO Append important state to the session file before compression
Items to save: Current task state, important variables/settings, next actions
✅ TodoWrite integration
WHEN Start a multi-step task (3 or more steps)
DO Track progress with the TodoWrite tool
Best practices
| Things to do | Reason |
|---|---|
| Create a list when the task starts | Clarify the execution order |
| Check off each completion | Visualize progress |
| Detect missing steps | Prevent omissions |
| Record incomplete items at the end | Handover for next time |
Example:
□ 1. 要件定義の確認
□ 2. 設計ドキュメント作成
☑ 3. 実装(完了)
□ 4. テスト作成
□ 5. レビュー依頼
📁 Storage
| Path | Content |
|---|---|
~/.musubix/sessions/ |
Session files (kept for 30 days) |
~/.musubix/sessions/YYYY-MM-DD-HH-MM.md |
Individual sessions |
Traceability
- REQ-SM-001: SessionStart Hook
- REQ-SM-002: SessionEnd Hook
- REQ-SM-003: Pre-Compact State Saving
- REQ-SM-004: TodoWrite integration