handoff

Claude Code skill · oh-my-pi inspired

Hand off the work, not the context loss.

When a session runs long, handoff compacts everything that matters into one structured markdown file — objective, what's done, what's left, the exact next action — so a fresh-context agent resumes with zero ambiguity.

Pipeline
1 gather state 2 structure 3 write file 4 verify 5 resume

What it does

01An artifact, not an intention.

Captures exact state, not vibes

Real file paths, commands, test results, error text. The read/modified file sets are derived mechanically from tool history, never from recall.

Defends cold-resume failures

An explicit DO-NOT-REDO done list, a single exact next step, and any pending user question preserved verbatim.

Paste-ready & chainable

Writes handoffs/handoff-<timestamp>.md and emits a <handoff-context> block to paste into a fresh chat; each doc links to its predecessor.

How it works

02Gather → structure → write → verify.

STEP 1

Gather

Scan transcript + tool history, derive read/modified sets, run read-only git/test probes.

STEP 2

Structure

Fill the fixed template — Current State first, Done labeled DO NOT REDO.

STEP 3

Write

Save handoffs/handoff-<UTC>.md, fill the Handoff Chain link; merge a prior handoff if present.

STEP 4

Verify

Run the quality checklist: no secrets, no placeholders, copy-paste verify commands, open question preserved.

Default to a single reasoning pass with tools off — pure writing, no busywork.

Template sections

03Every part, always in the same place.

Current State (read this first)

One paragraph of what is true right now plus the active blocker; placed first to kill the "where was I" cost.

Metadata

Project path, git branch + HEAD, clean/dirty tree, agent/model — so staleness is detectable before any work.

Goal

The specific, measurable objective the user is trying to accomplish.

Constraints & Preferences

Constraints, requirements, and stated preferences the resuming agent must honor.

Progress

Three buckets — Done (DO NOT REDO, quantified, with evidence), In Progress, Pending (ranked by impact) — so finished work is never duplicated.

Immediate Next Step

The single exact first action to take, removing all ambiguity about where to start.

Key Decisions

Each decision paired with its rationale, so settled choices are not relitigated or silently reversed.

Files / Areas Touched

Files with purpose-of-change, plus mechanically-derived <read-files>/<modified-files> tags showing the real blast radius.

Key Patterns / Conventions

Non-obvious conventions discovered in this codebase, so the resuming agent matches existing style.

Gotchas / Landmines

Known traps and their workarounds, to prevent the resuming agent from re-hitting them.

Verification

Copy-pasteable build/test/lint commands plus the expected healthy result, to confirm state fast.

Open Questions (verbatim)

Any unanswered user/caller question, preserved word-for-word — the most resumption-critical, most-failed item.

Handoff Chain

A continues-from link to the predecessor handoff and this doc's own path, forming a durable audit trail.

Install

04Clone, symlink, done.

# clone the public repo $ git clone https://github.com/cskwork/agent-handoff.git # link the handoff/ skill folder (Claude Code + Codex) $ ln -s "$PWD/agent-handoff/handoff" ~/.claude/skills/handoff $ ln -s "$PWD/agent-handoff/handoff" ~/.codex/skills/handoff ✓ skill "handoff" available
auto-triggers at ~80% context or say: create a handoff / 핸드오프 만들어 Codex / Gemini: point at handoff/SKILL.md

Invoke it explicitly with "create a handoff", or let it trigger on a milestone or after 5+ edits. Output lands in handoffs/ in your working project.

Example output

05See the artifact, not just the idea.

# Handoff — JWT refresh-token endpoint > Generated: 2026-05-30T12-00-00-000Z · Continues from: none ## Current State (read this first) The /auth/refresh endpoint is wired and compiles. Happy-path works; the failing piece is rotation. 30/90 auth tests pass; 3 rotation tests fail. - Blocking right now: revokeToken() is a no-op stub. ## Progress ### Done — DO NOT REDO (4 of 6 slices) - [x] issueRefreshToken() at src/auth/tokens.ts:54 — verified - [x] POST /auth/refresh handler at src/auth/routes.ts:88 ## Immediate Next Step Implement revokeToken(hash) at src/auth/tokens.ts:72, then call it after the new pair is issued (src/auth/routes.ts:101). Run: npm test src/auth/rotation.test.ts ## Open Questions (preserve verbatim) - User asked: "should a reused refresh token revoke the whole session, or just 409?" — not yet answered.

examples/ → full coding + debugging examples in the repo.