handoff

A command that records the important state of a coding session in a handoff document. A handoff lets another agent or later session continue work without relying on the conversation history.

In plain words
What is it for?
Use it before ending a long task, reaching context limits, changing work phases, or handing work between people or agent sessions.
Why use it?
It prevents unfinished work, decisions, changed files, and encountered problems from being lost when a session ends or changes hands.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/coleam00/context-engineering-intro/handoff
Clone the repo
git clone --depth 1 https://github.com/coleam00/context-engineering-intro

Made for: Claude Code.

Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,039 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00012 $0.01039
Opus 5 $0.00006 $0.00519
Sonnet 5 $0.00002 $0.00208
Haiku 4.5 $0.00001 $0.00104

Measured 3d ago against content hash bb5f16ae13e8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

handoff scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to handoff — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

use-cases/ai-coding-wisc-framework/.claude/commands/handoff.md · 134 lines

How it starts

The opening of the file, as written. The whole thing — 134 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Handoff: Capture Session State for Continuation

Objective

Create a structured handoff document that captures everything the next session (or agent) needs to seamlessly continue this work. This is the Write + Compress pattern — you're externalizing the session's memory into a persistent file AND compressing it into just the essentials.

When to Use

  • Before ending a long session where work will continue later
  • Before hitting context limits (proactive, not reactive)
  • When switching from one phase to another (research → implementation)
  • When handing off between human and AI, or between AI sessions
  • Instead of relying on /compact for critical ongoing work

Process

1. Analyze the Current Session

Review everything that happened in this conversation:

  • What was the original goal or task?
  • What has been completed so far?
  • What is still in progress or blocked?
  • What key decisions were made and WHY?
  • What files were read, created, or modified?
  • What errors were encountered and how were they resolved?
  • What dead ends were explored (so the next session doesn't repeat them)?

2. Gather Current State

git status
git diff --stat HEAD
git log --oneline -5
git branch --show-current

3. Write the Handoff Document

Save to: HANDOFF.md in the current working directory (or the worktree root if in a worktree).

Use this exact structure:

# Handoff: [Brief Task Description]

**Date:** [current date]
**Branch:** [current branch name]
**Last Commit:** [hash + message, or "uncommitted changes"]

## Goal

[1-2 sentences: what we're trying to accomplish. Include the original user request or plan reference.]

## Completed

- [x] [Task 1 — brief description of what was done]
- [x] [Task 2 — brief description]
  - [Sub-detail if non-obvious]

## In Progress / Next Steps

- [ ] [Task 3 — what needs to happen next, with enough detail to act on]
- [ ] [Task 4 — include file paths and specific areas to focus on]
- [ ] [Task 5 — any blocked items with explanation of the blocker]

## Key Decisions

Document WHY choices were made, not just what was chosen:

- **[Decision]**: [What was chosen] — [Why, including alternatives rejected]
- **[Decision]**: [What was chosen] — [Why]

## Dead Ends (Don't Repeat These)

- [Approach that was tried and didn't work] — [Why it failed]
- [Investigation path that turned out to be irrelevant] — [What we found instead]

## Files Changed

- `path/to/file.ts` — [what changed and why, 1 line]
- `path/to/new-file.ts` — [NEW: what this file does]
- `path/to/deleted-file.ts` — [DELETED: why it was removed]

## Current State

- **Tests:** [passing/failing — which specific tests and why]
- **Type-check:** [clean/N errors — what kind]
- **Lint:** [clean/N warnings — what kind]
- **Build:** [working/broken]
- **Manual verification:** [what was tested manually, results]

## Context for Next Session

[2-4 sentences: the MOST IMPORTANT thing the next agent needs to know. What's the current situation? What's the biggest risk? What should they do first?]

**Recommended first action:** [Exact command or step to take first]

Read the full file on GitHub · 134 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 134 lines · 12 tokens per session scan A bb5f16ae13e8

Subscribe to this mod's changes

handoff is a command published in the GitHub repository coleam00/context-engineering-intro (13,819 stars, last pushed 5mo ago), licensed MIT. It adds 12 tokens to every session and 1,039 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to handoff, differing in 0 lines, and is treated as a copy.