More screenshots

    Works with the AI Agents you already use

    Claude Code Prompt Cache Report

    by Minh Phạm Việt Hoàng

    1

    See exactly where your Claude Code sessions lose their prompt cache, what each break cost, and how to stop it.

    $1

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Claude Code Prompt Cache Report

    Claude Code Prompt Cache Report

    Example session with this skill installed

    My Claude Code session from yesterday got really expensive. Run a cache report on it and tell me what broke the cache.

    • Read your context and instructions
    • Compiled the claude code prompt

    I ran the cache report on that session (107 requests, Claude Opus 5.5). Short version: caching worked well while you were active, but every time you came back after more than an hour, the whole conversation was rewritten. That happened 4 times and added about $4.00, almost half of the session's cost.

    Report output (line breaks adjusted to fit a phone screen):

    Session   08347028
    Time      11-10 17:44 -> 11-11 17:00
    Requests  107, claude-opus-5-5
    
    Cache read      11.08M
    Cache write     650.5k
    Uncached        236
    Output          64.1k
    Hit rate        94.5%
    Est. cost       $8.70
    Without cache   $48.19
    
    Cache breaks    4, +$4.00
      11-10 20:31  rewrote 115.2k  +0.90
        - cache expired: 2h19m idle, TTL 1h
      11-10 22:39  rewrote 120.6k  +0.94
        - cache expired: 1h12m idle, TTL 1h
      11-11 00:11  rewrote 136.2k  +1.06
        - cache expired: 1h12m idle, TTL 1h
      11-11 16:06  rewrote 140.8k  +1.10
        - cache expired: 15h50m idle, TTL 1h
    

    What happened

    BreakIdle timeTokens rewrittenExtra cost
    20:312h19m115.2k$0.90
    22:391h12m120.6k$0.94
    00:111h12m136.2k$1.06
    16:06 (next day)15h50m140.8k$1.10

    Your session uses the 1-hour cache. All four breaks have the same cause: the next message came after the hour was up, so Claude Code had to send the full 115k–141k token history again at the cache-write price. Each rewrite was bigger than the last because the conversation kept growing.

    Nothing else broke the cache: no model switch, no compaction, no MCP or settings change.

    What to change

    Reply within the hour. Two of the breaks were only 12 minutes past the hour. If you know you'll be back soon, send your next message before the hour is up and the whole history stays cached.

    Run /compact before a long break. Coming back then rewrites a short summary instead of 140k tokens.

    Start a new session the next day unless you really need the full history. A fresh session's first request is small; resuming a cold 140k-token one costs about $1.10 every time.

    Costs are estimates from list prices. On a Pro or Max plan, read them as how much of your usage limit each break used.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Claude Code resends your whole conversation on every request. When the prompt cache is warm, that costs a fraction of normal input. When it goes cold, the next request pays to rewrite everything, often 100k+ tokens at once. It happens silently: no error, just a bigger bill or a usage limit that arrives sooner.

    This skill makes it visible. Ask Claude "why was this session so expensive?" or "show my cache report for this week", and it runs a local report on your own Claude Code transcripts, then explains the result in plain language:

    • Cache hit rate per session and what caching saved you
    • Every cache break: when it happened, how many tokens were rewritten, and what it cost beyond a normal cache read
    • The likely cause of each break:
      • idle past the cache lifetime (5 min or 1 h)
      • model switch
      • compaction
      • effort or thinking change
      • MCP server, plugin or system prompt change
      • an edited earlier message (shows how far the cache still matched)
    • A fix for each cause, plus at most three habits worth changing

    In the author's own sessions over one week, cache breaks were about a third of the estimated cost, almost all from returning after the 1-hour cache had expired.

    Example output

    Real output from the author's sessions (shortened):

    Cache hit rate  94.5%
    Est. cost       $8.70 (no cache: $48.19)
    
    Cache breaks    4, +$4.00 vs cache reads
      11-10 20:31  rewrote 115.2k  +0.90
        - cache expired: 2h19m idle, TTL 1h
      ...
      11-11 16:06  rewrote 140.8k  +1.10
        - cache expired: 15h50m idle, TTL 1h
    

    Weekly view, worst sessions first:

    start        hit%   cost  breaks  break $
    11-10 17:44  94.5  $8.70     4     $4.00
    11-14 17:37  91.6  $6.29     3     $3.10
    ...
    Total cost     $46.93
    Cache breaks   $14.97 (31.9%)
    

    What's included

    • SKILL.md: when to run the report, how to read it, how to explain it
    • scripts/cache_report.py: the report (single session, all sessions, --days N, --json, custom prices)
    • references/fixes.md: what to do for each cause of a cache break

    Privacy and safety

    • Runs entirely on your machine. Reads ~/.claude/projects only, never writes to it.
    • No network calls, no telemetry, no dependencies: Python standard library only.
    • Does not change your settings or CLAUDE.md.

    Requirements

    • Claude Code with local transcripts (default)
    • Python 3.8+

    Costs are estimates from list prices, not your actual bill. Break causes are best guesses from what the transcript records; some breaks can only be labeled as an unnamed prefix change. It reports past sessions, not the live cache timer. If a future Claude Code update changes the transcript format, the report may need an update.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 16 days ago

    Software
    Claude CodePython 3.8+

    Tested on macOS; Windows not tested yet.

    Permissions

    Terminal / Shell
    Read Files

    File Scopes

    ~/.claude/projects/**/*.jsonl

    Read-only. The script reads Claude Code's local session transcripts to compute cache statistics. It never writes files, makes no network calls, and does not read credentials or environment variables. Python standard library only.

    Listed16 days ago
    Updated6 days ago

    What's inside

    Frequently Asked Questions

    It reads your local Claude Code session transcripts and lists every cache break: when it happened, how many tokens were rewritten, what it cost, and the likely cause (idle past the cache lifetime, model switch, compaction, effort change, tool or system prompt change, edited history). Your agent then explains the biggest ones and the habit that prevents each.

    Yes. Cache breaks use up your usage limits the same way they would raise an API bill. Dollar figures are list-price estimates, so read them as relative cost.

    No. The script runs on your machine, reads ~/.claude/projects and makes no network calls. Only the summary report is shown to your agent, like the output of any command you run in Claude Code.

    No. It analyzes Claude Code's session transcripts (CLI, desktop app and IDE extensions all write them). Other agents can load the skill but have no transcripts for it to read.

    Claude Code and Python 3.8+. Standard library only: nothing to install, no API keys.

    Yes. Subagent transcripts are included, and their caches are analyzed separately.

    No. It shows what happened and why. For a live countdown while you work, the skill points to the free open-source cache-warm mod.

    New in LLM Ops

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.