obie/auto-handoff
이 mod 소개
Claude Code는 세션의 컨텍스트를 프롬프트 캐시에 보관하며 마지막 요청 후 1시간이 지나면 만료됩니다. 그 1시간 안에 보낸 턴은 평소 입력 가격의 일부만 내고 대화를 다시 읽습니다. 1시간이 지나면 다음 턴에서 모든 내용을 다시 읽는 데 정가를 내야 하므로 긴 세션에서는 느리고 비용도 큽니다.
auto-handoff는 이 공백을 지켜봅니다. 세션이 50분 동안 유휴 상태이면 캐시가 아직 따뜻할 때 인계 명령을 실행해 작업 상태를 새 세션이 이어서 사용할 수 있는 파일에 남깁니다.
설치
먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.
claude plugin marketplace add obie/auto-handoff claude plugin install auto-handoff
원문 / README
auto-handoff
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.
Install
/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.
How it behaves
- The idle clock starts when a turn of the main conversation ends. Any new turn restarts it, whoever started that turn. A subagent finishing leaves it alone.
- After
minutesof idle time the plugin runscommandas if you had typed it, and a toast says so. - You get one handoff per absence. The plugin then stays quiet until you send a prompt or run a command yourself. A background task reporting in, or a scheduled trigger firing, keeps it quiet.
/clearcancels a pending handoff.- A laptop that slept through the wait wakes with a cold cache. The plugin sees that its timer fired late and skips the handoff, since running it then would cost the full price it exists to avoid.
The bundled skill
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.
Configuration
| Option | Default | Meaning |
| --- | --- | --- |
| minutes | 50 | Idle time before the command runs |
| command | auto-handoff:handoff | Slash command to run, without the slash |
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
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.
Limits
- The default of 50 assumes the one-hour cache. A session that has dropped to the five-minute cache, as happens in usage overage, needs a much smaller
minutes. The plugin cannot tell which cache a session has. - The handoff is a turn like any other. Each model request in it costs one cached read of the conversation, and the turn keeps the cache warm for another hour.
- The timer lives in the Claude Code process, so it stops when you quit Claude Code.
- A model that reaches for a tool the command has not pre-approved leaves the turn waiting at a permission prompt until you return.
Development
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.tsis the hooks module: an idle timer armed atturn.completeand cancelled atturn.start.types/index.d.tsdeclares the two values the module keeps in$.state.skills/handoff/SKILL.mdis the bundled handoff skill.tests/runs underclaude plugin testagainst a mocked clock.
License
MIT
동명의 다른 작품
- auto-handoffalexknowshtml · ★ 51
