Keep Claude Code's prompt cache warm while you're away.


When a Claude Code session sits idle, its prompt cache goes cold, and your next message has to rebuild it from scratch. That's slower, and it uses more of your usage limits. cachebeat gives the session a heartbeat: shortly before the cache would go cold, it sends a tiny background request that reads the conversation and keeps the cache alive. Your transcript never sees it.
You come back from lunch, type your next message, and it picks up right where you left off.
| Command | What it does |
|---|
/cachebeat on | Keeps this session's cache warm, with no time limit |
/cachebeat 2h | Keeps it warm for a set time, then turns off |
[!IMPORTANT]
Changed in 0.10.0: /cachebeat on works as before. /cachebeat <time> now sets how long to keep the cache warm, and needs a unit: /cachebeat 2h keeps it warm for two hours, then turns this session off. It used to set the beat interval in minutes (/cachebeat 30). A bare number now changes nothing and says so. The interval is a setting: Beat after idle in /cachebeat settings, or /cachebeat global <minutes>.
Features
- Background beats keep the cache warm while you're idle or a turn sits waiting, timed to how long your cache lasts, and stay out of the conversation.
/cachebeat on starts them
- A keep-alive time:
/cachebeat 2h keeps the cache warm through a break of that long, then turns itself off
- A cold guard asks before your message goes to a cache that's gone cold, with how many tokens sending it would cache again. It's on from the start, even with beating off
- A live heart under the prompt, with 19 animations to choose from
- A turn line under your latest turn shows the beats so far and the time until the next one
- A Status page and a Stats page: the cache as it stands, and what beats cost and saved over the last 30 days
- A settings menu with live previews, driven by keyboard or mouse
- Ask Claude to turn it on, keep the cache warm for a while, or change any setting, in your own words, or ask it how full its context is and when it will compact
- Safety stops for long idle stretches, usage limits, errors, and chats too small to bother with
- This session, this folder or all folders: turn it on for one session, or have new sessions start with it in one folder or everywhere
Requirements
- Claude Code 2.1.332 or later. Check your version with
claude --version and update with claude update.
- Claude Code in the terminal, which cachebeat is built for. In the Claude desktop app, beating works the same: the turn line sits above the prompt, and the settings menu opens beside the chat. The wider heart animations and the menu's keyboard controls are rougher there, so you can just ask Claude to change settings for you. Nothing is drawn in
claude -p.
Install
In your terminal:
claude plugin marketplace add 404Mayank/cachebeat
claude plugin install cachebeat@cachebeat
Or from inside Claude Code:
/plugin marketplace add 404Mayank/cachebeat
/plugin install cachebeat@cachebeat
/reload-plugins
If /cachebeat isn't there afterwards, restart Claude Code.
Update:
claude plugin marketplace update cachebeat
claude plugin update cachebeat@cachebeat
Then restart Claude Code. To get new versions automatically, turn on auto-update under /plugin → Marketplaces → cachebeat.
Uninstall:
claude plugin uninstall cachebeat@cachebeat
claude plugin marketplace remove cachebeat
Quick start
In any session:
/cachebeat on
The prompt heart appears under the prompt, and starts beating once the session has had a turn. To have every new session start with it on:
/cachebeat global on
Or only the sessions in this folder, such as one repo:
/cachebeat local on
To keep the cache warm for a set time, such as through a long meeting, and have it turn itself off after:
/cachebeat 2h
Or ask Claude: "keep the cache warm in this session", "keep it warm for the next 2 hours", "always start it in this repo", "make 30 minutes the default beat time".
To have Claude watch its own context, add a line to your CLAUDE.md, such as: "Before a long task, read your context with mcp__cachebeat__state (only: ["context"])."