任意の自動コンパクションではなく、タスクフェーズを通じてコンテキストを保持するための論理的な間隔での手動コンパクションを提案します。
d8409a4任意の自動コンパクションに依存するのではなく、ワークフローの戦略的なポイントで手動の/compactを提案します。
自動コンパクションは任意のポイントでトリガーされます:
論理的な境界での戦略的コンパクション:
suggest-compact.jsスクリプトはPreToolUse(Edit/Write)で実行され:
プラグインとしてインストール済みの場合:設定は不要です。プラグインの hooks/hooks.json が既に suggest-compact.js を登録しています(フック ID pre:edit-write:suggest-compact、standard と strict フックプロファイルで有効)。下のブロックを ~/.claude/settings.json にコピーしないでください — プラグインインストールでは ~/.claude/scripts/ は存在せず、プラグインフックを重複させると二重実行になります。
手動インストール(./install.sh)の場合、~/.claude/settings.json に追加:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Edit",
"hooks": [{ "type": "command", "command": "node ~/.claude/scripts/hooks/suggest-compact.js" }]
},
{
"matcher": "Write",
"hooks": [{ "type": "command", "command": "node ~/.claude/scripts/hooks/suggest-compact.js" }]
}
]
}
}
環境変数:
COMPACT_THRESHOLD - 最初の提案前のツール呼び出し(デフォルト:50)Copy a source-pinned command for your client. You run it yourself.
Destination: .claude/skills/strategic-compact · pinned to the source commit
git clone https://github.com/affaan-m/ECC.git
cd ECC
git checkout d8409a4b0813771235555e32e3d8046a73988bfa
mkdir -p ".claude/skills/strategic-compact"
cp -r "docs/ja-JP/skills/strategic-compact" ".claude/skills/strategic-compact"Review the source before running. This copies files into your project; it is not a one-click install and does not verify runtime safety.
Scanner static-checks@0.1.0 · commit d8409a4b0813. Static checks cannot prove runtime safety – review the source and the exact diff before installing. How checks work.
No static rules matched. This is not a safety guarantee.