By obie
A Claude Code plugin that writes a handoff document before an idle session's prompt cache goes cold
npx claudepluginhub obie/auto-handoffWrites a handoff document when a session has sat idle long enough that its prompt cache is about to go cold.
A Claude Code plugin that writes a handoff document when you walk away from a session.
Claude Code keeps a session's context in a prompt cache that expires an hour after the last request. A turn sent inside that hour reads the conversation back at a fraction of the usual input price. Once the hour is up, the next turn pays full price to read everything again, and on a long session that is slow and expensive.
auto-handoff watches the gap. When a session has sat idle for 50 minutes it runs a handoff command while the cache is still warm, so the state of your work lands in a file that a fresh session can resume from.
/plugin marketplace add obie/auto-handoff
/plugin install auto-handoff@auto-handoff
The plugin loads at the next session start.
It is built on the function hooks plugin API, which is early access and may change between Claude Code releases. Development and testing happened on Claude Code 2.1.289.
minutes of idle time the plugin runs command as if you had typed it, and a toast says so./clear cancels a pending handoff.The default command is /auto-handoff:handoff, a skill that ships with the plugin. You can run it by hand too.
It writes docs/handoffs/<timestamp>-<slug>.md, covering the goal, status, decisions, dead ends, files, verification commands, next steps and open questions. To do that it runs date and git status, then writes that one file. Nothing gets committed.
Nobody is there to answer a permission prompt when it runs, so the skill pre-approves those tools for itself through allowed-tools. It completes in the default permission mode.
| Option | Default | Meaning |
|---|---|---|
minutes | 50 | Idle time before the command runs |
command | auto-handoff:handoff | Slash command to run, as you would type it, with any arguments after its name |
Set them with /plugin configure auto-handoff inside Claude Code, or from a shell:
echo '{"command": "my-plugin:my-handoff"}' | claude plugin configure auto-handoff@auto-handoff --values-stdin
Arguments go after the command's name, as they would at the prompt. A command that behaves differently when nobody is there can be told so: my-plugin:park idle-triggered.
A command of your own has to get through an unattended run. Give it allowed-tools for whatever it calls, or run your sessions in a permission mode that lets it write.
minutes. The plugin cannot tell which cache a session has.git clone https://github.com/obie/auto-handoff ~/projects/auto-handoff
ln -s ~/projects/auto-handoff ~/.claude/skills/auto-handoff
Claude Code loads the linked folder as auto-handoff@skills-dir at the next session start and reloads the hooks module when you save a file.
claude plugin validate .
claude plugin test .
The pieces:
hooks/register.ts is the hooks module: an idle timer armed at turn.complete and cancelled at turn.start.types/index.d.ts declares the two values the module keeps in $.state.skills/handoff/SKILL.md is the bundled handoff skill.tests/ runs under claude plugin test against a mocked clock.MIT
7-day visitors to each marketplace page
Anthropic example skills
Anthropic's Claude Code plugins, installed from the claude-plugins-official repository
Ultra-compressed communication mode. Shortens prose while preserving technical terms, code, commands, and exact errors.