cache-keepalive
Keeps a session cache warm only while background tasks run.
Source and capability notes checked · By RichardJSun · Updated Oct 14, 2026
What cache-keepalive looks like in use
No recording yet for cache-keepalive. The repository README has the details.
Before you install
A mod is not sandboxed. It runs inside Claude Code with your permissions. This one:
- can read Context size
- can read cache usage
- can read task state and rate limits
- can spend Your usage allowance
Check it yourself before running it: git clone https://github.com/RichardJSun/claude-code-mods && claude plugin validate ./ · MIT licensed
Install
claude plugin marketplace add RichardJSun/claude-code-mods
claude plugin install cache-keepalive@richardjsun-mods
Then run /keepalive inside the session.
Needs Claude Code 2.1.287 or later. After installing, run
/reload-plugins if the session was already open.
Full install guide
What changes after installation
When a turn ends with background work still running, the mod arms a timer and periodically pings the cache. The goal is for the task’s completion notice to return to a warm conversation rather than rewriting the full context.
/keepalive triggers a ping manually and reports cache readback and budget use. A status line indicates whether the mod is armed, warm or stopped.
Good to know
The timing assumes a one-hour cache. On a five-minute cache the first delayed ping can arrive cold, after which the mod stops. Optional compaction at the budget cap is off by default because it trades detailed context for a smaller summary.
Similar mods
context-inspector
Finds repeated reads, similar outputs and compaction-related waste.
cache-tax
Keeps the prompt cache warm during breaks and stops a cold send once — with its price.
cache-keeper
Combines cache timing, cold-send warnings, chat board and handoff.
agent-usage-guard
Holds a burst of subagents, a huge prompt or a retry loop before it eats your plan window.
Popular mods
agent-profiler
Breaks a session into model wait, tool and subagent time.
Agent Time Machine
Records tool calls and project snapshots on a branching timeline.
loop-detective
Collects evidence when the same Bash failure keeps repeating.
pin-memo
Keeps personal notes and todos above the prompt across resumes.