Cache Tax
A Claude Code mod that keeps the prompt cache warm during breaks and shows the estimated rewrite cost before a cold send.
At a Glance
Free and open source Claude Code mod under the MIT License. Pings consume Claude tokens billed by Anthropic/the user's Claude plan, not by Cache Tax.
Engagement
Available On
Alternatives
Listed Nov 2026
About Cache Tax
Cache Tax is an open-source mod for Claude Code by Karan Bansal. It refreshes the session's prompt cache while you step away and asks for confirmation, with an estimated rewrite cost, before a cold prompt is sent. It requires Claude Code 2.1.287 or later and is distributed under the MIT license.
What It Is
Cache Tax is a Claude Code mod that works around the cost of an expired prompt cache. When the cached prefix expires, even a short message can trigger a rewrite of the whole old context. The mod addresses this in two ways: a bounded keepwarm window that pings the cache while you are away, and a guard that shows the estimated cost when you return to a cold session.
How the Keepwarm and Guard Workflow Works
Running /keepwarm 90m before a break arms a window. After 50 idle minutes, a timer inside Claude Code sends one tool-less fork over the session's transcript to refresh the cache. After each ping it reads usage and stops if reads are zero or writes reach 10% of reads. An optional idle spending limit (Ping floor) can skip later pings.
For contexts of at least 50,000 tokens, the guard asks before an ordinary message is sent into a cache its one-hour clock says is cold. It shows the estimated rewrite cost and offers Send anyway or Don't send. Where nobody can answer, it refuses once and the resend goes through. By default, a detected cold write automatically arms keepwarm for at least three hours; the Auto keepwarm option in /config turns this off.
Commands and Display
/keepwarm,/keepwarm 90m,/keepwarm always,/keepwarm statusand/keepwarm offcontrol warming./cache-taxshows the current cache estimate, warming window and the session's cold-write tally.- While keepwarm is armed, a row above the prompt (or a status entry) shows warm, cold or unknown state, the next ping and the last receipt.
Costs, Limits and Reach
Dollar figures are API-equivalent estimates, not extra subscription charges, and pings cost tokens, including uncapped output. The 50-minute schedule needs a one-hour main cache; API-key and some other billing paths default to five minutes and need promptCacheTtl set to "1h". The README documents the hooks and calls the mod uses and states that only the fork request leaves the machine. A separate hook-based version exists for people who prefer settings hooks.
Community Discussions
Be the first to start a conversation about Cache Tax
Share your experience with Cache Tax, ask questions, or help others learn from your insights.
Pricing
Open Source
Free and open source Claude Code mod under the MIT License. Pings consume Claude tokens billed by Anthropic/the user's Claude plan, not by Cache Tax.
- MIT License
- /keepwarm cache warming
- Cold-send guard with estimated rewrite cost
- Requires Claude Code 2.1.287+
- Pings cost tokens (external Claude usage costs)
Capabilities
Key Features
- Keepwarm window that pings the prompt cache after 50 idle minutes
- Cold-send guard with estimated rewrite cost and Send anyway / Don't send choice
- Automatic keepwarm arming after a detected cold write
- Idle spending limit (Ping floor) for pings
- Row above the prompt showing warm/cold state, next ping and last receipt
- Per-session cold-write tally via /cache-tax
- Per-model price rows for cost estimates
- Headless prompt handling option
- Read-only $.cacheTax.status() API for other mods
