Free Token & Cache Calculator · Runs in browser · 100% Private

How much of your Claude Code spend goes to cold resumes?

Calculate your Claude Code token usage and prompt caching costs. Resuming a session after its cache expires rewrites the whole conversation to the cache at 12× to 80× the cost of a warm turn. Measure your cold resume tax in seconds, then share the card.

Or drop the folder here. In the macOS picker, press ⌘⇧. to show hidden folders, or run open ~/.claude/projects in Terminal.

Your files are read on this device. The card holds only totals.

Catch the next cold resume before you send it

L2Cache is a Mac app that reads your Claude Code and Codex sessions locally, so it knows each session's size, cache lifetime and last request. Nothing is sent anywhere, and it never sends requests on your behalf.

$ claude --resume ⚠ L2Cache: this session's cache expired 2 h ago. Your next message reloads 241k tokens, ≈ 40× a warm turn. Type /clear to start fresh with the handoff loaded.

Warns before you type

Resume a session whose cache has expired and the cost appears in the terminal before your first message.

Stops the first message once

Send anyway and it holds that one message. Press ↑ and Return to send it as is. Scripts are only warned.

Fresh start, same context

Type /clear and the new session starts with a handoff of the old one: goal, finished work, next step.

Heads-up before expiry

A menu-bar badge flags very heavy sessions so you can compact while the cache is still cheap.

Codex too

The same check runs in Codex, where /new starts the fresh session.

Plus your whole dev history

Search agent sessions, terminal commands, git and clipboard history from one panel.

Download L2Cache for Mac Free download, 15-day Pro trial. Pro is $9.99 once (Black Friday price, regular $19.99), no subscription.

How the number is worked out

  1. Every request is priced. Input, output, cache reads and cache writes at Anthropic's API rates for the model used, with each write at the lifetime Claude Code recorded (1 hour or 5 minutes).
  2. Cold resumes are found. A later request in a session that writes at least 25k tokens and writes more than it reads: the conversation was written to the cache again.
  3. The extra is measured. What that write cost, minus what reading the same tokens warm would have cost. The headline is that extra as a share of all your spend.

Background: the cold-session tax in 10,000 requests and why resuming a cold session costs more.

FAQ

What is a cold resume in Claude Code?

Claude Code caches your conversation so each turn re-reads it cheaply. The cache lasts 1 hour on a subscription and 5 minutes on an API key. Send a message after that and the whole conversation is written to the cache again, at 12× to 80× the cost of a warm turn depending on the model.

Why did Claude Code hit my 5-hour limit so fast?

Claude Code's 5-hour and weekly usage limits count every token written to Anthropic's prompt cache. When you resume a session after its cache expires, the entire conversation history is re-written to the cache at full creation cost (12× to 80× the cost of a warm turn). A few cold resumes on large sessions can eat your 5-hour limit in just a couple of turns.

How is the cache tax calculated?

For every request in your session files, the tool prices input, output, cache reads and cache writes at Anthropic's API rates, using the cache lifetime Claude Code recorded for each write. A cold resume is a later request that writes at least 25,000 tokens and writes more than it reads. Its extra cost is the write minus what reading the same tokens warm would cost. The headline is that extra cost as a share of the total.

How can I check my total Claude Code token usage and spend?

Claude Code stores your local transcripts under ~/.claude/projects as JSONL files containing token breakdown logs (input_tokens, output_tokens, cache_read_input_tokens, and cache_creation_input_tokens). This free in-browser tool reads those files client-side to calculate your total token spend, cache hit ratio, and cold resume cost without uploading your code or data.

I'm on a subscription. Does this apply to me?

Yes. You don't pay per token, but cache writes count toward your 5-hour and weekly limits like any other usage, so the share is roughly the share of your limit that cold resumes used. The dollar figure is an API-price equivalent.

Are my session files uploaded?

No. The files are read by JavaScript in your browser and never leave your Mac. The card holds only totals: no prompts, code, file paths or project names.

Which folder should I pick?

~/.claude/projects holds one folder per project with a .jsonl file per session. Pick the whole folder for your full history, or one project folder for just that project.

How do I avoid cold resumes?

Run /compact while the cache is still warm, or start a fresh session with /clear and a short summary instead of resuming a large cold one. L2Cache for Mac warns you before a cold resume and loads a handoff into the fresh session for you.

Related