Skip to content
SkilledDragonEngineering Intelligence
MinilabKeylessOctober 21, 2026

pausa warns before Claude Code's prompt cache goes cold and prices the next message

A CLI and hook set that reads Claude Code transcripts, says how long the prompt cache stays warm, and prices the next message warm vs cold from published rates. 7 of 7 synthetic sessions matched.

By David Discua

Measured in the lab

7/7
synthetic sessions classified as expected
18/18
documented sentences re-found
13/13
price rows matched
0.883x
back-test, actual vs predicted re-write
Within 20% of predictionidle gaps over the TTL132
Wrote less than predictedprefix partly still cached21
Wrote over 1.2x prediction0
  • 7 of 7 synthetic sessions got their expected cache state
  • 18 of 18 documented sentences found on the Claude docs
  • 13 of 13 price rows matched the pricing page
  • No resume request in the back-test wrote more than 1.2x the prediction
  • 500 queued jobs claimed and completed in 1195 ms

From reports/pausabudget-gate.json · run on October 21, 2026. 7 synthetic transcript scenarios with fixed clocks; prices from the Claude pricing page fetched October 21, 2026; timings on darwin x64, Bun 1.4.3

How it is wired

usagehandoffTranscriptJSONL usagepausawarm vs cold $File queueleases + retries

01/03Claude Code logs token usage for every request to a transcript.

A long Claude Code session re-sends its whole context with every message. While the prompt cache is warm, that prefix is billed at the cache-read rate. After a break longer than the cache lifetime, it is written to the cache again at the write rate, and on a 1-hour cache with at least 200,000 tokens of context, Claude Code can compact the conversation after "about 54 minutes" idle. pausa reads the session transcript, says how long the cache stays warm, prices the next message warm and cold from Anthropic's published rates, and offers a cheaper exit: queue the remaining work and /clear. The catch is that cache expiry is an estimate.

The catch

The API counts the cache lifetime from the start of a request, which transcripts do not record. pausa uses the user line logged right before the response, so its deadline errs early. Helper requests can keep the cache warm longer, and the server can evict early. Transcripts are not a public API either; the field names were checked on Claude Code 2.1.296.

Dollar figures are list-price estimates for the context prefix only, with no new prompt, tool output or response priced. On a subscription within plan usage you are not billed per token, so read them as API equivalents. Hooks fire on events, so a warning ahead of a deadline needs pausa watch running in a terminal. The optional Gemini tidy-up of the hand-off text was not run live in this lab.

What we ran (keyless)

bun install --frozen-lockfile
bun run demo
bun run docs:verify
bun run prices:verify
bun run report

From reports/pausabudget-gate.json, generated on October 21, 2026. The scenarios are synthetic transcripts with fixed clocks, priced from the pricing page fetched that day:

ScenarioContextTTLIdleStateNext deadlineCold/warm
1h cache, idle 50m231.4K1h50m02sexpiringidle compaction in 3m58s40.0x
5m cache, idle 4m10s120.0K5m4m12sexpiringcache expiry in 48s25.0x
1h cache, idle 20m150.0K1h20m02swarmcache expiry in 39m58s40.0x
5m cache, idle 2h140.0K5m2h00mcoldnone12.5x
1h cache, 610K context, idle 56m610.0K1h56m02scompaction_duecache expiry in 3m58s80.0x
compacted while idle18.5K1h1h07mcompactednone40.0x
OTel input, idle 3m214.0K5m (default)3m00swarmcache expiry in 2m00s25.0x

All 7 matched their expected state. The cold/warm ratio follows from the published multipliers. Cache writes cost 1.25x base input on a 5-minute cache and 2x on a 1-hour cache, and reads cost 0.1x, 0.05x or 0.025x depending on the model. docs:verify found 18 of 18 quoted sentences on the docs pages, and prices:verify matched 13 of 13 price rows.

The README also records a back-test on 18 real Claude Code transcripts, aggregate counts only. They had 153 idle gaps longer than the TTL. The resume requests wrote 0.883x the tokens pausa predicted, 132 gaps landed within 20% of the prediction, 21 wrote less, and none wrote more than 1.2x. So the cold estimate errs high.

How it is wired

The reader uses only usage fields and skips subagent lines. The TTL comes from the last cache write, else from documented settings, else 5 minutes. Hooks print a one-line status after each turn, warn on the first prompt after expiry, and never block the session on an error. pausa handoff puts a task file on a directory queue with atomic renames, leases, retries and a dead-letter folder.

Minilab (open source)

Upstream is anthropics/claude-code (153,201 stars, TypeScript, no open-source license listed on GitHub, as of October 24, 2026). Run bun run pausa -- gaps --aggregate on your own transcripts and compare your ratio with the 0.883x above.

Run it yourself

SkilledDragonCorp/pausabudget-gate

Clone, install and run the report with no API keys. The numbers above are what that run writes.

bun install --frozen-lockfile && bun run demo

SkilledDragon is not affiliated with Anthropic, Google, Trigger.dev or Hatchet. Dollar figures are list-price estimates, not a bill; re-run the report before relying on them. Marks belong to their owners.

All labs