Lunik/gmz-claude-marketplace/tree/master/context-cache
context-cache
一個 Claude Code 外掛,在底部網格加入一列,顯示上下文視窗填充量和提示快取狀態(命中率及 TTL 倒數);上下文接近滿載或快取到期時會顯示提示訊息。
關於這個 mod
context-cache 會顯示上下文視窗有多滿,以及提示快取的狀態。
Context ┃ Window 17% ┃ Cache hit 99% ┃ Cache TTL 4m33s
儲存格:
- Window:上下文填充量。低於 70% 為綠色,從 70% 起為橘色,從 85% 起為紅色。
- Cache hit:上一個提示由快取提供的比例。低於 20% 為紅色。
- Cache TTL:快取到期倒數,來自 API 回報的 TTL(5 分鐘或 1 小時)。耗盡後顯示
expired。
只有上下文至少包含 20k 個權杖時,才會顯示 Cache hit 和 Cache TTL。
上下文跨過 70%、85% 或 95%、發生快取未命中、到期前 60 秒,以及到期時,都會觸發提示訊息。
行為:右下角網格中的一列每秒重新整理;只計算主要對話,因為子代理程式有自己的快取項目。
安裝
請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。
claude plugin marketplace add Lunik/gmz-claude-marketplace claude plugin install context-cache
原文 / README
context-cache
Shows how full the context window is and how the prompt cache is doing.
Context ┃ Window 17% ┃ Cache hit 99% ┃ Cache TTL 4m33s
Cells
| Cell | Meaning |
|---|---|
| Window | Context fill. Green below 70%, orange from 70%, red from 85%. |
| Cache hit | Share of the last prompt served from cache. Red below 20%. |
| Cache TTL | Countdown to cache expiry, from the TTL the API reports for the entry it just wrote (5 minutes or 1 hour). expired once it ran out. |
Cache hit and Cache TTL only show once the context holds at least 20k tokens, below that a cold cache costs little. Until then, and before the first response, they read -.
Toasts
- Context crosses 70%, 85% or 95%: consider
/compact. - Cache miss: a response re-wrote 20k+ tokens at full price with a hit rate under 20%.
- Cache expires in 60 seconds: send a prompt to keep it.
- Cache expired: the next prompt re-reads the context uncached.
Behavior
- Row in the bottom-right grid, refreshed every second.
- Only the main conversation counts; a subagent has its own cache entry.
