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 STRMLv0.4.1MITIn 1 marketplace
A focused, un-loseable alternative to /compact: /clear-handoff saves a curated handoff and auto-loads it into the next session after /clear
You run one by typing its /name in Claude Code.
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; reads files; reads environment variables (HOME); runs commands; reads or rewrites your prompts; sends prompts on its own.
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.
A focused, un-loseable alternative to /compact for Claude Code.
/compact summarizes your whole transcript lossily and unfocused. /clear-handoff instead writes a curated handoff — only what the next session actually needs — saves it to a file, then clears the session and resumes from the handoff by itself. Nothing to copy, nothing to lose, no keypress.
The usual "context is getting long" options both hurt:
/compact keeps everything, badly. It re-summarizes the entire transcript, drops the details that mattered, and you can't steer what survives./clear, and then have to remember to paste it back — and remember where you saved it./clear-handoff fixes both: you (well, the model) hand-pick the state that matters, and a one-shot SessionStart hook injects it automatically the moment you start the next session in that directory. Then it deletes itself, so it fires exactly once.
/clear-handoff next session (after /clear)
───────────── ─────────────────────────────
1. gather live state (read-only): SessionStart hook fires:
TaskList, git branch/HEAD/status • realpath(cwd) → find matching sentinel
2. write curated handoff to • inject handoff into context + banner
$(pwd)/.tmp/<work-slug>-<timestamp>.md • delete sentinel (single-use)
3. arm a sentinel keyed to the cwd → you're resumed, automatically
under ~/.claude/tmp/pending-handoffs
4. print a 2-line fallback prompt
The command is a prompt injection, so it runs at any moment — even while subagents are still working — and it never stops or blocks on them. It records what each subagent was doing and where its output lands, so the fresh session can pick them up (they survive /clear).
SessionStart payload usually carries the logical/symlinked path. Both are realpath'd before matching, so it works under /tmp → /private/tmp, iCloud/OneDrive, and symlinked repos.clear / startup. compact and resume keep the existing context — consuming the handoff there would be redundant and would steal the one-shot from the real post-/clear session./clear, it expires instead of injecting stale "resuming X" context into some unrelated session days later.Add the marketplace and install the plugin:
/plugin marketplace add STRML/cc-clear-handoff
/plugin install cc-clear-handoff
Or in one step: /plugin install cc-clear-handoff --marketplace STRML/cc-clear-handoff.
Requires python3 (preinstalled on macOS and most Linux).
When context is getting long, instead of /compact:
/clear-handoff
/handoff is an alias for the same command. Add don't clear (or --no-clear) to save the handoff without clearing, for example when you hand off to another account or harness: /handoff don't clear.
Other agent harnesses (OMP, Codex) get the same procedure from shared-skills/clear-handoff and its handoff alias: link both into ~/.agents/skills/. There the handoff is saved and you start the fresh session yourself.
Add an instruction for the next session after the command. It goes into the handoff as its ## Directive, and the fresh session carries it out first:
/clear-handoff build it
/clear-handoff finish the CR loop on PR 42
You don't run /clear yourself. When the turn that saved the handoff ends, the plugin asks Clear and resume now or Wait. Enter on the first clears the session and sends Resume from <path> as the fresh session's first prompt. If it ever doesn't, run /clear (the handoff still loads) or paste the fallback line the command prints.
you type /clear-handoff ─▶ this turn may clear fresh session
Write .tmp/<name>.md ok ─▶ handoff = that path ─────────────
arm step writes sentinel clear-handoff-load.py injects
turn ends with an answer the handoff (as before)
handoff non-empty, sentinel new + names it
you pick "Clear and resume now" ─▶ /clear ─▶ plugin sends "Resume from <path>"
A function-hook module (hooks/register.ts) does the two keypresses. It decides from what it can observe, never from the model's text: your command, the Write tool's own result, and the files on disk at the moment of the clear. When any check fails it says so and leaves the /clear to you. Anything you do yourself wins over it:
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 strml/cc-clear-handoff --plugin cc-clear-handoffPlugins from other owners that cover similar ground