auto-handoff
by Alex Hillman · ★ 23 · updated yesterday
Hands a Claude Code session off to a fresh one before the context fills: a Haiku-written brief, /clear, and a seed that points the new session at the brief.
Install
git clone https://github.com/alexknowshtml/claude-auto-handoffclaude --plugin-dir ./claude-auto-handoffThen run /reload-plugins or start a new session. Requires Claude Code 2.1.287+.
What it hooks into
From an automated scan with claude plugin validate, not a security review. Mods run with your permissions; read the code before installing.
- Events
turn.completetool.callturn.stepsession.compactui.renderprompt.submitclassic.SessionStart- API calls
$.clock.after$.clock.every$.command.run$.env.get$.fs.list$.fs.read$.fs.write$.model.complete$.process.run$.prompt.submit$.session.cwd$.session.id$.session.messages$.session.surfaces$.session.usage$.store.get$.store.set$.ui.invalidate$.ui.resolve$.ui.toast- Draws
AbovePromptUserMessage- Can see
every tool callcompactionevery promptclassic hooks- Reach
- level 2 of 3 runs processeswrites filesdrives Claudereads filesreads env varsreads the transcriptpersists statedraws
Origin
- How it got here
- Automated scan of public GitHub repos, via the CC0 dataset awesome-claude-code-mods (scan of ).
- Repository
- github.com/alexknowshtml/claude-auto-handoff
- Path in repo
- repository root
- Author
- Alex Hillman @alexknowshtml
- License
- MIT
- First published
- Last pushed
- First listed here
- On X
- Mentioned in 2 posts on X
Name and description come from the mod's own manifest. We link to the code; we don't host it, and it stays under its author's license.
Posts about this repo
You know how slow compaction can be? My time between sessions is rarely more than 20-30 seconds. How? I built auto-handoff, now open source as a Claude Mod that automatically indefinitely continues past the context limit using handoffs intead of compaction. Fast and fully tunable automatic handoffs + a UI for walking your handoff history. https://github.com/alexknowshtml/claude-auto-handoff Enjoy!
This Claude Code mod swaps auto-compact for an editable handoff brief. At 160k tokens Haiku writes work in progress, decisions and next steps to disk, then the session clears and resumes from that file. MIT, still early release. https://github.com/alexknowshtml/claude-auto-handoff/tree/main