Handoff
Use this skill to make the current repository work resumable across Codex sessions.
HANDOFF.md at the repository root is the single handoff artifact.
The active conversation goal is the highest-priority state. Git diff is supporting evidence, not the source of truth for what the next session should do.
Trigger Modes
/handoff, $handoff, handoff, 交接, or a request to hand off current work: capture the current work state into HANDOFF.md.
/handoff resume, $handoff resume, handoff resume, 恢复交接, or a request to continue previous handoff work: read HANDOFF.md and continue from it.
Capture Workflow
When capturing a handoff:
- Capture the active conversation state first:
- the user's current goal in concrete terms
- the latest explicit user request
- important user messages or constraints that shaped the work
- decisions already made in the conversation
- commitments made by the assistant that remain relevant
- assumptions, open questions, and scope boundaries
- Identify the repository root and current branch.
- Gather current git state with:
git rev-parse --show-toplevel
git branch --show-current
git status --short
git diff --name-status
git diff --stat
git log -5 --oneline --decorate
- Use local artifacts to cross-check completed work, in-progress work, decisions, blockers, and next step.
- Read relevant working artifacts if they exist, such as
PLAN.md, PROGRESS.md, OUTPUT.md, or LINEAR.md.
- Write or replace
HANDOFF.md at the repository root with the template below.
- Keep the content concise and factual. Preserve the task goal and user intent even if the diff is small, incomplete, or unrelated.
- Do not include large raw diffs. Summarize changed files and cite paths.
- Do not run verification only for handoff capture. Record verification that already ran and any verification still needed.
Use apply_patch for manual edits to HANDOFF.md when available.
HANDOFF.md Template
# Handoff
## Snapshot
- Updated: <YYYY-MM-DD HH:mm:ss TZ>
- Repository: <absolute repo path>
- Branch: <current branch>
- Head: <short commit hash and subject if useful>
## Current Goal
<The active user goal in one or two concrete sentences.>
## Conversation Context
- Latest user request: <the newest explicit instruction from the user>
- Important user messages:
- <short factual summary or short quote when wording matters>
- Constraints and preferences:
- <task-specific constraints from the user or repository>
- Decisions already made:
- <decision and reason>
- Assistant commitments:
- <work promised or implied that still matters>
## Progress
- Completed:
- <facts about work already done>
- In progress:
- <current incomplete step>
- Next:
- <the next concrete action another session should take>
## Changed Files
- `<path>`: <purpose/status>
## Commands And Verification
- `<command>`: <status/result>
## Risks And Blockers
- <risk, blocker, open decision, failing command, or branch concern>
## Git State
```text
<git status --short>
```
## Diff Summary
```text
<git diff --stat>
```
## Recent Commits
```text
<git log -5 --oneline --decorate>
```
## Resume Instructions
1. Read this file first.
2. Treat `Current Goal` and `Conversation Context` as the primary source of task intent.
3. Confirm the current branch matches `Branch`.
4. Inspect the changed files named above before editing them.
5. Continue with the `Next` item from `Progress`.
6. Preserve raw error messages from failed commands while debugging.
If a section has no data, write None known instead of leaving it empty.
Resume Workflow
When resuming:
- Read repository-root
HANDOFF.md before planning or editing.
- Restate the loaded
Current Goal, latest user request, and next action in a short update before changing files.
- Run:
git branch --show-current
git status --short
- Compare the current branch with the saved
Branch.
- If the branch differs, state the saved branch and current branch. Avoid editing until the branch decision is clear unless the user's message explicitly permits continuing on the current branch.
- Read the changed files and any task artifacts named in
HANDOFF.md.
- Continue the work from the saved
Next item, validating against the current repository state and the saved conversation intent.
If HANDOFF.md is missing, say that no handoff file exists and ask for the current goal or a source artifact to resume from.
Quality Bar
- The handoff must be useful to a fresh session without conversation history.
- Losing the user goal is the main failure mode. The handoff must make the goal, latest request, and next action unmistakable.
- Include task-specific constraints that affect the next action.
- Include unresolved risks and failed commands with enough raw detail to debug.
- Keep repository rules and user instructions in force; do not duplicate the full
AGENTS.md.
- Update
HANDOFF.md again before ending if the resumed session makes meaningful progress and the user asks for another handoff.
1---2name: handoff3description: Use when the user sends /handoff, asks to hand off the current task, or wants a resumable session record that preserves the active conversation goal. Capture the latest user intent, important user messages, decisions, constraints, progress, risks, blockers, current branch, changed files, commands, and next steps to repository-root HANDOFF.md. Use when the user sends /handoff resume to read HANDOFF.md first and continue the previous work from that saved state.4---56# Handoff78Use this skill to make the current repository work resumable across Codex sessions.910`HANDOFF.md` at the repository root is the single handoff artifact.1112The active conversation goal is the highest-priority state. Git diff is supporting evidence, not the source of truth for what the next session should do.1314## Trigger Modes1516- `/handoff`, `$handoff`, `handoff`, `交接`, or a request to hand off current work: capture the current work state into `HANDOFF.md`.17- `/handoff resume`, `$handoff resume`, `handoff resume`, `恢复交接`, or a request to continue previous handoff work: read `HANDOFF.md` and continue from it.1819## Capture Workflow2021When capturing a handoff:22231. Capture the active conversation state first:24 - the user's current goal in concrete terms25 - the latest explicit user request26 - important user messages or constraints that shaped the work27 - decisions already made in the conversation28 - commitments made by the assistant that remain relevant29 - assumptions, open questions, and scope boundaries302. Identify the repository root and current branch.313. Gather current git state with:32 - `git rev-parse --show-toplevel`33 - `git branch --show-current`34 - `git status --short`35 - `git diff --name-status`36 - `git diff --stat`37 - `git log -5 --oneline --decorate`384. Use local artifacts to cross-check completed work, in-progress work, decisions, blockers, and next step.395. Read relevant working artifacts if they exist, such as `PLAN.md`, `PROGRESS.md`, `OUTPUT.md`, or `LINEAR.md`.406. Write or replace `HANDOFF.md` at the repository root with the template below.417. Keep the content concise and factual. Preserve the task goal and user intent even if the diff is small, incomplete, or unrelated.428. Do not include large raw diffs. Summarize changed files and cite paths.439. Do not run verification only for handoff capture. Record verification that already ran and any verification still needed.4445Use `apply_patch` for manual edits to `HANDOFF.md` when available.4647## HANDOFF.md Template4849````markdown50# Handoff5152## Snapshot5354- Updated: <YYYY-MM-DD HH:mm:ss TZ>55- Repository: <absolute repo path>56- Branch: <current branch>57- Head: <short commit hash and subject if useful>5859## Current Goal6061<The active user goal in one or two concrete sentences.>6263## Conversation Context6465- Latest user request: <the newest explicit instruction from the user>66- Important user messages:67 - <short factual summary or short quote when wording matters>68- Constraints and preferences:69 - <task-specific constraints from the user or repository>70- Decisions already made:71 - <decision and reason>72- Assistant commitments:73 - <work promised or implied that still matters>7475## Progress7677- Completed:78 - <facts about work already done>79- In progress:80 - <current incomplete step>81- Next:82 - <the next concrete action another session should take>8384## Changed Files8586- `<path>`: <purpose/status>8788## Commands And Verification8990- `<command>`: <status/result>9192## Risks And Blockers9394- <risk, blocker, open decision, failing command, or branch concern>9596## Git State9798```text99<git status --short>100```101102## Diff Summary103104```text105<git diff --stat>106```107108## Recent Commits109110```text111<git log -5 --oneline --decorate>112```113114## Resume Instructions1151161. Read this file first.1172. Treat `Current Goal` and `Conversation Context` as the primary source of task intent.1183. Confirm the current branch matches `Branch`.1194. Inspect the changed files named above before editing them.1205. Continue with the `Next` item from `Progress`.1216. Preserve raw error messages from failed commands while debugging.122````123124If a section has no data, write `None known` instead of leaving it empty.125126## Resume Workflow127128When resuming:1291301. Read repository-root `HANDOFF.md` before planning or editing.1312. Restate the loaded `Current Goal`, latest user request, and next action in a short update before changing files.1323. Run:133 - `git branch --show-current`134 - `git status --short`1354. Compare the current branch with the saved `Branch`.1365. If the branch differs, state the saved branch and current branch. Avoid editing until the branch decision is clear unless the user's message explicitly permits continuing on the current branch.1376. Read the changed files and any task artifacts named in `HANDOFF.md`.1387. Continue the work from the saved `Next` item, validating against the current repository state and the saved conversation intent.139140If `HANDOFF.md` is missing, say that no handoff file exists and ask for the current goal or a source artifact to resume from.141142## Quality Bar143144- The handoff must be useful to a fresh session without conversation history.145- Losing the user goal is the main failure mode. The handoff must make the goal, latest request, and next action unmistakable.146- Include task-specific constraints that affect the next action.147- Include unresolved risks and failed commands with enough raw detail to debug.148- Keep repository rules and user instructions in force; do not duplicate the full `AGENTS.md`.149- Update `HANDOFF.md` again before ending if the resumed session makes meaningful progress and the user asks for another handoff.