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

Skill by henryalouf

Explains caching strategies for LLM prompts, including Anthropic prompt caching, response caching with Redis, and Cache Augmented Generation. Aimed at developers building apps on the Claude API.

  • Score 70
  • 199 stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install prompt-caching

Built from the published package, never by AI.

git clone --depth 1 https://github.com/henryalouf/ruflow /tmp/ruflow && mkdir -p ~/.claude/skills && cp -r /tmp/ruflow/.agents/skills/prompt-caching ~/.claude/skills/prompt-caching

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

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

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

About

This skill gives an assistant guidance and code patterns for caching in LLM applications. It covers Anthropic native prompt caching for stable system prompts and knowledge base text, exact-match and semantic response caching using Redis, and Cache Augmented Generation, which places a stable document set directly in the prompt instead of using retrieval.

It also lists common failure modes: cache misses adding latency, stale responses from long TTLs, and prefix changes such as timestamps breaking Anthropic cache hits. It includes a CAG versus RAG decision table. The source is licensed Apache 2.0 and is aimed at developers working with LLM APIs who already know caching basics.

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

What it can do

  • prompt-cacheCaches stable system prompts and context with Anthropic's native prompt caching.
  • response-cacheStores full LLM responses in Redis under a SHA-256 hash of the prompt, with a one hour default TTL.
  • Semantic response cachingReturns a cached response when an embedding similarity score is above 0.95.
  • cag-patternsPre-loads a stable document set into the prompt instead of running retrieval.
  • cache-invalidationDescribes version-based, content-hash and event-based cache invalidation.

What you need

  • Anthropic API access (Claude API)
  • Redis, used in the response caching examples
  • Knowledge of LLM API usage and caching basics

Try asking

  • Show me how to add Anthropic prompt caching to my Claude API calls.
  • Write a Redis response cache with a one hour TTL for my LLM queries.
  • Help me decide between CAG and RAG for my document corpus.

Good to know

  • Does not cover CDN caching, database query caching or static asset caching.
  • Anthropic prompt caching requires an exact prefix match.
  • Response caching examples only cache low-temperature requests (temperature 0.5 or lower).

Security check

A

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

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

Alternatives to prompt-caching

All alternatives →

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

prompt-caching: common questions

Does this cover CDN or static asset caching?

No. The source says it excludes CDN caching, database query caching and static asset caching, and focuses on LLM prompt and response caching.

Why might Anthropic prompt caching not hit?

The source says Anthropic caching requires an exact prefix match, so timestamps or other dynamic content in the cached prefix cause misses.

When is CAG better than RAG?

The source's decision table favors CAG when the corpus is under about 100K tokens, updates are infrequent, and latency is critical.

How do I install prompt-caching?

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

Is prompt-caching free?

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

Is prompt-caching safe to use?

It scores 70 of 100. Grades: maintenance B, licence A, quality B. 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?

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

prompt-caching Install

Add to stack

Loading.