Captures and persists current session context for later restoration. Triggers: "dehydrate this session", "serialize session state", "save session snapshot", "pause and resume later".
Captures and persists current session context for later restoration.
Usage:
/dehydrate — Save context to file, stay in session/dehydrate restart — Save context to file, restart Claude with fresh context[!!!] INVOCATION (READ THIS):
Skill(skill: "dehydrate", args: "restart")engine session dehydrate (this does not exist)Bash("/dehydrate restart") (slash commands are not shell scripts)[!!!] CRITICAL BOOT SEQUENCE:
Output this block in chat with every blank filled:
Boot proof:
________________________[!!!] If ANY blank above is empty: STOP. Go back to step 1 and load the missing file. Do NOT read Phase 1 until every blank is filled.
Dehydrate-specific check (LOW-I/O skill — context near overflow):
- Active session dir:
________- Extra files loaded:
none
Role: You are the Context Archivist. Goal: To package the current session's entire state into a portable summary and a list of required files. Trigger: When the user says "Dehydrate", "Serialize", "Pause", or asks to save context. Also triggered by PreToolUse hook at 90% context overflow.
Action: Before writing the summary, gather the inventory from CURRENT CONTEXT ONLY.
[!!!] CRITICAL: DO NOT READ EXTRA FILES. Context is already near overflow. Use ONLY what's already loaded in your context window:
§CMD_MAINTAIN_SESSION_DIR outputcontextPaths from §CMD_PARSE_PARAMETERS outputMinimal I/O Allowed:
ls -F sessions/[CURRENT_SESSION]/ to see what artifacts exist.§CMD_PARSE_PARAMETERS output to recall contextPaths and preludeFiles.preludeFiles OR generated in the session folder (especially DETAILS.md, _LOG.md, _PLAN.md) is MANDATORY to list in Required Files section — but do NOT read them now.Output this block in chat with every blank filled:
Phase 1 proof:
- Session directory:
________- Session dir listed:
________- Context paths recalled:
________- Critical files identified:
________
Action: Generate the summary in Markdown format. Content:
any types" or "User wants to focus on performance first").AudioWorklet.ts race condition")._LOG.md was updated? What timestamp/entry?| Prefix | Resolves To | Contains |
|---|---|---|
~/.claude/ | User home ~/.claude/ | Shared engine (skills, standards, agents, scripts) |
.claude/ | Project root .claude/ | Project-local config (settings, project standards) |
sessions/ | Project root sessions/ | Session directories (logs, plans, dehydrated context) |
packages/, apps/, src/ | Project root | Source code |
.md file found in the session directory (Logs, Plans, especially DETAILS document).preludeFiles list.~/.claude/ (shared engine) with .claude/ (project-local). They are different directories.Output this block in chat with every blank filled:
Phase 2 proof:
- Sections populated:
________/ 7- Session .md files listed:
________- Original preludeFiles listed:
________- Path conventions table:
________- Extra files read:
________(should be none)
Action: Write the dehydrated context to file, then trigger restart if requested or overflow-triggered.
Action: Write the full dehydrated markdown to DEHYDRATED_CONTEXT.md in the session directory using log.sh.
engine log --overwrite sessions/[CURRENT_SESSION]/DEHYDRATED_CONTEXT.md <<'EOF'
# DEHYDRATED CONTEXT (Session Handover)
[FULL CONTENT HERE]
EOF
Action: Output a summary in chat so the user can see what was captured.
¶INV_TERMINAL_FILE_LINKS (Full variant): "Dehydrated context saved to [link]"Condition: Execute this step if ANY of these are true:
restart argument (e.g., /dehydrate restart)Action:
Save current phase — Determine which phase of the skill protocol you were in and save it:
engine session phase sessions/[CURRENT_SESSION] "Phase X: [Name]"
Trigger restart — Call session.sh restart to spawn fresh Claude:
engine session restart sessions/[CURRENT_SESSION]
WARNING: This command will:
.state.json status to ready-to-killCondition: ONLY if no restart was triggered (manual dehydration without restart argument).
Action: State "Dehydrated to sessions/[CURRENT_SESSION]/DEHYDRATED_CONTEXT.md"
Output this block in chat with every blank filled:
Phase 3 proof:
- DEHYDRATED_CONTEXT.md written:
________- Summary displayed:
________- Restart condition:
________(met / not met)- Action taken:
________(phase saved + restart triggered / confirmation output)