Lunik/gmz-claude-marketplace/tree/master/context-cache
context-cache
コンテキストウィンドウの使用量とプロンプトキャッシュの状態(ヒット率とTTLカウントダウン)を下部グリッドに表示し、コンテキストが満杯に近いときやキャッシュが期限切れになったときにトーストを出すClaude Codeプラグインです。
この 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.
