All shelves / Mods / Usage
keepalive
By alexandernicholson
keepalive is a Claude Code usage mod by alexandernicholson.
Draws a prompt-cache bar for each conversation, and can keep an idle cache warm or compact it before it expires.
Draws
Install
The marketplace name is agent-router-tools.
/plugin marketplace add alexandernicholson/agent-router /plugin install keepalive@agent-router-tools
It runs inside the Claude Code process. The side panel is only what the author's README names. Read the repo before you install, or run claude plugin validate on the plugin folder.
- Version
- 0.4.9
- License
- MIT
- Repo stars
- 7
- Last change
- 2026-10-12
What it can reach
- Draws in the session
- Reads usage or context figures
- Reaches the network or an outside service
Needs Claude Code 2.1.289 or newer, and Node.js 22 or newer on PATH. The README asks for CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1. The official docs say 2.1.287 and later ignore that flag. The bar above the prompt follows the conversation in view: hit rate over the last 10 real requests, cache lifetime, time left, recent misses, and the last request's tokens read, written, and sent uncached. /keepalive opens a dashboard of the session, one dot per request, and every agent as a tree. Each conversation's TTL button switches that conversation between 5 minutes and 1 hour. The starting TTL defaults to Claude Code's own choice. Upkeep defaults to off, so nothing is sent until you change it. The mode button cycles off, warm, compact, and warmcomp. Warm sends one short request before the cache expires. Its text is Reply with only: K, so a direct provider is not told about the plugin. Compact, once the conversation is at least the threshold, compacts it while the cache is still warm. The threshold defaults to 100k tokens. A 1-hour cache write costs 2 times the input price instead of 1.25 times, and keepalives are billed. They pay off only if you come back. With the default limit, warming stops once the keepalives would cost more than writing the cache again. On a gateway other than api.anthropic.com, a policy request goes to that gateway's /v1/cache/policy, and the token goes to that same origin. A gateway that answers is also told, at /v1/cache/reports, the kind, model, lifetime source, and token counts of each keepalive and compaction. Direct providers are never sent that report. Prices come from your price-feed URL or the gateway's /v1/cache/prices, then Anthropic's table for Claude, then a daily download of the models.dev catalog. Set CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC and the catalog is not downloaded. Once a day it also checks the marketplace on GitHub for a newer version, unless that same variable is set, or you loaded the plugin from a checkout. Records stay under ~/.claude/plugins/data/keepalive-agent-router-tools/. The README does not say how to delete them. Change the starting TTL, upkeep, limits, threshold, and reduced motion in /keepalive-settings. Reduced motion defaults to off.
The install name is keepalive. This page adds the author's name. cache-warmer resends the last request when that saves at least $0.05, and draws a band while it runs. This one draws a cache bar for every conversation and, when you turn upkeep on, sends a keepalive or compacts before the cache expires. The cache bar is why this page files it under usage. Upkeep is off unless you change it. The keepalive request is a model call on your own Claude login, so this page does not list it as network access. The catalog download, the GitHub version check, and a gateway's policy, price, and report calls are the network access.
Demo

What it hooks into
classic.SessionStartA Claude Code eventclassic.SubagentStartA Claude Code eventclassic.PostToolUseA Claude Code eventclassic.StopA Claude Code eventclassic.SubagentStopA Claude Code eventsession.startWhen a session startsturn.stepAt each step of a turnui.renderDraws into the sessionAbovePromptPanesession.compactWhen the context is compactedsession.endWhen a session endscommand.runWhen you run its slash commandui.closeWhen its pane closes
Read from the on() calls in its hook modules. Open its source under Files to check what each one does.
Files
The author's README and source, 4 files. They load when you open them.
Facts
- Author
- alexandernicholson
- Category
- Usage
- Marketplace
- agent-router-tools
- Folder
- keepalive
- Version
- 0.4.9
- License
- MIT
- Repo stars
- 7
- Last change
- 2026-10-12
- Language
- JavaScript
- Files
- 56
