Session Handoff
Effort: free — one flat file written before the context dies; no model calls, and it cuts cost outright at the next session start. Removes: the fresh agent re-deriving state, re-paying traps already paid for, and decisions lost in a dead context window.
A context window dies; the work must not. Before a session ends or compacts,
write one flat file a brand-new agent can read cold and continue from — what
was being done, where it lives, what is half-done, and the exact next command.
A handoff parked in chat prose or memory alone does not exist.
When to write one
- Before the context window compacts or is cleared.
- When ending a session with work still open.
- Right after landing something big (record the commit id while it is fresh).
- The moment a real decision goes to your human (record what each choice means).
Where it goes
One known place the next agent will look FIRST. If the next agent shares your
project, use a stable ledger file in the repo and commit the update so it
survives a machine restart, not just a context clear. If the next agent is a
different harness or a fresh login, write a flat portable file to the temp
dir — it is scaffolding, not a tracked artifact.
Verify concurrent work first (before writing a word)
Check that work from OTHER sessions is preserved. Run git status,
git log, and git worktree list. Note dirty files and unmerged branches in
the doc honestly. Never alter another session's uncommitted work to make the
handoff look clean — that is the data-loss defect. A handoff that describes a
clean state while another session has work in flight is a false claim.
What goes in — one short section each
- Goal. The work in one sentence. The next agent must not have to guess
what "done" means.
- State. Landed (commit ids), building, queued. Reference specs, plans,
issues, and diffs by path or URL — never duplicate their content.
- Where the work lives. Branches, worktrees, dirty files. Name the exact
files the next agent must read first.
- The verdict trail. Who or what graded each piece and what the real
catches were. A failed verdict with named defects is MORE valuable than a
green — write the defects verbatim.
- Half-done work and the exact next command. What is mid-flight, and the
literal command that continues it.
- Open decisions. Anything waiting on your human, and what each choice
means. A decision must never exist only in a dead context window.
- Unmet contracts. Tests still red, proofs still missing, promises made
but not yet kept.
- Traps. One line each. A trap you already paid for is worth more than a
green — write it so the next session does not pay again.
- Suggested skills. Which skills the next agent should load first, and
one line why. This is what makes the doc portable across harnesses.
Hard rules
- Redact. No API keys, passwords, tokens, or personal data. No real
hostnames, internal IPs, or home paths — placeholders only; point at real
values by env var name. A handoff is the file most likely to leave the
machine; a secret that leaks through it IS the bug.
- Absence claims rot fastest. Before writing "X does not exist" or "X is
not landed," re-verify at the current commit — parallel work lands while
you write.
- Two-word status per item: PROVEN or STILL-BUILDING. Green tests without
live proof is STILL-BUILDING, and the handoff says exactly what proof is
missing.
- Keep it readable in two minutes (about 120 lines). When it grows past
that, archive the oldest blocks by moving them to a history section —
never by deleting.
Pickup (the other half)
A session that starts from a handoff reads it FIRST, then verifies the top two
or three claims against git log and the live tree before acting on them.
The handoff is a map, not truth — trust it for WHERE to look; verify WHAT it
says.
Works well with
- root-cause-first — the investigation the next session continues.
- repair-loop — hand off mid-loop without losing the seam.
- decision-bar — how open decisions reach your human.
- repo-map — the durable repo index the next session reads first.
Scaffold credit: Matt Pocock, handoff (mattpocock/skills). The composition and hard rules here are BACKS AIOS.
1---2name: session-handoff3description: Use when a session is ending, the context window is about to compact, or the work must continue in another agent or harness. Compacts the session into one flat file a brand-new agent can read cold and continue from (state, half-done work, exact next command, open decisions), with secrets redacted and concurrent work verified preserved. Trigger words: handoff, hand off, compact, save state, continue in another session, portable handoff, before restart.4license: MIT5---67# Session Handoff8**Effort:** free — one flat file written before the context dies; no model calls, and it cuts cost outright at the next session start. Removes: the fresh agent re-deriving state, re-paying traps already paid for, and decisions lost in a dead context window.910A context window dies; the work must not. Before a session ends or compacts,11write one flat file a brand-new agent can read cold and continue from — what12was being done, where it lives, what is half-done, and the exact next command.13A handoff parked in chat prose or memory alone does not exist.1415## When to write one1617- Before the context window compacts or is cleared.18- When ending a session with work still open.19- Right after landing something big (record the commit id while it is fresh).20- The moment a real decision goes to your human (record what each choice means).2122## Where it goes2324One known place the next agent will look FIRST. If the next agent shares your25project, use a stable ledger file in the repo and commit the update so it26survives a machine restart, not just a context clear. If the next agent is a27different harness or a fresh login, write a flat portable file to the temp28dir — it is scaffolding, not a tracked artifact.2930## Verify concurrent work first (before writing a word)3132Check that work from OTHER sessions is preserved. Run `git status`,33`git log`, and `git worktree list`. Note dirty files and unmerged branches in34the doc honestly. Never alter another session's uncommitted work to make the35handoff look clean — that is the data-loss defect. A handoff that describes a36clean state while another session has work in flight is a false claim.3738## What goes in — one short section each39401. **Goal.** The work in one sentence. The next agent must not have to guess41 what "done" means.422. **State.** Landed (commit ids), building, queued. Reference specs, plans,43 issues, and diffs by path or URL — never duplicate their content.443. **Where the work lives.** Branches, worktrees, dirty files. Name the exact45 files the next agent must read first.464. **The verdict trail.** Who or what graded each piece and what the real47 catches were. A failed verdict with named defects is MORE valuable than a48 green — write the defects verbatim.495. **Half-done work and the exact next command.** What is mid-flight, and the50 literal command that continues it.516. **Open decisions.** Anything waiting on your human, and what each choice52 means. A decision must never exist only in a dead context window.537. **Unmet contracts.** Tests still red, proofs still missing, promises made54 but not yet kept.558. **Traps.** One line each. A trap you already paid for is worth more than a56 green — write it so the next session does not pay again.579. **Suggested skills.** Which skills the next agent should load first, and58 one line why. This is what makes the doc portable across harnesses.5960## Hard rules6162- **Redact.** No API keys, passwords, tokens, or personal data. No real63 hostnames, internal IPs, or home paths — placeholders only; point at real64 values by env var name. A handoff is the file most likely to leave the65 machine; a secret that leaks through it IS the bug.66- **Absence claims rot fastest.** Before writing "X does not exist" or "X is67 not landed," re-verify at the current commit — parallel work lands while68 you write.69- **Two-word status per item: PROVEN or STILL-BUILDING.** Green tests without70 live proof is STILL-BUILDING, and the handoff says exactly what proof is71 missing.72- **Keep it readable in two minutes** (about 120 lines). When it grows past73 that, archive the oldest blocks by moving them to a history section —74 never by deleting.7576## Pickup (the other half)7778A session that starts from a handoff reads it FIRST, then verifies the top two79or three claims against `git log` and the live tree before acting on them.80The handoff is a map, not truth — trust it for WHERE to look; verify WHAT it81says.8283## Works well with8485- [root-cause-first](../root-cause-first/SKILL.md) — the investigation the next session continues.86- [repair-loop](../repair-loop/SKILL.md) — hand off mid-loop without losing the seam.87- [decision-bar](../decision-bar/SKILL.md) — how open decisions reach your human.88- [repo-map](../repo-map/SKILL.md) — the durable repo index the next session reads first.8990> Scaffold credit: Matt Pocock, handoff (mattpocock/skills). The composition and hard rules here are BACKS AIOS.