Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By karanb192v1.1.3MITIn 1 marketplace
Shows what your next message will cost when Claude Code's one-hour prompt cache has lapsed, before you send it. Its prompt hook warns when a message would re-write a lapsed cache and can be set to refuse it once, and it says it makes no network calls.
Trending plugins
7-day copy clicks
Claude loads one when your task matches it, or you run it by name.
No risk signals detected
Nothing flagged in this plugin's hooks, MCP servers or commands. Other components are not analyzed.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
prompt-cache, cost-tracking, token-usage, status-line, cache-ttl, session-resume, claude-code, hooks ·
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.

The comeback price of a cold prompt cache, shown before you pay it.
Claude Code's main conversation rides a 1-hour prompt cache. Come back at minute 59 and the next message costs cents. Come back at minute 61 and the whole context is re-written at the cache-write rate, which on Fable 5.1 is 80x a cache read ($20 against $0.25 per million tokens). A 500k-token session re-cached cold is $10 at list price, and the message that triggers it is usually "good morning". Claude Code computes all of this and shows none of it at the moment you press Enter. This plugin does.
No plugin install needed. cache-tax.js has no dependencies; it reads its list prices from prices.json beside it. Copy both, then call the script from your own status line script with the same stdin Claude Code sends you, and print its line as one more row:
curl -fsSL https://raw.githubusercontent.com/karanb192/claude-code-hooks/main/plugins/cache-tax/cache-tax.js -o ~/.claude/cache-tax.js
curl -fsSL https://raw.githubusercontent.com/karanb192/claude-code-hooks/main/plugins/cache-tax/prices.json -o ~/.claude/prices.json
Without prices.json next to it (or CACHE_TAX_PRICES_FILE pointing at one) the row still counts down and shows token counts, with n/a in place of dollars.
# inside your status line script, where $input holds the JSON Claude Code piped in
printf '%s' "$input" | node ~/.claude/cache-tax.js --statusline
It prints one line, while warm and then after the cache lapses:
cache 47m left · 218k · cold costs $4.37 · last miss ttl_expired_1h
cache COLD · next msg re-writes 218k = $4.37 · last miss ttl_expired_1h
It reads the native prompt_cache object Claude Code sends to status lines (v2.1.251+), so Claude Code re-runs it the moment the cache goes cold; on older versions it falls back to the transcript named in the same payload. The guard and the resume price below are the plugin; the row works without it.
/plugin marketplace add karanb192/claude-code-hooks # once per machine
/plugin install cache-tax@claude-code-hooks
Restart Claude Code, done. (Or from a shell: claude plugin install cache-tax@claude-code-hooks.)
| Event | Runs | What happens |
|---|---|---|
| UserPromptSubmit | sync, ~30 ms | Reads the newest usage block from the session transcript. If the cache has lapsed and the context is over CACHE_TAX_BIG tokens, shows the re-write cost as a warning. With CACHE_TAX_BLOCK=1 it refuses the prompt once instead (exit 2); resend the same message to proceed, or /clear and start from a handoff note. |
SessionStart (resume|fork) | sync | On a cold resume, prints the idle gap, the tokens the first message re-writes, and the dollar estimate Claude Code already computed (estimated_cache_write_usd, v2.1.251+). Falls back to the transcript on older versions. |
/cache-tax:status renders the full card on demand: tier, warm or cold, context size, cold-comeback price, and this session's cache writes, reads and full re-writes so far. From a shell, node cache-tax.js --render --transcript <path> renders the same card for any transcript; without --transcript it picks the newest transcript for the current directory.
The guard ignores slash commands, so /clear and /compact never trigger it. After a compaction (manual or auto) the old context no longer applies, so until the first new turn lands the status line reads cache reset by /compact · 17k carried · next msg writes ≥ $0.34, the card says the same, and the guard stays quiet: the summary has never been cached, so that first write is unavoidable and small.
cache-tax: the 1h prompt cache lapsed 2h00m ago. This message re-writes 300,002 tokens at $20/MTok = $6.00
(a warm turn would have cost $0.08). If most of that context is stale, /clear and start from a handoff note instead.
The same tool exists as a Claude Mod, cache-tax@claude-code-mods, for Claude Code 2.1.287 or later, where mods are on by default. It runs inside Claude Code instead of reading the transcript, refuses a cold send once by default, and adds what a hook cannot do: /keepwarm 6h sends one cache-shared ping after 50 idle minutes so the cache is read, not re-written, when you come back. Install one form, not both; two guards fire twice. The status line segment below stays with this hook's files either way, because a mod cannot draw into the status line.
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub karanb192/claude-code-hooks --plugin cache-taxPlugins from other owners that cover similar ground