Purpose
The L2Cache Token Tax Calculator is used to quantify the "cold session tax" in Claude Code usage: Claude Code caches conversation content so that each subsequent turn only requires a low-cost cache read. Subscription-tier caches are retained for 1 hour, and API Key-tier caches for 5 minutes; if you send a message after that time, the entire conversation history is rewritten to the cache, at a cost of 12 to 80 times that of a warm turn (depending on the model). This tool helps developers see how much of their total spend and usage limits this extra overhead accounts for.
Key capabilities
- Reads JSONL session files under the local ~/.claude/projects, prices the input, output, cache reads, and cache writes of each request according to Anthropic API rates, and calculates cache writes based on the 1-hour or 5-minute lifetime recorded by Claude Code.
- Calculates total token spend, cache hit rate, and cold resume cost.
- Identifies cold resumes: if a later request in the same session writes at least 25,000 tokens and the write amount is greater than the read amount, the conversation is considered to have been rewritten to the cache; its extra cost is the write cost minus the cost of reading the same tokens from a warm cache, and the ratio of this extra cost to total spend is used as the core metric.
- The companion Session Viewer lets you view each cold resume by session, idle time, and size, and read the conversation content.
How to use
Open the tool in a browser and select the entire ~/.claude/projects folder (to view all history) or a single project folder (to view only that project). Files are read by JavaScript in the browser and never leave your machine; the result cards store only summary data, with no prompts, code, file paths, or project names.
Companion Mac app
L2Cache for Mac reads Claude Code and Codex sessions locally, knows the size, cache lifetime, and last request time of each session, sends data nowhere, and does not send requests on your behalf. Features include: warning about expired cached sessions before you type and showing the cost in the terminal; the first message is held once, and pressing ↑ and Return sends it as-is (the script only warns); after typing /clear, the new session carries a handoff summary of the old session (goal, completed work, next steps); a menu bar badge marks oversized sessions so you can compact while the cache is still cheap; in Codex,the same check applies, and /new starts a new session. It also provides a unified panel to search agent sessions, terminal commands, git, and clipboard history. The official text states that the first 100 developers can get L2Cache for Mac for free, and gives manual redemption instructions for the Mac App Store.
Use cases and limitations
Suitable for developers who want to audit Claude Code token overhead, locate the sources of cold resumes, and optimize the 5-hour/weekly usage limits. Note: subscribers do not pay per token, but cache writes also count toward limits, and dollar figures are API price equivalents; the tool only analyzes local session files and does not change Claude Code behavior. The official recommendation is to run /compact while the cache is still warm, or to start a new session with /clear plus a brief summary, rather than resuming a large cold session.