---
description: Session Handoff — appends a session entry to this project's project-log.md, then prints a copy-paste prompt for the next session that points at that log. Use when wrapping up a session that crossed turn 40+ or to end clean before doom-loop territory. Triggered by 'wrap up', 'handoff', '/handoff'.
---

# personal-session-handoff

Closes a session cleanly so the next one starts from a 50K-context-token baseline instead of inheriting 500K+ of accumulated history.

This is the single most important cost-discipline tool on the personal laptop. Cache_read tokens dominate spend; ending sessions before they bloat saves 5-30× per task.

## Trigger phrases

- "Wrap up"
- "Handoff"
- "Close out"
- `/handoff`
- Auto-prompted by the AI when session crosses turn 80 (the default-handoff threshold)

## Process

### Step 1 — Identify the project

Walk up from CWD until a `project-log.md` is found. If none, ask Josh which project this work belongs to (or whether a new project log should be started).

### Step 2 — Summarize what was done this session

Read the recent context. Produce a structured entry:

```markdown
## Session — YYYY-MM-DD HH:MM AEST

**Duration:** [N turns] / [M minutes elapsed]
**Goal:** [1 sentence]
**Status:** complete | partial | blocked

### What got done

- [bullet]
- [bullet]

### Files changed

- [path] — [what]
- ...

### Decisions made

- [decision] — [why]
- ...

### Open items

- [ ] [next action 1] — [context]
- [ ] [next action 2] — [context]

### Blockers / unknowns

- [blocker]

### Notes for next session

[2-3 sentences on what context the next session needs]
```

### Step 3 — Append to project-log.md

Append the entry to the project's `project-log.md`, newest at top.

### Step 4 — Generate next-session prompt

Output a copy-paste-ready prompt for the next session:

```
============================================================
NEXT-SESSION PROMPT (copy this into a fresh OpenCode session)
============================================================

I'm picking up [project name] where I left off. Read the latest session entry in [path/to/project-log.md] for context, then we'll work on [first open item].

Specifically the next step is: [next action 1].

============================================================
```

### Step 5 — Save the prompt

Save the prompt itself to `[project]/RESUME-PROMPT.md` (overwriting prior version), so Josh can find it from the file system if he loses the chat.

## Output to Josh

```markdown
**Session wrapped** for [project]

**Logged to:** `[path]/project-log.md`
**Resume prompt at:** `[path]/RESUME-PROMPT.md`

**Session summary:**
- Duration: [N turns]
- [headline accomplishment]
- [N open items for next session]

**To continue:** start a fresh OpenCode session and paste the resume prompt above.

**Cost note:** This session ran [N turns]. Fresh session resumes at ~50K context vs ~[N*K] accumulated cache_read here. Expected next-session cost: ~[X]× cheaper per turn.
```

## Discipline

- The summary is for the next AI session, not for Josh's pleasure. Be tight, concrete, action-oriented.
- "What got done" should be testable claims, not narrative ("Fixed bug in X" not "Worked on X").
- "Open items" should be checkbox-format and have enough context to be actionable on resume.
- If the session was a doom-loop / unproductive, say so honestly. "Spent 80 turns chasing a bug, root cause not found. Next session: try [different approach]."
