Skip to content
Back to skills

Handoff

ASecurity

Produce a structured handoff document before any context switch, topic change, or when a fresh model would improve outputs. Run autonomously — do not wait to be asked. Trigger when: conversation topic shifts significantly, context window is getting long, repeated mistakes suggest context confusion, a complete unit of work just finished, or the user opens a new project. Save to ~/.claude/handoffs/ with a timestamped filename.

  • 3 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added October 16, 2026
ai-agentspythongonodecode-reviewgitapi

Works with

  • terminal
  • api

Security analysis

A100/100

Pro scans all 7 files and shows the line behind each finding

Scanned November 21, 2026

npx -y skills add G-Eskayo/marvin --skill handoff --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Handoff?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Handoff
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/g-eskayo-handoff/badge)](https://www.skillsdirectory.com/skills/g-eskayo-handoff)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: handoff
description: Produce a structured handoff document before any context switch, topic change, or when a fresh model would improve outputs. Run autonomously — do not wait to be asked. Trigger when: conversation topic shifts significantly, context window is getting long, repeated mistakes suggest context confusion, a complete unit of work just finished, or the user opens a new project. Save to ~/.claude/handoffs/ with a timestamped filename.
argument-hint: "What will the next session focus on? (optional)"
tags: [intent:handoff, intent:context-switch, intent:document, type:skill]
---

# Handoff

Produce a handoff document so a fresh agent can continue without losing context. Run this **before** the context switch happens, not after.

## When to Run Autonomously

Run without being asked when any of these are true:
- The conversation has been long and covered multiple distinct topics
- You've made repeated mistakes or lost track of earlier constraints — a fresh model would do better
- The user is about to open a different project or codebase
- A complete unit of work just finished (feature shipped, bug fixed, research done)
- The topic is about to shift significantly from what's been discussed

## Save Location

Save to `~/.claude/handoffs/handoff-YYYY-MM-DD-HH-MM.md` using the current timestamp.

After saving, you MUST do both:
1. Tell the user: `Handoff saved to ~/.claude/handoffs/handoff-[timestamp].md`.
2. **Output the full Resume prompt as a fenced, copy-paste code block directly in the chat** — never make the user open the file to find it. A `PostToolUse` hook (`emit-resume-prompt.py`) also prints it automatically as a backstop, but you must surface it yourself too.

## Document Structure

The front matter dates the handoff by its content, not its file time (marvin#1221). The `PostToolUse` hook
(`emit-resume-prompt.py`) adds it if you leave it out, and never overwrites one that's there.

```
---
as_of: [UTC time of this session's last real activity, e.g. 2026-11-09T22:00:00Z]
machine: [this Mac's label]
session: [this session's id]
source: skill
---
# Handoff — [date]

## What we were working on
[1–3 sentences. The actual goal, not the task list.]

## Current state
[What's done, what's in progress, what's blocked. Be specific — file paths, function names, error messages.]

## Key decisions made
[Decisions and the reasoning behind them. What was tried and rejected, and why.]

## Open questions / next steps
[What needs to happen next. Ordered by priority.]

## Suggested skills
[Which mattpocock/skills the next agent should invoke, and when.]

## Resume prompt
---
Continue from handoff: ~/.claude/handoffs/handoff-[timestamp].md

[2–3 sentence summary the user can paste at the start of a new session to orient the fresh model instantly]
---
```

## Rules

- Do not duplicate content already in files, commits, or PRDs — reference by path instead
- Check whether this session wrote anything meant to persist to a temp/scratchpad location (e.g. a scratchpad dir, `/tmp`) — these are session-scoped and vanish in a new session with no error. If so, name its durable destination explicitly in the handoff rather than just noting the loss risk. Confirmed 2026-07-07: a benchmark script + logs left in a session scratchpad would have been silently lost otherwise.
- Same check applies to substantial content that never touched a file at all — e.g. a forked/background agent's full findings (a ranked review list, a multi-point analysis) relayed only as a chat message. If it's referenced as "see transcript" or "see the final assistant message" instead of a path, that's the scratchpad risk in a different shape: it's one context-compression away from gone. Write it to a durable file (a PR comment, `~/.claude/outbox/`, a scratch note) as part of producing the handoff, don't just flag the risk. Confirmed 2026-09-14: a forked `/code-review` agent's full 10-finding PR review existed only in-transcript at handoff time.
- Before writing any "Needs Gil" / waiting-on-you list, run `~/.agents/venv/bin/python ~/.agents/lib/owner_decisions.py waiting`. Never list a PR it prints as waiting on Gil: his decisions are in, so it is MARVIN's move. List it under "Waiting on MARVIN" with its flag (owner asked a question), and act on it or name who will (marvin#607: PR #577 sat 15 h with an unanswered owner question while the wrap-up said it waited on Gil).
- **Updating an existing handoff** (a later section like "Morning state" or a struck-through step): fix every earlier line the update makes false, the resume prompt included. Don't just append. A resuming agent reads the top first, and a stale "waiting on Gil's Approve" sends it to ask about a PR that already merged. Before saving, check that no PR or ticket is listed as both open and done. Confirmed 2026-11-10: handoff-2026-11-09-21-52 said PR #1199 was waiting on Approve in Current state, next step 1 and the resume prompt, while step 2 and the same resume prompt said it had merged.
- Redact API keys, passwords, PII
- The resume prompt must be self-contained — the next agent should be able to read it cold and know exactly where to start
- If the user passed an argument describing the next session's focus, tailor the next steps and suggested skills sections to that goal
- Keep the whole document under 150 lines — compress aggressively, reference don't repeat

## On Resume

The SessionStart report already checks the newest handoff's ticket and PR claims against GitHub
(`lib/resume_check.py`). When it says "N of M changed since, treat as history" or "unverified", the handoff is
history: re-derive the current state before acting on any of it, and never relay a struck step as current.

Session start already surfaces the newest handoff (`session_start_report.py`'s `check_handoff()`). Use what is in context; don't re-read it.

**Before redoing a handoff's next steps, check whether the session that wrote it is still alive** — especially when resuming on a different machine (laptop died, switched hosts). A session left running on another node (e.g. in a mac-mini Terminal) may already have finished or be mid-way through those steps, so the handoff is stale by construction. Check live state first (PR/merge status, that machine's newest `~/.claude/projects/*/<session>.jsonl`, running `claude` processes). If it's still running, don't take over work in the same repo — two agents editing `~/.agents` concurrently collide; hand the stop-or-let-finish decision to Gil. Works well when the prior session's host is reachable; if it isn't, say the state is unknown rather than assuming it's dead. Confirmed 2026-10-06: after the laptop died, the "lost" session was still running on the mac-mini and had already merged everything the handoff listed as next steps.

Files in this skill

  • SKILL.md5.1 KB
  • retrospective.md2.4 KB
  • scripts/check_remote_session.py5.3 KB
  • scripts/emit-resume-prompt.py1.5 KB
  • scripts/find_freshest_session.py2.5 KB
  • scripts/generate_handoff_from_transcript.py5.3 KB
  • scripts/trigger_code_sync.py1.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.