✳ClaudeModsClaude Code mod ディレクトリ
☰
● 0 人がオンライン ・閲覧 0 回
+ 作品を投稿
← 作品一覧へ
Reddit の投稿 · 使用量・コスト / メモリ・コンテキスト / ツール・連携 / ワークフロー・CI

handoff-compact:自動圧縮時に自動で引き継ぎとクリーンアップを実行

autocompact がトリガーされたときに自動で引き継ぎドキュメントを生成しコンテキストを置き換える Claude Code mod。handoff + /clear プロセスを自動化するのと同等。

sspeciallight@speciallight
翻訳済み

この mod について

著者は多数の長時間無人 Claude Code セッションを実行しており、コンテキストが 20 万を超えた後のターンに半分の token が費やされていることに気づいた。これは高コストであるだけでなく、コンテキスト腐敗により品質が低下する。手動の方法は引き継ぎを要求し、/clear し、再度フィードバックすることだが、200k autocompact を有効にすると引き継ぎ内容が制御不能になる。handoff-compact は autocompact がトリガーされたときに介入し、セッションブランチ(完全なコンテキスト)が引き継ぎドキュメントを書き出す。これには目標、状態と証拠、次のステップ、決定と理由、除外されたオプション、未解決の問題、ファイルとコミット、検証コマンド、直近 10 件の prompt 原文が含まれ、そのドキュメントで会話内容を置き換える。これにより同一セッション内、ターン途中、無人での handoff + /clear を実現する。このプロジェクトは vibe-coded で、MIT ライセンス、Claude Code 2.1.287+ と mods の有効化が必要。"/compact classic" で一時的に組み込みの要約を使用できる。

インストール

まず作者の 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]

元のソースを見る ↗

関連作品