A cross-CLI session handoff contract: one plaintext markdown file per
project, read at session start and rewritten at session end, so any
agent CLI (Claude Code, Cursor, Gemini CLI, OpenCode, Codex, aider)
picks up the work mid-thought instead of cold. No daemon, no database,
no lock-in — the file is the memory, and the format is the API.
~/.agent/handoffs/<project-slug>.md.
where we left off".
decisions made than fit in what you can reliably recall later).
# Default directory is ~/.agent/handoffs; $AGENT_HANDOFF_DIR overrides it.
# For ~/dev/src/crawlkit, the slug is "crawlkit".
printf '%s\n' "${AGENT_HANDOFF_DIR:-$HOME/.agent/handoffs}/crawlkit.md"
Read the whole file. Treat Next step as the default first action andOpen threads as the agenda. State out loud what you picked up, so the
human can correct stale context before it misleads you.
Rewrite whole sections rather than appending; stale handoffs are worse
than none. The five fixed sections:
# handoff: <project-slug>
## Status
One paragraph: what this project is and where it stands. A stranger
should be able to act after reading only this.
## Open threads
Bulleted, newest first. Each item names the branch, file, or command
needed to resume it.
## Decisions
Dated, one line each, irreversible choices only.
## Next step
The single most useful thing to do first, with the exact command.
## Updated
ISO timestamp of the last write and which agent wrote it.
Before doing anything expensive to reverse, check Decisions for a
dated line that contradicts what you are about to do.
never touches anything outside ~/.agent/handoffs (or$AGENT_HANDOFF_DIR).
put secrets, tokens, or credentials in the file.
a session is stale and must be said out loud as stale when read.
directory name; mount paths differ).
and pointers, not history.