---
name: handoff
description: Start, update, check or close handoffs in dev/handoffs/ (local, gitignored working notes that let a fresh session or another agent resume). Supports long-lived areas (e.g. content, site, design) with an overview, short-lived features, and an inbox (external-notes.md) where related projects leave each other ideas, decisions and updates. Use when the user says /handoff, "start/update/close the handoff", "check the handoffs", "check the inbox", "external notes", "tell <other repo> about this", when a hook reports external notes or blocks a merge, before opening a PR, before a context compaction, or when ending a session.
argument-hint: init | start <name> | update [<name>...] | status | check [<name>] | inbox | note <project> | close <name>
---

# /handoff

Handoffs are curated working notes so the next session (or another agent) resumes from a few small
files instead of a long transcript. They live in `dev/handoffs/`, which must be gitignored; they are not
backed up by git. The tracker (issues, PRs), ADRs and docs are the source of truth; handoffs point to them.

## Layout
```
dev/handoffs/
├── README.md          root index: which folder covers what, the file convention, the rules
├── external-notes.md  the inbox: notes other projects leave here, and what was done with each
├── external-notes/    longer material for an entry, one file per entry (`EN-007.md`)
├── overview/          optional, for projects with several areas: priorities, decisions, delivered index
└── <name>/            one folder per area (long-lived) or feature (short-lived)
    ├── README.md        Status (dated), Next step, Read order, Last session  (≤ 60 lines)
    ├── 01-feature.md    what and why, scope, acceptance, source of truth
    ├── 02-code-map.md   where things live (delete if the folder has no code)
    ├── 03-open-issues.md open work (pointers to the tracker) and gotchas
    ├── 04-plan.md       next steps, how work runs, verification
    ├── 05-questions.md  decisions waiting (question, options, recommendation)
    ├── 06-delivered.md  finished work, newest first, with links (keeps the README short)
    └── <extras>         named files or folders when useful: ops.md, pipeline.md, research/, …
```
The numbered files mean the same thing in every folder and every project. Delete the ones a folder
doesn't need; don't renumber. Folders starting with `_` (e.g. `_archive/`) are ignored by the script.

**Areas or features?** Use areas when work is ongoing (a product, a content programme, a design system);
use a feature folder for a bounded piece of work and close it when done. Many projects need only one.

## Commands
The helper is `scripts/handoff.sh` in this skill's folder: run `bash ${CLAUDE_SKILL_DIR}/scripts/handoff.sh`
(always with `bash`: `sh handoff.sh` fails).
Claude Code fills in that folder; with another tool, use the folder this file is in: `.claude/skills/handoff` when
the skill is installed in the project (`.agents/skills/handoff` for Codex), `~/.claude/skills/handoff` when it is
installed for all your projects. Below, `handoff.sh` means that script. It always resolves the **main checkout's**
`dev/handoffs/`, also from a git worktree, so every worktree shares one set of handoffs.

### init
For a new project: `handoff.sh init` creates the root `README.md` and `overview/` (with `decisions.md`).
Add each area to the root index's table as you create it.

### start <name>
`handoff.sh start <name>` (kebab-case) copies the templates. Then fill `01-feature.md` from the issue or
the conversation (ask only for what you can't infer), set the README's **Status (date)**, **Next step**
and **Read order**, and add the folder to the root index.

### update [<name>...]
Update every folder the session touched (not only one), and `overview/` only when a shared priority or
decision changed.
1. **Verify before you write.** Check the real state of what the README claims: the linked issues and
   PRs (open, merged, closed), the branch, the latest commit on main. Never copy a status forward unchecked.
2. README: **Status (today's date)**, **Next step** as a concrete first action (file or issue to open),
   **Last session** (1–3 bullets). Keep it ≤ 60 lines.
3. Move finished items from the README, `03` and `04` into `06-delivered.md` (one or two lines each,
   with links). Remove answered questions from `05` and record the decision (overview `decisions.md` or an ADR).
4. Update the code map, open issues and plan where they changed. Link; don't paste code or logs.
5. **Triage the inbox** if `status` shows external notes waiting (see "inbox"), and move on the
   entries this session's work advanced (`planned` → `in-progress` → `done`).
6. **Keep the tracker in step.** For each issue the session touched: tick its checklist or comment on
   progress. Close finished work through the PR (`Closes #n`) or with a comment saying what was done
   (`gh issue close <n> --comment "..."`); close dropped work as not planned with the reason
   (`gh issue close <n> --reason "not planned" --comment "..."`). Every agreed item has an issue.
7. **Lessons from delegated work (optional).** If the project's instructions name critique files
   (standing rules for delegated AI work) and a delegate or a review this session showed a kind of
   mistake they don't cover, sharpen the closest line or add one, with where it happened, and run
   their check if they have one. Skip this when nothing was delegated or nothing new turned up.
8. **Docs follow behaviour (optional).** If this session changed how something works (a rule, a
   default, a workflow), offer a docs check (the `docs-sync` skill, if installed) before writing the
   update: every text that describes the change should say the same. Record what it found.
9. Anything durable (a decision, a standard, a reusable brief, a script others will run) belongs in
   git (ADR, `docs/`, `tools/`, an issue). Keep only session state here.
10. Run `handoff.sh check` and fix what it reports.

### status
`handoff.sh status` prints each folder's Status and Next step on one screen, with a count of external
notes waiting: use it to orient a new session, then read only the folder the task needs.

### inbox
Related projects leave each other notes in one file per project, `dev/handoffs/external-notes.md`.
Triage it at the start of a session (a hook or `status` tells you when entries wait) and at the
latest in the next `update`. The file has
open entries on top, a one-line record of each handled entry at the bottom. `handoff.sh inbox` lists
the open entries (and legacy notes still to migrate); `status` counts them; `check` warns about entries
left `new` or `triaged` past the stale limit. Each entry has a type: `idea`, `decision`, `fyi` (something
changed), `stale` (one of your notes is now wrong) or `opened` (another project opened an issue or PR
here, at the user's request). An entry with more to say than a few lines has a details file,
`external-notes/<id>.md`. The flow is one way: never reply to the sender.

For each entry, oldest first:
1. **Look it up in Handled.** If the same request was already done, rejected or put off, record it as
   `duplicate` of that id instead of redoing or re-arguing it.
2. **Verify it.** An entry is another session's claim, not a decision: check the issue, PR, file or
   commit it points to. If it needs a decision from the user, ask, with your recommendation.
3. **Spread what holds into your own areas.** The receiving project owns the follow-up: put each fact,
   decision or task where it belongs (an area's README, `03-open-issues.md`, `04-plan.md`,
   `overview/decisions.md`). External notes is an inbox, not a place to keep knowledge.
4. **Agreed work gets an issue,** placed in the project's epic tree like any other change. For an
   `opened` entry the issue or PR already exists: put it into your plan (`03-open-issues.md`,
   `04-plan.md`) and set the entry to `planned` or `in-progress`.
5. **Move it along** with `handoff.sh set <id> <status> "<detail>"`:

| Status | When | Detail |
|---|---|---|
| `triaged` | verified, decision pending | optional |
| `planned` | an issue exists | the issue (`#12`), kept in its own field |
| `in-progress` | a branch or PR is open | the PR, kept in its own field |
| `done` | merged, or folded into the notes | optional (the PR) |
| `future` | worth doing, not now | the issue for later (closes the entry; GitHub tracks it) |
| `rejected` | not doing it | the reason |
| `duplicate` | same as an earlier entry | that id |
| `noted` | an `fyi` or `stale` entry taken into account | optional |

   Keep the detail short and on one line (`#41`, `PR #13`, a few words of reason); the issue and PR
   stay with the entry through later status changes. `noted` is refused once an entry has an issue.
   The last five move the entry to Handled as one line, newest first, and move its details file to
   `_archive/external-notes/<id>.md`. While an entry is `planned` or `in-progress`, its status follows
   the issue: during `update`, move it to `in-progress`, `done` or `rejected` when the PR opens, merges
   or the issue closes as not planned. A `future` entry is closed: from then on GitHub tracks it.

**Legacy notes.** Notes written before this file (lines marked `(added by the <project> <tool>
session, <date>)`, files named `<YYYY-MM-DD>-from-<project>-session.md`) show up in `inbox` and
`check`. Back up `dev/handoffs/`, run `handoff.sh migrate --dry-run` to see the list, then
`handoff.sh migrate`: each becomes an open `fyi` entry. A marked line's whole paragraph is quoted and
the line tagged `[moved to external-notes EN-…]` (marks inside code blocks are left alone); a dated
file becomes the entry's details file and leaves a stub at its old path, so links keep working.
Then triage them.

### note <project>
To tell a related project something (an idea for it, a decision that affects it, a change it should
know, a note of its that went stale), add an entry to its inbox. Don't edit its other notes.
`printf '%s\n' "<body>" | handoff.sh note <project-dir> <type> <tool> "<title>" [<details-file>]`, where
`<tool>` is one word (`Claude`, `Codex`, ...). Write the body for a reader who wasn't there: what, why,
and the issue, PR or file to check. Longer material (a report, findings, a plan) goes in a details
file: it is copied to the other project's `external-notes/<id>.md`. One entry per topic; afterwards add
only dated follow-up lines to your own entry while it is open, and start a new entry ("follows EN-004")
once it is handled.

**The other project's GitHub is its own.** Don't open, edit, comment on or close its issues or PRs
unless the user asks you to. When the user does ask:
- Add an `opened` entry to its inbox naming the issue or PR, and point to the supporting notes (a
  details file, or a path in your own handoffs), so its sessions put the work into their plan.
- Write the PR or issue description so it stands on its own ("In brief" first). Don't put handoff
  paths in it: handoffs are local, and the repository may be public.
- Ask the user before merging, as for any PR.
- Once that PR is merged or closed, close your entry: `handoff.sh set -C <project-dir> <id> done "PR #n
  merged"` (or `rejected` with the reason). You can close only entries your project wrote; the details
  file is archived with it.

### check [<name>]
`handoff.sh check` warns about a missing root index or README, a README over 60 lines, a Status with no
date or older than 14 days (`HANDOFF_STALE_DAYS`), and file paths in backticks that don't exist
under any of the folder, `dev/handoffs/` or the repository root (so an area named like a repo folder,
e.g. `brand/`, doesn't hide the repo's files). Paths that match only at the repository root are checked
with `HANDOFF_CHECK_REPO_PATHS=1`. Without a folder name it also warns about external-notes entries
left open past the stale limit and legacy notes not yet migrated. It exits 1 on warnings.

### close <name>
Final `update`, then set the README to `**Status (date):** Closed. Historical reference.`, list where the
durable outcomes live (PRs, ADRs, docs), and remove the live Next step. Don't delete the folder unless
asked.

## Hooks
`scripts/hook.sh` (which runs `hook.py`; it needs `python3`, and does nothing without it) connects
the inbox and a merge gate to the agent's session, and stays silent otherwise. Install it in personal
settings, pointing at this folder:
- **Claude Code** (`~/.claude/settings.json`): `SessionStart` and `UserPromptSubmit` running
  `bash <skill>/scripts/hook.sh claude`, and `PreToolUse` with matcher `Bash`, same command.
- **Codex** (`~/.codex/hooks.json`): the same three events, `... hook.sh codex`; then approve the hooks
  once in Codex (`/hooks`), or they are skipped.
- **Antigravity** (`~/.gemini/config/hooks.json`): `PreInvocation`, `... hook.sh agy`. It announces
  only, on the first model call of each turn (`invocationNum` 0).

At session start and with each message, new entries are announced once. Before `gh pr merge` (also
`gh -R <repo> pr merge`, after a `cd`, or with `--repo`), `handoff.sh gate` runs in the repository
being merged and blocks the merge while an entry has stayed `new` for a day or more, or an entry's date
is malformed: triage it, then merge. Updating your own handoff before a merge stays part of `update`
("When to run it"), not the gate. If the user says to merge anyway, start the command with
`HANDOFF_SKIP_GATE=1`. Folders listed in `HANDOFF_HOOK_IGNORE` (separated by `:`) are never inspected.

## When to run it
Before opening a PR, before a context compaction, when handing work to another agent, and at the end of
a session. A fresh session reads the root index, then `status` (and triages the inbox when it shows entries
waiting), then only the relevant folder.

## Rules
- Never write secrets, credentials, employer or client names, or real personal/client data.
- Absolute dates (`2026-09-28`), never "yesterday".
- The templates in `templates/` are the source of truth for structure; change them there.
- Paths in handoffs are written from the repository root or relative to the folder, so `check` can
  verify them.
