Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By smacfiggenv1.1.0MITIn 1 marketplace
Serialize session state to a per-worktree payload stored outside the repo, auto-saved before context loss and auto-injected after
Claude loads one when your task matches it, or you run it by name.
No risk signals detected
Nothing flagged in this plugin's hooks, MCP servers or commands. Other components are not analyzed.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Saves your session state before context is lost, and hands it to the next session automatically.
One payload per worktree, stored outside the repo. Part of annex. Runs on Claude Code and Codex CLI.
Saving is explicit. Resuming is automatic. That asymmetry is the whole design:
/handoff-state:handoff writes the real, high-density payload. Run it when you are about
to stop, or about to compact.PreCompact and SessionEnd hooks write a mechanical snapshot as a safety net, for
when context runs out without warning. A deliberate /handoff from the last few minutes always
wins over a snapshot.SessionStart hook injects the payload into the next
session's context, with instructions to check it against git and pick up from EXECUTION_QUEUE
item 1. The payload is archived as it is read, so it is consumed exactly once and never
resurfaces in an unrelated session.Injection fires on startup, resume, compact and clear — so closing the terminal and
coming back tomorrow resumes the same way a /compact does, subject to HANDOFF_MAX_AGE_HOURS.
A /handoff-state:resume skill also ships, for what automation cannot cover: a payload
pasted into chat, or one you want to replay after it was already consumed (they are kept in
archive/). The injected text spells out the full resume procedure rather than just naming that
skill, so a payload still resumes on a machine without the skill installed, or in a harness that
loads no skills at all.
Run handoff-path.sh --list to see every worktree's payload, age and origin for the current
repo.
Three failures, stacked:
<repo>/.claude/handoff hit the same compiled-in sandbox
deny prefix that worktree-placement works
around, and the background-session worktree isolation guard from both sides — isolated, it
says "edit the worktree copy"; un-isolated, "call EnterWorktree first". Neither can write it.
<repo>/docs/handoff is writable, but lands in git.CLAUDE_PROJECT_DIR or cwd yields the worktree, so
payloads got written into disposable worktrees — deleted along with them, and invisible to the
next session, which read a different checkout and found nothing.~/.claude/handoff/<repo-slug>/<worktree-key>/
HANDOFF.md
archive/
.origin full worktree path + branch, so <worktree-key> is decodable
<repo-slug> comes from git rev-parse --git-common-dir, which points at the main repository
even from inside a linked worktree.
<worktree-key> is _main for the main checkout, otherwise <basename>-<8 hex of sha1 of the absolute worktree path>. Worktree basenames repeat across roots, so the path is the only thing
guaranteed unique.
| Event | Behaviour |
|---|---|
SessionStart | Mirrors the resolver script to ~/.claude/handoff/bin/ (skills are markdown and cannot expand ${CLAUDE_PLUGIN_ROOT}), then injects a recent payload once and archives it. |
PreCompact, SessionEnd (clear) | Writes a mechanical snapshot — unless a payload from a deliberate /handoff is newer than HANDOFF_FRESH_SECONDS, which wins. |
| Variable | Default | Effect |
|---|---|---|
HANDOFF_STORE | ~/.claude/handoff | Root of the payload store. |
HANDOFF_FRESH_SECONDS | 600 | A payload this new is treated as a deliberate /handoff and not overwritten by a snapshot. |
HANDOFF_MAX_AGE_HOURS | 24 | Older payloads are not injected. |
If jq, git or a hash tool is missing: no payload is written, a warning goes to stderr, and
the hook exits 0. It never interferes with compaction itself.
That matters because these hooks fire on PreCompact and SessionEnd — the exact moment the
user is losing context and is least able to react to a broken hook.
Hook stderr is invisible in normal use, so the SessionStart hook additionally prints a short
notice into the model's context naming what is missing and how to install it. When everything
is present it prints nothing at all.
handoff-state runs on Codex CLI unmodified — same scripts, same hooks/hooks.json, no second
copy of anything. Both halves work: the hooks fire, and the skills surface as
handoff-state:handoff and handoff-state:resume.
codex plugin marketplace add smacfiggen/agent-annex # or a local path
codex plugin add handoff-state@annex
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub smacfiggen/agent-annex --plugin handoff-statePlugins from other owners that cover similar ground