← ClaudeAtlas

cachebeatlisted

Keep the Anthropic prompt cache warm by firing a tiny heartbeat only after N minutes of true session inactivity (any exchange resets the clock), so the next real turn reads the conversation at cached price / cached quota instead of a full uncached re-read. Runs the bundled beat.sh as a silent background shell task that exits when the session has been idle N minutes; you re-arm it on each beat. Use when the session may sit idle (training runs, CI, downloads, the user stepping away) longer than the cache TTL. Args - idle threshold in minutes (default 50), optional max hours (default 8), or "stop".
ARahim3/cachebeat · ★ 56 · AI & Automation · score 74
Install: claude install-skill ARahim3/cachebeat
# cachebeat — prompt-cache keepalive heartbeat ## What you do when invoked Parse the arguments: `/cachebeat [minutes] [max_hours]` or `/cachebeat stop`. - `minutes`: idle threshold — how long the session may sit silent before a beat. Default **50**. Clamp to **5–55** — above ~55 the 1-hour cache TTL expires between beats and the heartbeat is pointless. - `max_hours`: auto-stop deadline. Default **8**. Clamp to 1–24. This is the abandoned-session guard: every beat costs a small cached-price request, so a forgotten heartbeat must kill itself. - `stop`: stop the running cachebeat task with TaskStop. Its description is `cachebeat keepalive`; if its task ID is no longer in your context, list running background tasks (TaskList or equivalent) to find it. Confirm in one short line. Do nothing else. ## Arming (background Bash running beat.sh, NOT Monitor) The heartbeat is an **inactivity timer, not a metronome**: it fires only when the session has been quiet for N minutes. Any real turn — a user message, one of your replies, a background event you answered — resets the clock, because it already refreshed the cache. **Why a background Bash task and not Monitor:** Claude Code kills every Monitor after at most 30 minutes, and each expiry wakes you — so a Monitor can never stay silent for 50. A Bash command started with `run_in_background: true` has no such cap: it runs silently for as long as it likes and wakes you **once, when it exits**. So the watcher exits on the beat