cache-guard
Reviewed
at commit c901585
Keeps the prompt cache warm while idle and holds the first prompt after the cache went cold, with its cost.
0 upvotes
Log in to upvote or save- Made by
- escapeboy
- Pinned commit
-
c901585b71d685112047e38bc069a9d0c537307f - What we checked
-
While a session with a large context sits idle, sends a tiny keep-alive request on your own Claude Code account (at most 4 times) so the prompt cache stays warm. If the cache went cold anyway, it holds your next prompt once and tells you the cost; sending it again within 3 minutes goes through. Adds /keepwarm on|off|status. It reads no files and runs no programs.
Review details
Static review of the source at the pinned commit; not run. Registers session.start (registers /keepwarm and starts a 60-second $.clock.every tick), turn.start, turn.step and turn.complete (track whether a turn is running and when the last request happened; passed through with next), prompt.submit (checks only turn and origin metadata and the idle time; drops the prompt with a message when idle exceeds 60 minutes and context is at least 150K tokens and no confirmation is pending; plugin-origin prompts are passed through, and a catch handler passes the event on), and command.run for keepwarm. Uses $.session.usage for the context size, $.model.fork for the keep-alive ping ('Reply with the single word: ok', uses tokens), $.ui.status and $.ui.toast. Turns itself off for the session if the ping shows the cache was already lapsed. No fs, process, env, network or storage use. The warning text is in Bulgarian. The timer started in session.start is not cancelled on a repeated session.start, a minor issue. No npm dependencies.
- What it uses
-
- Reads your prompts: yes
- Sees tool calls: no
- Blocks or changes tool calls: no
- Reads or writes files: no
- Runs programs on your machine: no
- Calls the model (uses tokens): yes
- Sends data over the network: no
- Stores data: no
- Shows something on screen: yes
Made this mod? Add a badge to your README
Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.
[](https://modsforclaude.com/mods/cache-guard/)