Skip to content

Case study 06 · Public repo · a team default

Prompt caching,on by default.

A skill that makes cache-first the way a team's Claude integrations get written, a one-page field card, and the finance case for moving routine volume to local inference.

Role
Author
What it is
A Claude Code skill, a runbook, a field card and a finance exhibit
Audience
Engineers, and the people who approve the bill
Status
Public

Read the code ↗

docs/prompt-caching-field-card.html
The prompt caching field card: put stable content first and volatile content last, mark the breakpoint with cache_control, and repeat, with the rate multipliers for cache writes, cache reads, fresh input, output and batch.
The field card from the repo: order, mark, repeat. It is the thirty-second version of the runbook.

The problem

Caching fails silently, so nobody notices it is off.

Cached input reads bill at a tenth of the input rate, but only if the prompt is laid out for it. One changing byte in the stable part of a prompt turns the saving to zero, and nothing errors.

This repo makes the right layout the default. Clone it and the skill loads, so every integration Claude writes puts stable content first, marks the breakpoint, and logs cache reads so a CI check can assert them.

How it works

Follow one requestthrough it.

Drag sideways to follow it →

Reference per-call cost at list rates · a worked example, not measured trafficcache_control breakpointStable prefix · 8K tokenssystem, tools, runbooks, few-shot: byte-identical every callFresh · 2Kthis call's inputOutput · 500never cachedNaive API$0.0125 per call+ Caching$0.0053 · down 58%+ Batch$0.0026 · down 79%
Call 1 writes the prefix to the cache, at 1.25 times the input rate.Every call after that reads it back at 0.1 times.
  1. Stable first

    System text, tools, runbooks and examples go up front. Volatile content goes after the breakpoint.

  2. Mark the breakpoint

    cache_control on the last stable block, with at most four breakpoints.

  3. Verify every integration

    Log cache_read_input_tokens and assert it in CI, because a miss is silent.

  4. Write down exceptions

    If caching is skipped, the code says why in one line.

What is measured

One reference call, itemized.

58%
lower per-call cost with prompt caching, on the reference shape
79%
lower with caching and batch together
8K + 2K + 500
the reference shape: stable prefix, fresh input and output tokens
0.1×
what a cached input read bills at, against the input rate

Read this before the numbers

  • These are worked figures at list rates for one reference shape. They are not measurements of anyone's traffic.
  • Outputs never cache, so a whole-bill saving follows your input share and your hit rate. A workload with short prompts and long answers saves far less.
  • Rates and model minimums move. The repo says when its rates were last checked.

What it leaves out

The limits,stated plainly.

  • Measured hit rates

    The repo carries a rollout checklist and a target. It has no traffic of its own.

  • The local-inference lane

    It is a phased plan with a finance case. No hardware pilot is reported.

  • Other providers

    The skill and the runbook are written for the Claude API.

  • A gateway

    This changes how prompts are written. Enforcing it at the network edge is what Tokenwise is for.