停止在原始工具輸出上浪費 context
何時使用: 你發現 agent 在 30 分鐘後「忘記」了,並花了大量費用反覆重讀。
前置條件
- Claude Code v1.0.33+ —
brew upgrade claude-code或npm update -g @anthropic-ai/claude-code
步驟
-
安裝/plugin marketplace add mksglu/context-mode
/plugin install context-mode@context-mode✓ 已複製→ Plugin 已註冊 hook 和 6 個沙箱工具 -
驗證/context-mode:ctx-doctor✓ 已複製→ 所有檢查通過 [x]
-
正常使用Now do a big task that would normally blow context — e.g. analyze all .log files under /var/log✓ 已複製→ 使用 ctx_execute 而非直接讀取;輸出被索引而非傾印
-
查看節省結果/context-mode:ctx-stats✓ 已複製→ 各工具的 context 縮減比率
結果: 相同的任務,壓縮前的持續時間延長 10 倍,且 agent 仍記得在做什麼。
注意事項
- 其他 MCP 繞過了路由 — 將其工具呼叫透過 ctx_batch_execute 執行,以保持一致的統計