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 alexknowshtmlv0.8.7MITIn 2 marketplaces
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.
Trending plugins
7-day copy clicks
Code that runs inside Claude Code on every session, as you, unsandboxed.
Claude Code asks for these when you enable the plugin. Sensitive values are stored in your system keychain.
Viewer addressviewer
Where the mod serves a readable page for each brief, as host:port. "tailscale" as the host means this machine's Tailscale IP, so only your tailnet can open it; without Tailscale it serves on 127.0.0.1. Leave blank for no server; the link is then the local file.
stringdefault tailscale:3846
1 critical to review before installing
JavaScript or TypeScript that runs inside Claude Code as you, unsandboxed. Read from its source, it sees, changes or blocks tool calls; runs programs; writes files; reads files; reads environment variables (AUTO_HANDOFF_DISABLE, AUTO_HANDOFF_TOKENS, DISABLE_AUTO_COMPACT, HOME, USERPROFILE); runs commands; calls a model on your account; reads or rewrites your prompts; sends prompts on its own.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
2 marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
thresholdContext size that triggers a handoff. AUTO_HANDOFF_TOKENS overrides it for a test run. A seeded session hands off no sooner than 40k past its starting size; the panel above the prompt says so when this is set lower.
numberdefault 160000
Ignored files (regex)ignoreFiles
Edited files matching this pattern are left out of the brief, such as auto-synced state or caches. Leave blank for none.
stringdefault
Brief template filebriefTemplate
Markdown file that tells Haiku which sections to write. Created with the defaults on first run; edit it to change the brief.
stringdefault ~/.claude/auto-handoff/brief.md
Instructions template fileinstructionsTemplate
Markdown file that tells the fresh session how to read the brief. Created with the defaults on first run.
stringdefault ~/.claude/auto-handoff/instructions.md
Handoffs in a row without a messagemaxConsecutiveHandoffs
Handoffs allowed before you type a prompt. Past this the mod pauses until you send one.
numberdefault 2
A Claude Code mod that hands a long session off to a fresh one before the context fills up. It replaces auto-compact.
At the threshold, Haiku writes a structured handoff brief to disk. Then the mod runs /clear and seeds the new session with one line that points at the brief. The fresh session reads the brief and keeps working.

A live run on Haiku with the threshold at 80k. The mod refuses a read at the threshold, writes the brief, clears, and the fresh session is back at work about 7 seconds later at 31k. (video)
Auto-compact summarizes in place, and you can't control what it keeps. A handoff brief has a fixed structure that you can edit. It covers work in progress, decisions, assumptions to verify, dead ends, your last request and whether it was answered, and the next step. The files, commits and issues sections come from the transcript in code, so they don't depend on the model's memory.
Threshold. The mod checks the context size after each turn and before each model request, including tool output that hasn't been measured yet. Once it's past the threshold, the mod refuses new tool calls, so one burst of reads can't overflow the window. Unmeasured tool output is an estimate that can run high, so the real size sometimes comes in under the threshold. A refused call still ends in a handoff, at the next request or the end of the turn.
Brief. Haiku writes the brief from the transcript. If Haiku fails, a facts-only brief stands in. Briefs go to ~/.claude/state/auto-handoff/<session-id>.md.
Clear and seed. The mod runs /clear and sends the fresh session one line: read the brief and follow its Instructions section. In the transcript, that line's brief path and viewer URL are drawn as links. Claude Code makes them clickable only when it detects a terminal that supports links. Over plain SSH it usually doesn't, so set FORCE_HYPERLINK=1 if your terminal handles links, or use the status line link below.
A panel above the prompt. It shows each step with a braille spinner on the one still running: writing the brief, clearing, starting the fresh session. Once the new session is measured it reads ✓ handed off · 162k → 45k with an open brief link, then collapses after 10 seconds. Failures, the loop-guard pause, a facts-only brief and a too-tight threshold stay up until you press Dismiss. Typing /clear yourself closes the panel, including one waiting for Dismiss, unless a handoff is running. The panel steps aside while a survey holds that band. The band is drawn on the terminal and desktop only, so on the mobile app or in VS Code the threshold, the result, and anything that stays up also arrive as a toast.
Viewer. Each brief also gets a readable page in ~/.claude/state/auto-handoff/pages/. The page shows the brief and every handoff in the same run, linked in order. The served link is short, like http://100.x.y.z:3846/1a2b3c4d, so it fits on one line on a phone. By default the mod serves these pages on your Tailscale IP at port 3846, so you can open them from any device on your tailnet. Devices off your tailnet can't reach them. The server starts with the first session that loads the mod and runs while that session is open; if it stops, including when the mod reloads, the next session to finish a turn starts it again. A session that finds the port already taken logs one line and leaves the running server alone, since it serves the same pages. Without Tailscale, the mod serves on 127.0.0.1 instead, so the link opens only on this machine. If Tailscale comes up later, a session already serving on localhost keeps using it; the next new session can serve on the Tailscale IP.
Status line link (optional). statusline/handoff-link.sh wraps your status line command and adds a ↪ <link> line when the session came from a handoff. Set it as the statusLine command in ~/.claude/settings.json, with your existing command after it:
"statusLine": { "type": "command", "command": "~/claude-auto-handoff/statusline/handoff-link.sh ~/.claude/my-statusline.sh" }
It needs jq. It finds the link in the previous brief's header, which names this session in to: and the page in viewer:.
Loop guards stop a fresh session that starts large from handing off again right away. They also cap how many handoffs run in a row before you type something.
Requires a Claude Code build with mods (function-hook plugins).
git clone https://github.com/alexknowshtml/claude-auto-handoff.git ~/claude-auto-handoff
claude --plugin-dir ~/claude-auto-handoff
7-day copy clicks
Generated from the plugin's indexed repository (alexknowshtml/claude-auto-handoff) — no native marketplace selected
npx claudepluginhub p/alexknowshtml-auto-handoffBuilt from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Plugins from other owners that cover similar ground