feat: checkpoint handoff with resume_prompt for cross-runtime context transfer

/checkpoint now writes a handoff file to ~/.gstack/handoff/ alongside the
checkpoint. Includes resume_prompt field — the exact prompt to resume the
session in a fresh Claude Code instance. Wintermute reads this and passes
it straight into the next session. Zero context reconstruction.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-04-04 22:10:31 -07:00
parent b7a9add89c
commit dffa1f146b
2 changed files with 80 additions and 2 deletions
+40 -1
View File
@@ -615,12 +615,50 @@ files_modified:
### Notes
{Gotchas, blocked items, open questions, things tried that didn't work}
### Resume Prompt
{Write the exact prompt that would resume this session in a fresh Claude Code
instance. Include: skill to load, branch to checkout, specific files to read,
what the next step is, and any context the new session needs. This field is
consumed by OpenClaw/Wintermute for zero-context-reconstruction handoff.
Cap at ~4000 characters. Example:
"Load gstack. Continue work on branch garrytan/auth-flow in ~/git/baku.
Two commits landed. The refresh token rotation test at test/auth/refresh.test.ts:47
is failing on the expiry edge case. Read that test file first."}
```
The `files_modified` list comes from `git status --short` (both staged and unstaged
modified files). Use relative paths from the repo root.
After writing, confirm to the user:
After writing, also write a handoff file for cross-runtime context transfer:
```bash
HANDOFF_DIR="$HOME/.gstack/handoff"
mkdir -p "$HANDOFF_DIR"
```
Write to `{HANDOFF_DIR}/{TIMESTAMP}-{title-slug}.md` with this format:
```markdown
---
from: gstack
to: wintermute
project: {project name from SLUG}
branch: {current branch name}
timestamp: {ISO-8601 timestamp}
resume_prompt: |
{the resume prompt from the checkpoint, verbatim}
---
{The Summary, Remaining Work, and Notes sections from the checkpoint, verbatim}
```
This handoff file is consumed by OpenClaw (Wintermute) for cross-runtime session
continuation. When the user says "continue the work" to Wintermute, it reads the
`resume_prompt` and passes it directly to a new Claude Code session.
After writing both files, confirm to the user:
```
CHECKPOINT SAVED
@@ -628,6 +666,7 @@ CHECKPOINT SAVED
Title: {title}
Branch: {branch}
File: {path to checkpoint file}
Handoff: {path to handoff file}
Modified: {N} files
Duration: {duration or "unknown"}
════════════════════════════════════════
+40 -1
View File
@@ -150,12 +150,50 @@ files_modified:
### Notes
{Gotchas, blocked items, open questions, things tried that didn't work}
### Resume Prompt
{Write the exact prompt that would resume this session in a fresh Claude Code
instance. Include: skill to load, branch to checkout, specific files to read,
what the next step is, and any context the new session needs. This field is
consumed by OpenClaw/Wintermute for zero-context-reconstruction handoff.
Cap at ~4000 characters. Example:
"Load gstack. Continue work on branch garrytan/auth-flow in ~/git/baku.
Two commits landed. The refresh token rotation test at test/auth/refresh.test.ts:47
is failing on the expiry edge case. Read that test file first."}
```
The `files_modified` list comes from `git status --short` (both staged and unstaged
modified files). Use relative paths from the repo root.
After writing, confirm to the user:
After writing, also write a handoff file for cross-runtime context transfer:
```bash
HANDOFF_DIR="$HOME/.gstack/handoff"
mkdir -p "$HANDOFF_DIR"
```
Write to `{HANDOFF_DIR}/{TIMESTAMP}-{title-slug}.md` with this format:
```markdown
---
from: gstack
to: wintermute
project: {project name from SLUG}
branch: {current branch name}
timestamp: {ISO-8601 timestamp}
resume_prompt: |
{the resume prompt from the checkpoint, verbatim}
---
{The Summary, Remaining Work, and Notes sections from the checkpoint, verbatim}
```
This handoff file is consumed by OpenClaw (Wintermute) for cross-runtime session
continuation. When the user says "continue the work" to Wintermute, it reads the
`resume_prompt` and passes it directly to a new Claude Code session.
After writing both files, confirm to the user:
```
CHECKPOINT SAVED
@@ -163,6 +201,7 @@ CHECKPOINT SAVED
Title: {title}
Branch: {branch}
File: {path to checkpoint file}
Handoff: {path to handoff file}
Modified: {N} files
Duration: {duration or "unknown"}
════════════════════════════════════════