為什麼需要策略性壓縮?
自動壓縮在任意點觸發: - 經常在任務中途,丟失重要上下文 - 不知道邏輯任務邊界 - 可能中斷複雜的多步驟操作
affaan-m/ECC
Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.
npx skills add https://github.com/affaan-m/ECC --skill "docs/zh-TW/skills/strategic-compact"Source checked Jul 28, 2026·Refresh due Oct 26, 2026
Limited to facts supported by the pinned source
在工作流程的策略點建議手動 /compact,而非依賴任意的自動壓縮。
npx skills add https://github.com/affaan-m/ECC --skill "docs/zh-TW/skills/strategic-compact"The pinned source contains about 80 English words and 6 usable sections. That evidence supports a source profile, not a complete guide.
80 source words · 6 usable sections
What the source actually contains
Sections are extracted automatically from the pinned SKILL.md and link back to the source.
自動壓縮在任意點觸發: - 經常在任務中途,丟失重要上下文 - 不知道邏輯任務邊界 - 可能中斷複雜的多步驟操作
suggest-compact.js 腳本在 PreToolUse(Edit/Write)執行並:
以外掛安裝? 無需任何設定。外掛的 hooks/hooks.json 已經註冊了 suggest-compact.js(Hook ID pre:edit-write:suggest-compact,在 standard 與 strict hook 設定檔中生效)。請勿將下方區塊複製到 /.claude/settings.json — 外掛安裝中不存在 /.claude/scripts/,且重複註冊外掛 hook 會導致重複執行。
Choose a different workflow
Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.
A separate implementation from affaan-m/ECC; compare its source, maintenance signals, and permission requirements.
Open source detailSuggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.
A separate implementation from affaan-m/ECC; compare its source, maintenance signals, and permission requirements.
Open source detailSuggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.
A separate implementation from affaan-m/ECC; compare its source, maintenance signals, and permission requirements.
Open source detailFAQ
The source record exposes this install command: npx skills add https://github.com/affaan-m/ECC --skill "docs/zh-TW/skills/strategic-compact". Inspect the command and pinned source before running it.
Quality breakdown
Based on traceable docs and repository signals; stars are not treated as quality.
Compare before choosing
These links are selected from shared tasks, functions, stacks, platforms, and same-name variants. Compare the source owner, documentation, permissions, and maintenance signals.
Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.
Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.
Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.
Review strategic-compact's use cases, installation, workflow, and original source instructions.
Review strategic-compact's use cases, installation, workflow, and original source instructions.
在工作流程的策略點建議手動 /compact,而非依賴任意的自動壓縮。
自動壓縮在任意點觸發:
邏輯邊界的策略性壓縮:
suggest-compact.js 腳本在 PreToolUse(Edit/Write)執行並:
以外掛安裝? 無需任何設定。外掛的 hooks/hooks.json 已經註冊了 suggest-compact.js(Hook ID pre:edit-write:suggest-compact,在 standard 與 strict hook 設定檔中生效)。請勿將下方區塊複製到 ~/.claude/settings.json — 外掛安裝中不存在 ~/.claude/scripts/,且重複註冊外掛 hook 會導致重複執行。
如果是手動安裝(./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)