/relay
Writes an immutable JSON checkpoint (≤8 KiB) and generated HANDOFF.md, syncs accepted/rejected decisions to mnemosyne, and transfers ownership via offer.json and ack.json.
npx skills@latest add luci-efe/skills -s relay- ContinueStage
- 04 Context continues · 02 Not a clipboardMethod
- .ramos/
runs/ <run-id>/ <pane>/ checkpoints/ <seq>/ handoff.json + HANDOFF.mdProduced artifact / output
Use when
A session must hand work to a fresh session, another agent, or another machine, or when starting work a previous session handed off.
Support & adapters
- Instructions usable across harnesses
- Hooks tested: Claude Code
- 1. Sender (pane A)
handoff.json (≤8 KiB) + HANDOFF.md + mnemosyne
- 2. Phase: offered
transfer_id + sha256 · Receiver checks the checkpoint sha256
- 3A. Verified ack (ack.json)
sha256 matches → ack.json, ownership transfers to receiver · SessionStart ≤ 400 tokens, flagged STALE if the code changed since the checkpoint
- 3B. Not acknowledged / rejected
No ack.json or sha256 mismatch → sender keeps ownership · no silent drop
Decision tree
- 01→ handoff.json + HANDOFF.md
Checkpoint & generated view
Write draft JSON (strings ≤240 chars) and run relay.mjs checkpoint to create immutable handoff.json (≤8 KiB) + HANDOFF.md
- 02→ memory-sync.json
Sync decisions to mnemosyne
Run relay.mjs sync <handoff.json> to persist accepted/
rejected decisions; if mnemosyne is missing, keep checkpoint and report blocked - 03→ offer.json → ack.json
Offer & receiver ack
Sender runs relay.mjs offer --to <pane>; receiver reads the checkpoint and runs relay.mjs ack --receiver <pane>; ack rejects a changed checkpoint, records stale: true if the code moved, and SessionStart then shows STALE
Prerequisites & install recipes
- noderequired · default & herdr-launch branches
nodebrew install node - mnemosynerequired · default & herdr-launch branches
mnemosyneuv tool install --python 3.12 mnemosyne-memoryneeds uv (brew install uv) · required for transfer and decision memory sync - herdroptional · herdr-launch branch
herdrbrew install herdrOptional · required only when launching a fresh Herdr pane
Completion criteria
- Each pane writes only to its own lane path (.ramos/
runs/ <run>/ <pane>/ checkpoints/ <n>/ ) and checkpoints are immutable. - If mnemosyne is missing, writes the recovery checkpoint first, prints uv tool install --python 3.12 mnemosyne-memory (needs uv), and reports blocked without offering.
- Receiver may write only after relay.mjs ack verifies the offer and writes ack.json.
Example
Handing a PR-versus-issue review from pane p1 to pane p2. Nothing was pushed or commented; the draft is a small JSON file with the task, decisions, next actions, unknowns and evidence.
What was run
R=$SKILLS/relay/scripts/relay.mjs
node $R checkpoint --from draft.json --run r1 --pane p1 --repo-id owner/repo
node $R sync $RAMOS_STATE_DIR/runs/r1/p1/checkpoints/1/handoff.json
node $R offer $RAMOS_STATE_DIR/runs/r1/p1/checkpoints/1/handoff.json --to p2
# receiver, after an empty local commit moves HEAD
RAMOS_PANE=p2 node $R inject .../checkpoints/2/offer.json
node $R ack --receiver p3 ...
node $R ack --receiver p2 ...
node $R ack --receiver p2 ...Output (excerpt)
sync -> {"stored":3,"receipt":".../memory-sync.json"} # accepted + rejected stored; the "proposed" decision is not
sync again -> {"stored":0,...} # idempotent
inject -> [relay] r1/p1#2 state=active STALE: workspace changed since checkpoint, verify before acting
ack --receiver p3 -> relay: transfer is intended for p2, not p3 # exit 2
ack --receiver p2 -> {"path":".../ack.json","stale":true,"warning":"STALE: workspace changed since checkpoint; ..."}
ack --receiver p2 -> relay: transfer 38e73177-... already acknowledged by p2 # exit 2
# tamper checks, on copies of the state
edit HANDOFF.md -> read: HANDOFF.md does not match handoff.json digest; trust handoff.json # exit 2
edit handoff.json -> ack: checkpoint digest mismatch: the offered checkpoint changed after the offer
write checkpoint #3 -> ack: offer 38e7... was superseded by a newer checkpoint in this laneWhat it found. STALE on a moved HEAD, refusal of the wrong receiver and of a second ack, digest mismatch after tampering, supersession by a newer checkpoint, idempotent memory sync, and only accepted and rejected decisions (not proposed ones) stored in durable memory.
Caveat. ack succeeds on a stale workspace and only records stale:true; acting on it is the receiver's job. The two panes were simulated by passing pane ids, and read only compares HANDOFF.md with handoff.json, so editing both passes read; only ack, which compares against the offer's sha256, catches a changed handoff.json.
Want something like this built for your company?
Book a callMessage me on LinkedInSee Agentic Engineering