Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

prompt-caching-strategy

Skill by affaan-m

Optimizes LLM prompt caching hit rate to reduce API costs and latency. It helps teams with repeated API requests that share instructions, tools or reference material across OpenAI, Claude and Gemini.

  • Score 91
  • 313k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install prompt-caching-strategy

Built from the published package, never by AI.

git clone --depth 1 https://github.com/affaan-m/ECC /tmp/ECC && mkdir -p ~/.claude/skills && cp -r /tmp/ECC/skills/prompt-caching-strategy ~/.claude/skills/prompt-caching-strategy

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install prompt-caching-strategy in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill helps an assistant arrange reusable prompt content so providers can reuse cached input. It recommends keeping instructions, tool schemas and examples in a stable prefix, and placing changing questions, timestamps and retrieved results after that prefix. It also covers user and workspace boundaries, so cache handles and accounting keys stay scoped to approved content.

The skill includes a provider reference table for OpenAI, Claude and Gemini usage counters, and a cost comparison calculator that normalizes token categories into baseline and actual cost. It also gives a verification workflow for measuring cache hit rates from real traffic when that is authorized. The source says its worked examples use hypothetical prices. It is aimed at developers and teams who make repeated LLM API calls and want to lower input cost or latency.

Written from the project's SKILL.md and checked against it.

What it can do

  • Stable prefix designArranges reusable instructions, tool schemas and examples ahead of changing content to improve cache reuse.
  • Provider usage mappingLists the usage counters to record for OpenAI, Claude and Gemini caching.
  • Cache cost calculatorCompares baseline and cached cost from normalized token counts and per-million-token rates.
  • Access boundary guidanceScopes cache handles and accounting keys to approved users, workspaces and content revisions.
  • Measurement workflowSteps for measuring token hit rate, request hit rate and realized savings from matched requests.

What you need

  • Node.js to run the offline calculator test
  • The ECC repository to run the test file
  • Provider API access, only if measuring real traffic

Try asking

  • Restructure my prompt so the tool definitions and instructions can be cached.
  • Calculate my expected cache savings from these token counts and rates.
  • Review my Claude API requests and suggest a prefix layout for better cache reuse.

Good to know

  • Runtime cache hits and savings are unmeasured unless real provider traffic is measured.
  • Example prices and counts are hypothetical, not provider quotes.
  • Caching does not reduce context-window use.
  • A cache key is not an authorization gate or sandbox.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: skills/prompt-caching-strategy/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md10 KB

Alternatives to prompt-caching-strategy

All alternatives →

Compare with agent-reproduce-align, google_contacts or m06-error-handling

prompt-caching-strategy: common questions

Does this skill guarantee lower API costs?

No. The source says savings depend on the model, platform, cache eligibility, writes, retention, reuse and output volume. Runtime hits and savings are unmeasured in the examples.

Which providers does it cover?

The source covers OpenAI, Claude and Gemini, and says to check each provider's current documentation for requirements and rates.

When should I not use this skill?

The source says not to use it to optimize a single prompt's quality, which is the job of prompt-optimizer, or for general caching infrastructure.

How do I install prompt-caching-strategy?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is prompt-caching-strategy free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is prompt-caching-strategy safe to use?

It scores 91 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to prompt-caching-strategy?

Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.

prompt-caching-strategy Install

Add to stack

Loading.