cachewise

cachewise is a skill for Claude Code from duthaho/skillhub. It costs 204 tokens per session (1,521 once invoked), scanned A, original, MIT.

A local analysis of Claude Code transcripts to explain prompt-cache misses. Prompt caching stores repeated context so later requests can reuse it instead of rebuilding it.

In plain words
What is it for?
It is for analysing recent transcript files, attributing cache misses to causes such as idle gaps or model changes, and identifying possible savings.
Why use it?
It shows which habits cause cached context to be rebuilt and estimates the related token cost, rather than only reporting total usage.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths; mentions CLAUDE.md; positional $N argument.

Part of the daily plugin — 5 skills shipped together

Good fit It is for analysing recent transcript files, attributing cache misses to causes such as idle gaps or model changes, and identifying possible savings.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/duthaho/skillhub/cachewise
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add duthaho/skillhub --skill cachewise
Clone the repo
git clone --depth 1 https://github.com/duthaho/skillhub

Made for: Claude Code.

Or install daily, the plugin that ships this one along with the rest of its 5 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cachewise

README.md
[![agentmods](https://agentmods.dev/badge/skills/duthaho/skillhub/cachewise/github.svg)](https://agentmods.dev/skills/duthaho/skillhub/cachewise)
Your own site
<a href="https://agentmods.dev/skills/duthaho/skillhub/cachewise"><img src="https://agentmods.dev/badge/skills/duthaho/skillhub/cachewise/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cachewise

Your own site · 80×15
<a href="https://agentmods.dev/skills/duthaho/skillhub/cachewise"><img src="https://agentmods.dev/badge/skills/duthaho/skillhub/cachewise.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 204 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,521 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00204 $0.01521
Opus 5 $0.00102 $0.00760
Sonnet 5 $0.00041 $0.00304
Haiku 4.5 $0.00020 $0.00152

Measured 2d ago against content hash eeb6f0276dbe, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

cachewise scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/analyze.py, scripts/test_analyze.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/cachewise/SKILL.md · 124 lines

How it starts

The opening of the file, as written. The whole thing — 124 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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:

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 partial.

Step 1 — Read the attribution

The report splits cost three ways — keep them distinct, they prescribe differently:

  • miss_attribution — cache rebuilds, the avoidable core. Each cause carries tokens + USD (the money a cache hit would have saved): idle_gap, model_switch, write_churn, and unattributed (cause undeterminable, usually missing timestamps). The USD is avoidable spend, not total spend.
  • context_tax — not a miss: the standing read-cost of sessions that carry far more prefix per turn than your same-model norm. Sprawl, priced as excess reads.
  • dead_sessionlow-confidence heuristic: cold re-boots of a same-project session soon after another ended. Report it as a lead, not a fact — say "possibly" and cite the count.

Read the full file on GitHub · 124 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 124 lines · 204 tokens per session scan A eeb6f0276dbe

Subscribe to this mod's changes

cachewise is a skill published in the GitHub repository duthaho/skillhub (9 stars, last pushed 3d ago), licensed MIT. It adds 204 tokens to every session and 1,521 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-09.

Related

Other skills, from other repositories

mix-compression

Reduce mix output noise (5-15% token savings) by installing rtk filters that compress mix test/credo/dialyzer/compile output before it reaches Claude. Use when long mix output floods context.

oliver-kriska/claude-elixir-phoenix · 48 tokens

phx-mix-compression

Reduce mix output noise (5-15% token savings) by installing rtk filters that compress mix test/credo/dialyzer/compile output before it reaches Claude. Use when long mix output floods context.

oliver-kriska/claude-elixir-phoenix · 51 tokens

quick

Implement small Phoenix changes without planning — add validations, update routes, fix components, create migrations. Use for single-file edits under 50 lines.

oliver-kriska/claude-elixir-phoenix · 31 tokens

phx-freeze

Apply an advisory edit scope in this session. Use for read-only or directory-scoped work; no enforcement hook is installed.

oliver-kriska/claude-elixir-phoenix · 30 tokens

042-planning-openspec

Use when creating or updating OpenSpec artifacts from an issue, plan, approved design, ADRs, existing OpenSpec, or a valid combination. The workflow assesses reviewable scope, records source authority and derivation, handles conflicts, and prevents silent synchronization. Triggers include Create OpenSpec from an…

jabrena/plinth · 94 tokens

043-planning-github-issues

Use when you need GitHub CLI (gh) installation/authentication guidance and an operator-only GitHub issue inventory workflow. The agent does not ingest GitHub issue, milestone, body, comment, title, label, or summary text; requirements analysis must use repository-owned planning artifacts, with issue numbers only for…

jabrena/plinth · 113 tokens