Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.
在工作流程的策略點建議手動 /compact,而非依賴任意的自動壓縮。
自動壓縮在任意點觸發:
邏輯邊界的策略性壓縮:
suggest-compact.sh 腳本在 PreToolUse(Edit/Write)執行並:
新增到你的 ~/.claude/settings.json:
{
"hooks": {
"PreToolUse": [{
"matcher": "tool == \"Edit\" || tool == \"Write\"",
"hooks": [{
"type": "command",
"command": "~/.claude/skills/strategic-compact/suggest-compact.sh"
}]
}]
}
}
環境變數:
COMPACT_THRESHOLD - 第一次建議前的工具呼叫次數(預設:50)