✳ClaudeModsClaude Code mod ディレクトリ
☰
● 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]

元のソースを見る ↗

関連作品