✳ClaudeModsClaude Code mod directory
☰
● 0 online · Views 0 times
+ Submit a project
← Back to projects
Reddit posts · Usage & costs / Memory & context / Tools & integrations / Workflows & CI

handoff-compact: A Claude Code Mod for Automatic Handoff and /clear

A mod that automatically generates a handoff document and replaces context when autocompact triggers, eliminating manual handoff + /clear workflows.

sspeciallight@speciallight
Translated

About this mod

handoff-compact is a mod that takes over when Claude Code autocompact triggers, solving the high cost and quality degradation issues caused by context exceeding 200k in long unattended sessions. Instead of calling the built-in summarizer, it forks the entire session context, generates a handoff document covering goals, status and its evidence, next steps, decisions and reasons, ruled-out options, open questions, related files and commits, verification commands, and the last 10 prompts verbatim, then replaces the original conversation with that document. The effect is equivalent to handoff + /clear, but done automatically within the same session, mid-turn, and unattended. The author calls it vibe-coded and encourages users to take the idea or mod and customize it for their own environment. Requires Claude Code 2.1.287+ with mods enabled. Use /compact classic for a one-time built-in summary. The repository is MIT licensed.

Installation

Check the author's README for the marketplace and plugin name first. Commands may change as the repository evolves.

/plugin marketplace add trytofly94/handoff-compact
/plugin install handoff-compact@handoff-compact
Original text / README

I run a lot of long unattended Claude Code sessions. When I measured them, half of my tokens came from turns where the context was already past 200k. That's expensive, since every step resends the whole context, and quality degrades because of context rot. By hand the fix is the usual routine: ask for a handoff, /clear, feed it back. Enabling autocompact at 200k keeps the context short but leaves little control over what is handed over. I already tried to have Claude Code write handoff documents pre autocompact window with hooks, but with modding the solution gets a LOT better. Handoff-compact answers the autocompact trigger instead of the built-in summarizer. A fork of the session (whole context) writes a handoff-document (goal, state and what proves it, next step, decisions and why, ruled-out approaches, open questions, files and commits, the verify command, the last 10 prompts verbatim), and the conversation is replaced by it. Handoff + /clear, but in the same session, mid-turn, with nobody at the keyboard. Obviously vibe-coded. Take the idea or the mod itself and customize it with your own setup. Modding is awesome. Install: /plugin marketplace add trytofly94/handoff-compact /plugin install handoff-compact@handoff-compact Repo: https://github.com/trytofly94/handoff-compact (MIT). Needs Claude Code 2.1.287+ with mods enabled. "/compact classic" gives you the built-in summary once. submitted by /u/speciallight [link] [comments]

View original source ↗

Similar projects