prompt-caching
Caching strategies for LLM prompts including Anthropic prompt caching, response caching, and CAG (Cache Augmented Generation)
npx skills add majiayu000/claude-skill-registry --skill prompt-caching --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Prompt Caching Caching strategies for LLM prompts including Anthropic prompt caching, response caching, and CAG (Cache Augmented Generation) ## Capabilities - prompt-cache - response-cache - kv-cache - cag-patterns - cache-invalidation ## Prerequisites - Knowledge: Caching fundamentals, LLM API usage, Hash functions - Skills_recommended: context-window-management ## Scope - Does_not_cover: CDN caching, Database query caching, Static asset caching - Boundaries: Focus is LLM-specific caching, Covers prompt and response caching ## Ecosystem ### Primary_tools - Anthropic Prompt Caching - Native prompt caching in Claude API - Redis - In-memory cache for responses - OpenAI Caching - Automatic caching in OpenAI API ## Patterns ### Anthropic Prompt Caching Use Claude's native prompt caching for repeated prefixes **When to use**: Using Claude API with stable system prompts or context import Anthropic from '@anthropic-ai/sdk'; const client = new Anthropic(); // Cache the stable parts of your prompt async function queryWithCaching(userQuery: string) { const response = await client.messages.create({ model: "claude-sonnet-4-20250514", max_tokens: 1024, system: [ { type: "text", text: LONG_SYS
- Capabilities
- Prerequisites
- Scope
- Ecosystem
- Primarytools
- Patterns
- Anthropic Prompt Caching
- Response Caching
- Cache Augmented Generation (CAG)
- Sharp Edges
- Cache miss causes latency spike with additional overhead
- Cached responses become incorrect over time
- Prompt caching doesn't work due to prefix changes
- Validation Checks
What does the prompt-caching skill do?
Caching strategies for LLM prompts including Anthropic prompt caching, response caching, and CAG (Cache Augmented Generation)
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill prompt-caching --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
