ildunari/kosta-plugins/tree/main/plugins/cache-timer
cache-timer
メイン会話のプロンプトキャッシュウィンドウを追跡する Claude Code の mod(function-hook プラグイン)です。
この mod について
cache-timer
メイン会話のプロンプトキャッシュウィンドウを追跡する Claude Code の mod(function-hook プラグイン)です。
- **ステータス行:**モデル名の横に
🟢 ▰▰▰▰▰▰▰▰▱▱ 47:12を表示します。ウィンドウの半分を超えると 🟢、15% まで下がると 🟡、それ未満では 🔴、期限切れになると ⚪coldになります。ウィンドウはメインスレッドのリクエストが送信された時点から再開し、モデルが応答すると終了します(中断された応答も含みます)。サブエージェントとコンパクションのリクエストは独自のキャッシュプレフィックスを使うため無視されます。 - **警告:**残り 12 分になると、何か送信しなければ 2 分後に自動コンパクトが行われるというトーストを表示します。コンテキストが小さすぎてコンパクトできない場合や、スリープ後に時計がすでに 10 分の位置を過ぎていた場合は省略されます。
- **自動コンパクトは 1 回だけ:**残り 10 分でキャッシュがまだ有効なら、
/compactと同じコンパクションを実行します。各キャッシュ世代(リクエスト時刻で名前付け)には 1 回だけ実行権があり、呼び出し前に消費されます。スキップやターン途中の拒否でも消費され、新しいリクエストがモデルに到達したときだけ新しい世代が新しい実行権で始まります。40k トークン未満のコンテキストはスキップし、準備中にリクエストがキャッシュを再加熱した場合はコンパクションをオフにします。📦 は実際にコンパクションが行われた世代を示します。
ここではウィンドウの TTL が 1 時間(TTL_MS)だと仮定しています。5 分 TTL のセッション(使用量超過、一部の API key 設定)ではカウントダウンが正しくありません。しきい値は hooks/register.tsx の先頭にある定数です。
インストール:claude plugin install cache-timer@kosta-plugins。確認:claude plugin validate plugins/cache-timer。
インストール
まず作者の README で marketplace とプラグイン名を確認してください。コマンドはリポジトリの構成によって変わる場合があります。
claude plugin marketplace add ildunari/kosta-plugins claude plugin install cache-timer
原文 / README
cache-timer
A Claude Code mod (function-hook plugin) that tracks the prompt-cache window of the main conversation.
- Status line:
🟢 ▰▰▰▰▰▰▰▰▱▱ 47:12beside the model name. The dot goes 🟢 above half the window, 🟡 down to 15%, 🔴 below, ⚪coldonce it has expired. The window restarts from when a main-thread request is sent, once the model has answered it (an interrupted answer counts); subagent and compaction requests run on their own cache prefix and are ignored. - Warning: at 12 minutes left, a toast says an auto-compact is coming in 2 minutes unless you send something. It's skipped when the context is too small to compact, or when the clock has already jumped past the 10-minute mark (after a sleep).
- Auto-compact, once: at 10 minutes left, while the cache is still warm, it runs the same compaction as
/compact. Each cache generation (named by its request time) gets one shot: it's spent before the call, a skip or a mid-turn refusal leaves it spent, and only a new request that reaches the model starts a generation with a fresh shot. It skips contexts under 40k tokens and calls the compaction off if a request re-warmed the cache while it was getting ready. 📦 marks a generation where a compaction actually stood.
The window is assumed to be the 1-hour TTL (TTL_MS). Sessions on the 5-minute TTL (usage overage, some API-key setups) will see the wrong countdown. The thresholds are constants at the top of hooks/register.tsx.
Install: claude plugin install cache-timer@kosta-plugins. Check: claude plugin validate plugins/cache-timer.
同名の他の作品
- cache-timerarthur-fontaine · ★ 1
- cache-timermtmtian · ★ 0
- cache-timergrennis · ★ 0
- cache-timerbajzaa975 · ★ 0
