← ClaudeAtlas

cachewiselisted

Prompt-cache economics forensics — why your Claude Code tokens burn so fast, with the numbers to prove it. Parses local ~/.claude transcripts (0 tokens, a bundled Python script does the counting) and attributes every cache-miss rebuild to a cause — idle gaps past the 5-min TTL, mid-session model/effort switches, prefix churn (MCP tool-lists, edited CLAUDE.md, dynamic content), and cold re-boots of a session you could have resumed — each priced in real USD, then prescribes the fixes ranked by dollars saved. Tracks before/after in out/cachewise/tracker.md so the next run measures whether a fix worked. Use when the user asks why they hit usage limits so fast, wants their cache hit rate or token spend analyzed, or where their tokens are going — e.g. "/cachewise", "analyze my prompt cache", "what's burning my tokens". For recurring behavior mistakes use tune; for today's schedule use daybrief.
duthaho/skillhub · ★ 9 · AI & Automation · score 76
Install: claude install-skill duthaho/skillhub
# cachewise — where your cache dollars leak `/cachewise` — analyze the last 30 days across every project `/cachewise --days N` — widen or narrow the window Answer one question: **which habits are rebuilding cache you already paid for, and what would each fix save?** Prompt caching makes a cache read cost 0.1× and a rebuild cost 1.25× — so every avoidable miss is a ~12× markup on that slice of context. ccusage and `/cost` count the tokens; cachewise says *why* the expensive ones happened and *what to change*. The evidence is on disk — the transcripts recorded every cache write; this skill attributes them so the numbers, not folklore, drive the fix. ## Step 0 — Run the analyzer The counting is deterministic and token-free — **never read the raw JSONL yourself** (parsing thousands of transcript lines with the model is the exact token burn this skill exists to stop). Run the bundled script: ```bash python3 .claude/skills/cachewise/scripts/analyze.py --days 30 ``` It scans `~/.claude/projects/**/*.jsonl` and prints one JSON document. No `~/.claude` data (fresh machine, or none in the window) → the script returns zero turns; say so plainly and stop, there's nothing to diagnose. Before trusting the numbers, glance at `flags`: - `pricing_fallback_models` — models priced at the Sonnet-4.x fallback because their id wasn't in the table (USD is approximate for those). - `missing_timestamp_turns` / `malformed_lines` — data the parser skipped; large counts mean the picture is pa