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 softspark/ai-toolkit --skill prompt-caching-patternsgit clone --depth 1 https://github.com/softspark/ai-toolkitWrote 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/softspark/ai-toolkit/prompt-caching-patterns)<a href="https://agentmods.dev/skills/softspark/ai-toolkit/prompt-caching-patterns"><img src="https://agentmods.dev/badge/skills/softspark/ai-toolkit/prompt-caching-patterns/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/softspark/ai-toolkit/prompt-caching-patterns"><img src="https://agentmods.dev/badge/skills/softspark/ai-toolkit/prompt-caching-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00043 | $0.01000 |
| Opus 5.5 | $0.00017 | $0.00400 |
| Sonnet 5.5 | $0.00009 | $0.00200 |
| Haiku 4.5 | $0.00004 | $0.00100 |
Grade A, and why
prompt-caching-patterns 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 14d 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 — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Prompt Caching Patterns
Cache repeated prefixes when reuse offsets write costs. Cache eligibility and pricing depend on the model and platform; a short system prompt is not cached merely because it repeats.
Dated cache reference (2026-10-08)
| Model | Minimum eligible prefix | Cache read / base input price |
|---|---|---|
| Claude Opus 5.5 | 512 tokens | 5% |
| Claude Fable 5.1 | 512 tokens | 2.5% |
| Claude Sonnet 5.5 | 512 tokens | 5% |
| Claude Haiku 5.5 | 512 tokens | 10% |
For the Claude API, a five-minute write costs 1.25 times base input and a one-hour write costs 2 times base input. Recheck current pricing before budgeting; provider-specific billing and model availability can differ.
Prefix design
Cache order is tools → system → messages, regardless of the order of request
keys. An explicit breakpoint includes the marked block and everything before it.
Keep dynamic material after the stable prefix.
[ tool definitions ] breakpoint 1
[ reusable system instructions ] breakpoint 2
[ reference documents ] breakpoint 3
[ stable conversation prefix ] breakpoint 4
[ current variable content ]
There are at most four breakpoints. Top-level automatic cache_control moves a
breakpoint to the last eligible block and consumes one slot. Explicit markers
give control over a static prefix.
Explicit caching example
The caller supplies the approved model, text and output limit. Marking a prefix below its model's minimum silently produces no cache entry.
def cached_answer(client, model, policy, document, question, max_tokens):
return client.messages.create(
model=model,
max_tokens=max_tokens,
system=[{
"type": "text",
"text": policy,
"cache_control": {"type": "ephemeral"},
}],
messages=[{
"role": "user",
"content": [
{"type": "text", "text": document,
"cache_control": {"type": "ephemeral"}},
{"type": "text", "text": question},
],
}],
)
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.
- 14d ago Changed 4c9d288c59f6
- 29d ago Changed · +6 lines 6414970dc975
- 1mo ago First seen · 115 lines · 43 tokens per session scan A 9c9caf4f3149
prompt-caching-patterns is a skill published in the GitHub repository softspark/ai-toolkit (180 stars, last pushed 8d ago), licensed Apache-2.0. It adds 43 tokens to every session and 1,000 once invoked, about $0.0002 per session on Opus 5.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-03.
Other skills, from other repositories
remove-ai-slops
Removes AI-generated code smells from branch changes or an explicit file list behind regression tests. Use when the user asks to clean up, deslop, or remove AI-slop patterns from recent changes.
semgrep-rule-variant-creator
Creates language variants of existing Semgrep rules. Use when porting a Semgrep rule to specified target languages. Takes an existing rule and target languages as input, produces independent rule+test directories for each language.
ln-55-test-suite-auditor
Audits existing tests for risk coverage, reliable oracles and maintenance value; does not edit tests.
ln-32-test-strategy-planner
Plans risk-based test portfolios and acceptance evidence; does not write or execute tests.
ln-42-dependency-upgrader
Upgrades dependencies in reversible batches with version-specific compatibility and regression checks.
verify-implementation
A workflow that runs a project’s verification skills to produce a report on coding patterns, architecture rules, and project conventions. It is intended for work after implementation, before a pull request, or during code review.