← Back to the collection

Handoff Plugin

Preserve context between Claude Code sessions: one skill banks the current work into a handoff, a companion skill boots a fresh session from it, and hooks make the loop mechanical — pending handoffs are detected at session start, and a post-compaction nudge reminds the agent to bank context while it’s still fresh.

Installation

# Add the marketplace (if not already added)
claude plugin marketplace add jtsternberg/claude-plugins

# Install the plugin
claude plugin install handoff@jtsternberg

Skills

Both are skills, so each can be invoked explicitly by slash command or triggered automatically by Claude when the conversation calls for it.

/handoff:handoff

Create or update a handoff for the current work.

What it captures (the content contract):

Two storage backends, detected automatically:

Pickup handoff

Claude Code: /handoff:pickup-handoff [<bd-issue-id> | <path>]

Codex: $handoff:pickup-handoff [<bd-issue-id> | <path>]

Resume work from a handoff in a fresh session.

Pass the identifier when you have one — /handoff:pickup-handoff myproject-20xu in Claude Code or $handoff:pickup-handoff myproject-20xu in Codex — and it resolves that handoff in a single lookup. The handoff skill detects the active harness and prints the correct command when it saves, and the session-start notice lists the identifier per finding, so it’s almost always available. Without it, pickup has to search (branch/descriptive HANDOFF*.md → open pending-handoff: bd issues), which is guesswork once more than one handoff is open.

It then reads the handoff once, reconciles it against the actual repo state using the Anchor SHA (“N commits since the handoff was written; here’s what changed”), and — assuming the user hasn’t read the doc — plainly reports where things stand and the concrete plan before continuing. It also sweeps for stale leftover handoff files and flags obvious corpses.

Lifecycle rule: the handoff is a boot artifact, not a living document. The pickup agent never updates it after reading; when the work completes, the file is deleted (or the bd issue closed) and the user is told.

Hooks

Installed automatically with the plugin (hooks/hooks.json):

Codex requires a review/trust decision before a newly installed or changed plugin command hook runs. Open /hooks and trust the handoff hook definition before treating startup or compaction behavior as enabled. Claude Code does not use Codex’s hook trust gate.

Hook scripts are pure bash with no hard dependencies and degrade silently on any failure.

bash plugins/handoff/tests/session-start_test.sh   # stubs `bd` via PATH; touches no real database

Standalone use

Both skills work without the plugin’s hooks (e.g. copied into a project as bare skills): detection at session start and the Session section simply don’t happen, and everything else — writing, finding, reconciling, lifecycle — behaves the same.

Use Cases

Additional Documentation