cachebeat skill
A Claude Code skill that keeps the prompt cache warm during idle time so your next message is read from cache.
- 88 ★ on the repository
- Last commit
- MIT
Minimal access
Why this level
- A hook periodically wakes the session and sends the model a request that spends tokens
- Runs as the background script `beat.sh` in your session
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add skills/cachebeatDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewMinimal accessThe tool runs nothing and makes no network calls.
- A hook periodically wakes the session and sends the model a request that spends tokens
- Runs as the background script `beat.sh` in your session
This is third-party code. Review the repository files before installing.
What it does
cachebeat starts a silent background idle timer inside a Claude Code session. When the session has been silent for a set number of minutes, Claude wakes, replies with a single dot and the prompt cache lifetime starts over. The next message then reads history from the cache instead of reprocessing it from scratch. The author explains that a cache read costs about 0.1 of the normal input price, so a cold return costs roughly ten times more. The timer fires only after complete silence, and any message or reply resets the count. `/cachebeat` sets 50 minutes of idle time and a stop after 8 hours, `/cachebeat 40 4` sets a threshold and deadline and `/cachebeat stop` turns it off. Inside is a Stop hook with `asyncRewake`, declared in the skill itself.
Who it is for. Claude Code users with long tasks such as model training or builds who often leave a session idle.
Good fit when
- A multi-hour training run leaves the session idle between checks.
- Returning to an old session eats a visible part of a subscription limit because of a cold cache.
- Context is large and costly, and reprocessing it from scratch is billed again.
- The idle threshold must match the cache lifetime of your session, for example `/cachebeat 40`.
Not a fit when
- The session is short or active: the cache stays warm anyway.
- The organization disabled hooks (`disableAllHooks` or `allowManagedHooksOnly`): the skill does not work without hooks.
- The session cache lifetime is shorter than any threshold: the beat fires on time but the cache has already expired.
Example request
Turn on cachebeat for 40 minutes and 4 hours while the model trains and tell me when it stops.Limitations
Needs a recent Claude Code, the author tested on version 2.1.288, with hooks enabled. The idle threshold is clamped to 5 to 55 minutes, default 50, with self-stop after 8 hours by default. Each beat is a separate model request that also spends tokens, so the benefit appears when you do return to the session. If Claude says cachebeat stopped itself, the session cache lifetime is too short for any beat. After upgrading, copy the files again and run `/cachebeat` in each session.
How to disable. Run `/cachebeat stop` in the session, and to remove the skill delete the `~/.claude/skills/cachebeat` folder.
FAQ
How do I install it?
Copy two files, `SKILL.md` and `beat.sh`, into `~/.claude/skills/cachebeat/` or the project's `.claude/skills/cachebeat/`. Then type `/cachebeat` in the session.
How do I check the cache is warm?
In the Claude Code status line watch the second number in `tok:312.0k/0.0k`, the share read from cache. If it shows `0.0k` after idling, the cache went cold.
How do I change the threshold?
With arguments: `/cachebeat 40` sets 40 minutes of idle time and `/cachebeat 40 4` also stops after 4 hours. The threshold is clamped between 5 and 55 minutes.
What does the timer actually do?
After the set silence Claude replies with a dot and the cache lifetime starts again. Any other message resets the timer, so it is an inactivity timer and not a metronome.
What to do after the skill is updated?
Copy both files again and run `/cachebeat` in each session you want covered. A session with old instructions stops at its next re-arm.
Discussion
No questions or reviews yet.
Related
SkillsA Claude Code mod that warms the prompt cache during breaks and shows the rewrite cost before a message goes into a cold session
A Claude Code plugin that picks the model's effort level for every prompt and shows the prompt cache countdown
A Claude Code status line with 5-hour and weekly limit usage, reset countdowns, model and prompt cache lifetime
A Claude Code plugin draws a band above the prompt with remaining 7-day and 5-hour limits and the prompt cache state
The claude-crusts CLI splits a Claude Code context into six categories, finds waste and writes a /compact command for the session.
claudetop shows session cost, cache hit rate, plan limit windows and overspend alerts in the Claude Code status line
README in short
Covers the cold-cache problem, how the timer works, two-file installation, usage, verification and hook limits.