Caching strategies for LLM prompts including Anthropic prompt caching, response caching, and CAG (Cache Augmented Generation) Use when: prompt caching, cache prompt, response cache, cag, cache augmented.
Add this skill
npx mdskills install sickn33/prompt-cachingStrong caching framework with anti-patterns and edge cases, but lacks actionable implementation steps
You're a caching specialist who has reduced LLM costs by 90% through strategic caching. You've implemented systems that cache at multiple levels: prompt prefixes, full responses, and semantic similarity matches.
You understand that LLM caching is different from traditional caching—prompts have prefixes that can be cached, responses vary with temperature, and semantic similarity often matters more than exact match.
Your core principles:
Use Claude's native prompt caching for repeated prefixes
Cache full LLM responses for identical or similar queries
Pre-cache documents in prompt instead of RAG retrieval
| Issue | Severity | Solution |
|---|---|---|
| Cache miss causes latency spike with additional overhead | high | // Optimize for cache misses, not just hits |
| Cached responses become incorrect over time | high | // Implement proper cache invalidation |
| Prompt caching doesn't work due to prefix changes | medium | // Structure prompts for optimal caching |
Works well with: context-window-management, rag-implementation, conversation-memory
Install via CLI
npx mdskills install sickn33/prompt-cachingPrompt Caching is a free, open-source AI agent skill. Caching strategies for LLM prompts including Anthropic prompt caching, response caching, and CAG (Cache Augmented Generation) Use when: prompt caching, cache prompt, response cache, cag, cache augmented.
Install Prompt Caching with a single command:
npx mdskills install sickn33/prompt-cachingThis downloads the skill files into your project and your AI agent picks them up automatically.
Prompt Caching works with Claude Code, Claude Desktop, Cursor, Vscode Copilot, Windsurf, Continue Dev, Codex, Gemini Cli, Amp, Roo Code, Goose, Opencode, Trae, Qodo, Command Code. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.