Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Cache the parts of the prompt that don't change so a long-running loop stops paying full price on every turn. Use when the system prompt, tool defs, or reference docs are stable across many turns.
.claude/skills/archive228-prompt-caching/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-10 | ✗→✓ | ▲ Improved | -24% | 0% |
| case-08 | ✗→✓ | ▲ Improved | -4% | 0% |
| case-14 | ✗→✓ | ▲ Improved | -16% | 0% |
| case-01 | ✓→✓ | = Same ✓ | -13% | 0% |
| case-02 | ✓→✓ | = Same ✓ | -15% | 0% |
Every turn of a Plan→Act→Verify loop resends the same system prompt, the same tool definitions, and (usually) the same reference docs. Without cache breakpoints you pay full input price on all of it, every turn. With them, cached reads cost ~10% of the write.
Cache from the top of the prompt down. The cache is prefix-matched — a break in the middle invalidates everything after it.
Everything past the last breakpoint is billed fresh every turn. That's fine — that's where the changing content goes.
Pick 5m unless you know turns are minutes apart.
If cost isn't dropping, log the cache-hit metric. Do not assume.
Cache write ≈ 1.25× normal input. Cache read ≈ 0.1× normal input. So a stable 20K-token prefix hit N times: N=1 costs more than no-cache; N=2 breaks even; N=10 costs ~15% of no-cache. Long loops win big; short chats lose.
Cache is the single biggest cost lever on a long-running agent. Set it once at the start of the loop, verify hits, forget it.
Other measured skills in the registry, with their headline benchmark lift.