ClaudeCodeMod

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.

In Claude Code
/plugin marketplace add alexandernicholson/agent-router
/plugin install keepalive@agent-router-tools
Open the repo

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

The keepalive README on the author's GitHub page
Screenshot of the author's GitHub page.

What it hooks into

  • classic.SessionStartA Claude Code event
  • classic.SubagentStartA Claude Code event
  • classic.PostToolUseA Claude Code event
  • classic.StopA Claude Code event
  • classic.SubagentStopA Claude Code event
  • session.startWhen a session starts
  • turn.stepAt each step of a turn
  • ui.renderDraws into the sessionAbovePromptPane
  • session.compactWhen the context is compacted
  • session.endWhen a session ends
  • command.runWhen you run its slash command
  • ui.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
Repo
alexandernicholson/agent-router
Folder
keepalive
Version
0.4.9
License
MIT
Repo stars
7
Last change
2026-10-12
Language
JavaScript
Files
56

Other mods in Usage

hudhoobnnDraws model, context, and plan-usage gauges above the prompt, with git, the running tools, and a one-line task summary.limits-meterice-lfernandesDraws plan limits and context above the prompt, in tokens and percent, with the model, effort, and a toast on a costly switch.elizabeth-progressYaxin9LuoDraws Elizabeth from Gintama walking a context-window bar above the prompt, with the usage split, turns left, and rate limits.spending-effort-with-jevYaxin9LuoAsks TypeSafe's Jev which /effort level a message needs, sends that message to api.typesafe.ai, and switches on your OK.cache-paneldanyuchnAfter 50 idle minutes, draws a prompt-cache line and a panel to keep it warm, ping it once, or compact, with a cost for each.context-cardNongfsqDraws context fill, the prompt cache, and weekly plan usage in one line above the prompt, with a breakdown on click. One of two mods for running many sessions.statuslineryanclarkDraws context, the 5-hour and 7-day limits, and extra usage under the prompt, from statusline, a status-line binary you install first.usage-headerSzotaszDraws the context window above the prompt, a color per category, with the 5-hour and weekly limits under it.green-lanternvogiaan1904Draws the 5-hour and 7-day limits as Green Lantern charge that drains as you use it, with a power-ring spinner and an emerald theme.long-live-the-claudeLapis0x0Draws the 5-hour and 7-day limits, context, and cache time above the prompt. Long-run, off by default, keeps the cache warm and pauses near the limit.usage-petmanson341349-beepDraws context, the 5-hour and weekly limits, and the cache hit rate above the prompt. The desktop Code tab draws four rings, with a pixel pet beside them.context-alarmmutlumehmetWarns when the context window fills, with a status line under the prompt, and suggests /save-context before compaction.
All 183 in Usage