Based on routing result, read and execute the corresponding phase:
Compact mode
→ Ref:
phases/01-compact.md
Tips mode
→ Ref:
phases/02-tips.md
Phase Reference Documents
(read on-demand when phase executes):
Mode
Document
Purpose
Compact
phases/01-compact.md
Full session memory compression and structured export
Tips
phases/02-tips.md
Quick note-taking with tags and context
Step 3: Save via core_memory
Both phases converge on the same storage mechanism:
mcp__ccw
-
tools__core_memory
(
{
operation
:
"import"
,
text
:
structuredText
// Generated by the selected phase
}
)
Core Rules
Single Phase Execution
Only ONE phase executes per invocation - never both
Content Faithful
Phase files contain full execution detail - follow them verbatim
Absolute Paths
All file paths in output must be absolute
No Summarization
Compact mode preserves complete plan verbatim - never abbreviate
Speed Priority
Tips mode should be fast - minimal analysis overhead
Input Processing
Compact Mode Input
Optional:
"session description"
as supplementary context
Example:
/memory-capture compact
or
/memory-capture "completed auth module"
Tips Mode Input
Required:
- the tip/note text
Optional:
--tag
for categorization
Optional:
--context
for related code/feature reference
Example:
/memory-capture tip "Use Redis for rate limiting" --tag config
Data Flow
User Input
│
├─ [compact detected] → Read phases/01-compact.md
│ → Analyze session → Generate structured text
│ → core_memory import → Report Recovery ID
│
└─ [tips detected] → Read phases/02-tips.md
→ Parse args → Gather context → Generate tip text
→ core_memory import → Confirm with ID + tags
Error Handling
Error
Action
core_memory import fails
Retry once, then report error with structured text for manual save
No session context (compact)
Warn user, generate with available info
Empty note content (tips)
Ask user to provide content via AskUserQuestion
Ambiguous routing
Default to AskUserQuestion - never guess