ClaudeMods
☰
ZH-TW
● — 人在線上 · 瀏覽 — 次
贊助提交作品
GitHub 儲存庫 · 發布者 maseungsidea

cache-keep

A Claude Code mod that tells you when your prompt cache silently dropped to a 5-minute TTL, measured from the session transcript, with zero model calls and no settings edits.

尚未翻譯

關於這個 mod

cache-keep is a Claude Code plugin that makes prompt-cache behavior visible without any model calls or settings edits. It reads the cache TTL from the session transcript, and infers it where the transcript can't be read. Its status line shows cache warmth (e.g. "🔥 cache warm ▰▰▰▰▱ 47m · 312k · hit 94% · 1 miss" or "🧊 cache cold · next message rewrites 312k"), where one bar cell is a fifth of the TTL (12 minutes at 1 hour); under a measured 5-minute TTL the countdown runs from 5 and the line ends "· 5m TTL". The /cache-keep command prints an immediate session report covering time left, context size, hit rate, misses and the tokens they rewrote, and the cache TTL, measured or inferred, answering even mid-turn. The alarm is one toast per session. Measured: after each main turn, cache-keep reads the newest cache write in the transcript (cache_creation.ephemeral_5m/1h_input_tokens); a 5-minute write raises the alarm and suggests checking promptCacheTtl: "1h", and while writes stay 1-hour it stays quiet. Inferred: until the TTL is measured, or where the transcript can't be read, a large context rewritten whole after a 5–55 minute gap, twice within a rolling hour, raises "5-minute TTL suspected". It counts only the main thread, skipping subagent writes, treats a miss as a request that rewrote at least half of a 50k+ context, and ignores the first request of a session plus those right after compaction or a model switch. Install via /plugin install cache-keep --marketplace maseungsidea/cache-keep or the shell equivalent; a language option (en/ko) sets the language of the status line, report and alarm. Note that API-key, cloud or extra-usage sessions run on a 5-minute TTL by design, where the alarm only confirms that choice, and where an organization manages Claude Code the Stop hook isn't delivered, so the TTL is inferred only. MIT licensed.

安裝

請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。

claude plugin marketplace add maseungsidea/cache-keep
claude plugin install cache-keep@cache-keep
原文 / README

cache-keep is a Claude Code plugin that makes prompt-cache behavior visible without any model calls or settings edits. It reads the cache TTL from the session transcript, and infers it where the transcript can't be read. Its status line shows cache warmth (e.g. "🔥 cache warm ▰▰▰▰▱ 47m · 312k · hit 94% · 1 miss" or "🧊 cache cold · next message rewrites 312k"), where one bar cell is a fifth of the TTL (12 minutes at 1 hour); under a measured 5-minute TTL the countdown runs from 5 and the line ends "· 5m TTL". The /cache-keep command prints an immediate session report covering time left, context size, hit rate, misses and the tokens they rewrote, and the cache TTL, measured or inferred, answering even mid-turn. The alarm is one toast per session. Measured: after each main turn, cache-keep reads the newest cache write in the transcript (cache_creation.ephemeral_5m/1h_input_tokens); a 5-minute write raises the alarm and suggests checking promptCacheTtl: "1h", and while writes stay 1-hour it stays quiet. Inferred: until the TTL is measured, or where the transcript can't be read, a large context rewritten whole after a 5–55 minute gap, twice within a rolling hour, raises "5-minute TTL suspected". It counts only the main thread, skipping subagent writes, treats a miss as a request that rewrote at least half of a 50k+ context, and ignores the first request of a session plus those right after compaction or a model switch. Install via /plugin install cache-keep --marketplace maseungsidea/cache-keep or the shell equivalent; a language option (en/ko) sets the language of the status line, report and alarm. Note that API-key, cloud or extra-usage sessions run on a 5-minute TTL by design, where the alarm only confirms that choice, and where an organization manages Claude Code the Stop hook isn't delivered, so the TTL is inferred only. MIT licensed.

更多類似作品