Command
Utility
/dr-save
Save current session state to disk before context is destroyed
Overview
/dr-save captures the current session to a self-contained markdown artefact at datarim/sessions/SESSION-{YYYYMMDD-HHMMSS}.session.md. It is designed to be run before closing the terminal, switching runtimes, or resetting the agent context — so work can resume with /dr-continue in a fresh window.
Usage
/dr-save
What It Does
- Collects 5-layer body — Layer 1 (git state per repo, non-truncatable), Layer 2 (active task snapshots), Layer 3 (related files), Layer 4 (open questions), Layer 5 (failed approaches, non-truncatable).
- Enforces claim provenance — every line containing
pushed,merged,deployed,green, orpassingmust carry averified:orassumed:tag. The writer rejects untagged claims with exit 1. - Scans and redacts secrets — API key / credential patterns replaced with
[REDACTED]before write (T-8). - Writes atomically — mkdir-lock, atomic rename, chmod 600, append-only (a second
/dr-saveappends, never truncates prior blocks). - Emits resume block — prints
/dr-continue {SESSION-ID}as the copy-paste command (the session id selects exactly this saved session, so a bare/dr-continuecannot pick up another agent's session by modification time in a shared workspace), with a↳ {TASK-ID} — {title}annotation and saved-time so a human recognises the work being resumed. Still warns againstclaude --continue/codex resume/ Cursor history.
Cross-Runtime Support
Works identically in Claude Code, Codex CLI, and Cursor. The artefact is plain markdown — zero MCP dependency. All three runtimes read it via native file-read on resume.
Related
- /dr-continue — the consumer command that reads the artefact in a clean window.
- session-handoff-writer — the producer skill contract.