Skip to main content
Agent WorkflowCoding

Session Handoff

Use when a working session is ending, the context window is nearly full, work needs to pass to a teammate or a fresh session, or the user says "hand this off", "write this up before we lose it", "I'm starting a new session", or "summarize where we are". Produces a handoff document that lets the next session resume without re-reading the transcript.

View source1 file · 4 KB

What it does

# Session Handoff

A session ends three ways: the context fills up, the person leaves, or the work moves to someone else. All three lose the same thing — the reasoning that never made it into a file. This skill writes that reasoning down before it evaporates.

## Core Behavior

Write a handoff file, do not summarize in chat. Chat scrolls away; a file survives a `/clear`, a crash, and a different person opening the repo tomorrow.

Default path: `HANDOFF.md` at the repo root, or `docs/handoff/<yyyy-mm-dd>-<topic>.md` if the repo already has a docs convention. If a handoff file exists, append a new dated section rather than overwriting — the history of what was tried is half the value.

## What Goes In It

Write these sections in this order. Skip a section only when it is genuinely empty.

**Goal.** One sentence: what this work is supposed to achieve, in the user's terms, not the ticket's.

**State.** What is done, what is half-done, what has not been started. Be specific about half-done — "auth works, but the refresh-token path is stubbed and returns a fixed string" beats "auth in progress".

**Files touched.** Path plus one line on what changed and why. Include files you read and decided not to change when the decision was non-obvious.

**Decisions and why.** The choices a reasonable person would question. Each one: what was chosen, what was rejected, and the reason. This is the section that saves the next session an hour.

**Dead ends.** What was tried and did not work. Name the failure mode. Without this, the next session repeats it.

**Next step.** The single next action, concrete enough to start on immediately. Not "continue the refactor" — "extract `parseInvoice` from `billing.ts:210` into its own module, then point the three callers at it".

**Open questions.** Anything waiting on a human. Name who, and what the question is.

## How to Gather It

Prefer evidence over memory:

- `git status` and `git diff --stat` for what actually changed on disk.
- `git log --oneline -15` for what landed.
- Test/build output from the last run, if there was one.
- The user's own words for the goal — quote them rather than paraphrasing into corporate language.

If the transcript disagrees with the repo, the repo wins. Say so in the handoff.

## Rules

- No status-report padding. No "we made great progress". A handoff is field notes, not a stakeholder update.
- Include the commands to get back to a working state: the dev-server command, the test command, any env var that has to be set.
- Never claim something works that you did not see work. Write "untested" next to it.
- If work is on a branch, name the branch and the base it forked from.
- Uncommitted changes: say so explicitly at the top, and list them. That is the most common way work gets lost.

## Output Format

```markdown
# Handoff — <topic> — <date>

**Goal:** <one sentence>

**Branch:** <name> (base: <name>) · **Uncommitted:** <yes, list / no>

## State
- Done: ...
- In progress: ...
- Not started: ...

## Files
- `path/to/file.ts` — <what and why>

## Decisions
- <chose X over Y because Z>

## Dead ends
- <tried X, failed with Y — don't repeat>

## Next step
<one concrete action>

## Open questions
- <question> — needs <person>

## Getting back to work
```bash
<commands>
```
```

## When the Context Window Is the Reason

If the handoff is being written because context is nearly full, write the file first, before any other work. Then tell the user to start a fresh session and open the file. Do not try to squeeze in one more fix — a truncated handoff is worse than an early one.
Read the full SKILL.md on GitHub

More agent workflow skills

Agent Eval Harness

Use to test whether an AI agent, prompt, or skill actually works before or after it ships — build a small eval set, score runs, and catch regressions when the prompt or model changes. Trigger when the user asks whether a prompt is good, wants to compare models or versions, sees inconsistent agent output, or is about to put an agent in front of customers.

AI Coding Guardrails

Use when an AI coding agent is writing or refactoring production code and its known failure modes need to be held in check — over-engineering, silent scope creep, invented APIs, claiming work is done without checking, deleting tests to make them pass. Trigger when the user asks for careful, production-grade, or reviewed code, or when a previous agent run produced confident output that turned out wrong.

Claude Md Writer

Use to create or clean up the CLAUDE.md (or AGENTS.md) file that tells a coding agent how to work in a repo — commands, conventions, architecture, and the traps. Trigger when onboarding an agent to a codebase, when the agent keeps making the same repo-specific mistake, or when the user asks for project instructions, agent rules, or a context file.

Context Budget

Use when a coding session is burning context fast, output is drowning in noise, the model keeps forgetting earlier decisions, or the user asks to reduce tokens, stop the verbose narration, work in a huge repo, or make a long session survive. Covers what to read, what to summarize, what to write to disk, and when to start fresh.