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.
npx skills add orlando-japan/claude-code-setting --skill prompt-cachinggit clone --depth 1 https://github.com/orlando-japan/claude-code-settingWrote 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.
[](https://agentmods.dev/skills/orlando-japan/claude-code-setting/prompt-caching)<a href="https://agentmods.dev/skills/orlando-japan/claude-code-setting/prompt-caching"><img src="https://agentmods.dev/badge/skills/orlando-japan/claude-code-setting/prompt-caching/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.
<a href="https://agentmods.dev/skills/orlando-japan/claude-code-setting/prompt-caching"><img src="https://agentmods.dev/badge/skills/orlando-japan/claude-code-setting/prompt-caching.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00030 | $0.01139 |
| Opus 5 | $0.00015 | $0.00570 |
| Sonnet 5 | $0.00006 | $0.00228 |
| Haiku 4.5 | $0.00003 | $0.00114 |
Grade A, and why
prompt-caching 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 9d ago.
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.
How it starts
The opening of the file, as written. The whole thing — 133 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Prompt caching (Claude API)
Claude's prompt caching reduces repeated-prefix cost by up to 90% and can cut latency significantly. It also has a 5-minute TTL on the default cache tier — if you're not hitting within 5 minutes, the cache entry is gone. Design for this.
When caching helps
Caching helps when:
- You make many requests with overlapping prefixes (system prompt, tools definitions, long documents).
- Requests are frequent enough to hit within the TTL.
- The cacheable content is ≥1024 tokens (Sonnet/Opus) or ≥2048 (Haiku) — smaller caches don't pay off.
Caching doesn't help when:
- Each request is one-shot with a totally unique prompt.
- The prompt content varies above the cache boundary.
- Traffic is too sparse to hit the TTL window.
How it works (at a high level)
You mark the end of cacheable content with a cache_control breakpoint:
messages = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "<long document or system instructions>",
"cache_control": {"type": "ephemeral"}
},
{
"type": "text",
"text": "<the per-request query>"
}
]
}
]
Everything up to and including the marked block is cached. Anything after is the variable part.
On a cache hit, you pay a reduced rate for the cached tokens and normal rate for new tokens. On a miss, the first request incurs a cache-write cost (higher than normal), and subsequent requests within 5 minutes hit.
Design rules
1. Order content by stability
Put the most stable content first, least stable last.
Good:
[stable system prompt]
[stable tool definitions]
[stable shared context]
<cache breakpoint>
[variable per-request query]
Bad:
[variable per-request query]
[stable system prompt]
<cache breakpoint>
The variable part at the top breaks the cache on every call.
2. Use up to 4 breakpoints
Claude supports multiple cache breakpoints. Use them to cache at multiple layers:
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.
- 9d ago First seen · 133 lines · 30 tokens per session scan A 70e7a53a2876
prompt-caching is a skill published in the GitHub repository orlando-japan/claude-code-setting (2 stars, last pushed 3mo ago), licensed MIT. It adds 30 tokens to every session and 1,139 once invoked, about $0.0002 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-08-31.
Other skills, from other repositories
prompt-caching
Use prompt caching correctly across Anthropic, OpenAI, Bedrock, and Gemini to cut cost and latency on hot paths. Use when the user is building a production LLM app and mentions prompt caching, cache hits, cache key, cache TTL, ephemeral cache, system-prompt caching, or asks "why is my cache hit rate low?" / "should I…
guidance
Constrain LLM output with grammars; guarantee valid JSON.
outlines
Outlines: structured JSON/regex/Pydantic LLM generation.
instructor
Structured LLM outputs validated with Pydantic.
dspy
DSPy: declarative LM programs, auto-optimize prompts, RAG.
claude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude…