Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -11% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 1% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -4% | 0% |
| case-07 | ✗→✓ | ▲ Improved | -55% | 0% |
| case-08 | ✗→✓ | ▲ Improved | -46% | 0% |
在工作流程的策略點建議手動 /compact,而非依賴任意的自動壓縮。
自動壓縮在任意點觸發:
邏輯邊界的策略性壓縮:
suggest-compact.sh 腳本在 PreToolUse(Edit/Write)執行並:
新增到你的 ~/.claude/settings.json:
json{ "hooks": { "PreToolUse": [{ "matcher": "tool == \"Edit\" || tool == \"Write\"", "hooks": [{ "type": "command", "command": "~/.claude/skills/strategic-compact/suggest-compact.sh" }] }] } }
環境變數:
COMPACT_THRESHOLD - 第一次建議前的工具呼叫次數(預設:50)Other measured skills in the registry, with their headline benchmark lift.