NEXTCOSTv0.19.02026-10-22nextcost/main
See the cold‑cache bill before you send it.
A Claude Code plugin that draws the prompt cache's countdown and the re‑warm price above the prompt. Step away too long and the cache goes cold: your next message writes the whole conversation again.
claude plugin install nextcost \
--marketplace HMarzban/nextcost
It loads in your next session, or run /reload-plugins in an open one. The one-line install needs Claude Code 2.1.292 or later.
free · MIT · no network · no tokens · terminal + desktop app
01Cache, cost and usage limits, live
great, I'm grabbing lunch. back in an hour or so
Last minute. The cache expires in 0:40; miss it and the next message costs ~$1.57 to re‑warm.
- cacheLAST CALL · 0:40 · re‑warm ~$1.57
- spend$4.75 so far · last message $0.33
- context303k of 1.0M · 30%
- 5h27% used · resets in 1h 30m
- 7d41% used · resets in 2d 18h
/nextcost layout pulse
The band's real drawings from one recorded session; clock times are the recording's.
02Prompt cache cost · Opus 5.5, 340k
~$0.07 back in time. ~$1.70 back late.
Claude Code keeps your conversation in a prompt cache for 5 minutes or an hour after each request. Back in time, the next message re‑reads it for a fraction of the price; back late, it writes the whole conversation again. Try your own model and size.
Back before the cache expires warm
- Context340k tokens
- Read at0.05 × $4.00/M
- Your words and the replysame either way
Context part~$0.07
Back after lunch cold
- Context340k tokens
- Written again at1.25 × $4.00/M
- Your words and the replysame either way
Context part~$1.70
Difference~$1.63 · 25×
the warm read, on the context part
How the price is worked out
A mod can't reach a pricing table, so the band solves the per‑token rate from the session's own bill: each kind of token is a fixed multiple of base input, which leaves one unknown.
cost = rate × (uncached + 1.25 × written + read share × read + 5 × output)
A re‑warm is the whole context written again. List prices per million input tokens: Opus 5.5 $4, Sonnet 5.5 $2, Fable 5.1 $10, Haiku 5.5 $0.10 up to 100k prompt tokens and $0.50 over. A warm read costs 0.05× of that on Opus 5.5 and Sonnet 5.5, 0.025× on Fable 5.1 and 0.1× on Haiku 5.5. A cache write is 1.25× here, as Claude Code's own ledger counts it; the API bills a 1-hour write at 2×. On a subscription these tokens come out of your plan's usage limits rather than your card. Prices from Anthropic's pricing page, checked 2026-10-19.
03What the plugin reads, what it never does
It never burns tokens to avoid burning tokens.
Reads and keeps
- Cost, tokens, context, limitsfrom Claude Code
- Two read-only git commands3 s timeout
- A reopened session's transcriptonce: its cost records and last 1 MB (grep, tail)
- Settings2 keys
- Layout, last replies, a week of limitsits own store
Never
- Calls a model0 tokens
- Sends anything over the network0 requests
- Writes a file0 files
- Suggests a message to keep it warm0 · ever
Over 1,100 tests · MIT · every read and command, exactly, in SECURITY.md; claude plugin validate lists every API call and environment read.
04Notes on the prompt cache, the price and usage limits
The fine print
Why did one message cost so much more than the others?
Most likely the prompt cache went cold. Claude Code caches your conversation for 5 minutes or an hour after each request; after that, the next message writes all of it again at 1.25× the input price, as Claude Code counts it. On Opus 5.5 that's 25× the warm read, for the context part.
Is the re-warm price exact?
It's an estimate, always shown with ~. The band solves the per‑token rate from the session's own bill, counting as Claude Code's ledger does: every cache write at 1.25×. The API bills a 1-hour write at 2×, so an API key on the hour's cache may pay up to 1.6× the estimate.
How does it know whether my cache lasts 5 minutes or an hour?
Claude Code uses the hour on a subscription within plan usage, and 5 minutes on an API key, usage credits or a cloud provider. The band assumes an hour and corrects itself if the cache rebuilds sooner. Set CLAUDE_CODE_PROMPT_CACHE_TTL or promptCacheTtl to remove the guess.
Does it work in the Claude desktop app?
Yes. It draws in the desktop app's Code tab with icons and meters, and in the terminal as text. The one-line install needs Claude Code 2.1.292 or later.
What happens when Claude Code compacts an idle session, or I resume one?
In the terminal, on the hour's cache, Claude Code can compact a conversation over 200k tokens (by default) left idle about 54 minutes; the band then reads compacted, with what the summary will cost. A resumed session keeps its idle time and its spend, from Claude Code and one read of the transcript.
How is it different from ccusage or a status line?
ccusage reports what you spent, from past logs. A status line can show a cache countdown. This band shows the re‑warm price from the session's own bill, live above the prompt, in the desktop app too, with your 5-hour and weekly pace beside it.
Does it send my data anywhere, or spend tokens?
No. It makes no network calls, never calls a model and writes no files. It never suggests a message to keep the cache warm either: that would be burning tokens to avoid burning tokens. SECURITY.md lists everything it reads.
How does it show my 5-hour and weekly limits?
/usage shows them when you ask. The band keeps them on screen: each chip turns amber at 80%, the 7d with a !, and the 5h says when your pace would fill it before it resets.
05Total · the Claude Code plugin
The whole bill comes to $0.00
- nextcost 0.19.0, MIT$0.00
- Tokens it spends to watch your cache0
- Total$0.00
- Paid$0.00
claude plugin install nextcost \
--marketplace HMarzban/nextcost
It loads in your next session, or run /reload-plugins in an open one. The one-line install needs Claude Code 2.1.292 or later. /nextcost layout <name> picks chips, pulse or departures.