Agent skill · AI & Agents

prompt-caching

Caching strategies for LLM prompts including Anthropic prompt caching, response caching, and CAG (Cache Augmented Generation)

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill prompt-caching --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 13 KB
Bundled scripts: none
Path: skills/ai-llm/prompt-caching/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 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

What's inside
Steps it walks through
  1. Capabilities
  2. Prerequisites
  3. Scope
  4. Ecosystem
  5. Primarytools
  6. Patterns
  7. Anthropic Prompt Caching
  8. Response Caching
  9. Cache Augmented Generation (CAG)
  10. Sharp Edges
  11. Cache miss causes latency spike with additional overhead
  12. Cached responses become incorrect over time
  13. Prompt caching doesn't work due to prefix changes
  14. Validation Checks
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
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.

Keep going