✳ClaudeModsClaude Code 模組目錄
☰
● 0 人在線上 · 瀏覽 0 次
+ 提交作品
← 返回作品集
Reddit 貼文 · 用量與成本 / 記憶與上下文 / 工具與整合 / 工作流程與 CI

handoff-compact:自動完成交接與 /clear 的 Claude Code 模組

一個在 autocompact 觸發時自動生成交接文件並替換上下文的模組,省去手動 handoff + /clear 流程。

sspeciallight@speciallight
已翻譯

關於這個 mod

handoff-compact 是一個在 Claude Code autocompact 觸發時接管的模組,用於解決長時間無人值守會話中上下文超過 200k 導致的高成本與品質下降問題。它不呼叫內建摘要器,而是分叉整個會話上下文,生成一份交接文件,涵蓋目標、狀態及其證據、下一步、決策及原因、已排除方案、待解決問題、相關檔案與提交、驗證命令以及最近 10 條提示原樣,然後用該文件替換原對話。效果等同於 handoff + /clear,但在同一會話中、回合中途、無人值守時自動完成。作者稱其為 vibe-coded,鼓勵使用者拿走思路或模組並按自己環境客製化。需要 Claude Code 2.1.287+ 並啟用 mods。使用 /compact classic 可單次獲得內建摘要。倉庫為 MIT 許可。

安裝

請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。

/plugin marketplace add trytofly94/handoff-compact
/plugin install handoff-compact@handoff-compact
原文 / 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]

查看原始來源 ↗

更多類似作品