Cache Tax

Keep Claude Code's prompt cache warm

·

source at 535ff33

·

MIT license

Keeps Claude Code's one-hour prompt cache warm through breaks and asks before a cold send, showing what rewriting the context would cost.

9 installs

What this mod can do

  • Reviewed at commit 535ff33
  • Sends the conversation to Claude with its own requests, which uses your tokens
  • Reads environment variables
  • Sees each change to /config and can block or rewrite it
  • Sees each prompt you send and can change or drop it
9 more things it can do
  • Reads your settings
  • Remembers data between sessions
  • Asks you questions
  • Adds the /cache-tax command
  • Adds the /keepwarm command
  • Lists the slash commands you can run
  • Adds its own methods for other mods to call
  • Runs on a timer
  • Runs on Claude Code hooks, such as session start
Good to know (3)
  • Pings are model requests and cost tokens; Ping floor limits what one idle break can spend
  • Needs a one-hour cache: on an API key, set promptCacheTtl to "1h"
  • With Headless prompts set to send, claude -p and SDK prompts skip the cold-send question
Are mods safe?

Preview

Terminal

⎿ cache-tax: keepwarm on for 6h00m, a ping 50m after each idle stretch keeps the cache read, not re-written; pings may stop sooner at the idle spending limit ⎿ cache-tax: claude-opus-5-5 state warm, 1h00m left context 44,000 tokens cold cost $0.35 to re-write it (warm turn $0.01) keepwarm on, 6h00m left · ping in 50m break-even up to 40 pings at the read rate cost one cold write, about 33h20m of idle at one ping per 50m guard ask first (/cache-tax guard warn to only show the price) session 0 cold writes paid, $0.00 [>] cache-tax · warm · keepwarm 6h00m left · ping in 50m [-]

Claude Desktop

Cache Tax in Claude Desktop

What it does

In the author's words

A Claude Code mod that keeps the one-hour prompt cache warm during breaks and asks before a cold send, showing its estimated rewrite cost. Warming uses model requests and costs tokens. Requires Claude Code 2.1.287+.

What you see
A row above the prompt, or a status entry
Works in
Terminal and Claude Desktop
Slash commands
/cache-tax, /keepwarm
Uses your tokens
Each warming ping is a model request
Changes files
Nothing
Network access
None
Reviewed commit
535ff33
Preview recorded with
Claude Code 2.1.309

How it works

  1. /keepwarm arms a six-hour window in a warm session; /keepwarm 90m a shorter one
  2. After 50 idle minutes it sends one ping over the transcript to refresh the cache
  3. If the cache went cold, it asks before sending and shows the rewrite cost
  4. A row above the prompt shows cache state and time to the next ping

Common questions

Do the warming pings cost money?

Yes, pings cost tokens. Ping floor limits what one idle break can spend, and /keepwarm off stops them.

Badge for your README

Own this listing? Add it to your README. The badge shows the install count as it grows.

Reviewed on statuslin.es
[![Reviewed on statuslin.es](https://statuslin.es/badge/mods/cache-tax.svg)](https://statuslin.es/mods/cache-tax?utm_source=readme-badge)

Or show the preview card:

Preview on statuslin.es
[![Preview on statuslin.es](https://statuslin.es/og/mods/cache-tax.png)](https://statuslin.es/mods/cache-tax?utm_source=readme-badge)