About this mod
The author runs many long, unattended Claude Code sessions and found that half the tokens are spent on turns after the context has exceeded 200k, which is both expensive and degrades quality due to context rot. The manual approach is to request a handoff, /clear, then feed it back, but with 200k autocompact enabled the handoff content is uncontrollable. handoff-compact intervenes when autocompact triggers: the session branch (full context) writes out a handoff document containing goals, status and evidence, next steps, decisions and rationale, excluded options, open questions, files and commits, verification commands, and the raw text of the last 10 prompts, then uses that document to replace the conversation content, achieving handoff + /clear within the same session, mid-turn, unattended. The project is vibe-coded, MIT licensed, requires Claude Code 2.1.287+ and mods enabled; "/compact classic" can temporarily use the built-in summary.


