This tackles LLM caching at three levels: Anthropic's native prompt caching for repeated prefixes, full response caching for identical queries, and CAG (Cache Augmented Generation) where you pre-cache documents in the prompt instead of doing RAG retrieval. The claim is 90% cost reduction, which tracks if you're hitting the same prompt structures repeatedly. Watch out for cache misses adding latency overhead and stale cached responses becoming wrong over time. The key insight here is that LLM caching isn't like HTTP caching because you need to think about prompt prefix structure, temperature settings, and semantic similarity rather than exact matches.

skills.sh installs
437
GitHub stars
33.2K
last updated
Aug 21, 2026

Install

$ npx -y skills add davila7/claude-code-templates --skill prompt-caching --agent claude-code

Installs into .claude/skills of the current project.

Files

Prompt Caching

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:

  1. Cache at the right level—prefix, response, or both
  2. K

Capabilities

  • prompt-cache
  • response-cache
  • kv-cache
  • cag-patterns
  • cache-invalidation

Patterns

Anthropic Prompt Caching

Use Claude's native prompt caching for repeated prefixes

Response Caching

Cache full LLM responses for identical or similar queries

Cache Augmented Generation (CAG)

Pre-cache documents in prompt instead of RAG retrieval

Anti-Patterns

❌ Caching with High Temperature

❌ No Cache Invalidation

❌ Caching Everything

⚠️ Sharp Edges

Sponsors

Details

Repository
github.com/davila7/claude-code-templates
Category
AI & Agent Building
First seen
Jun 3, 2026

More from davila7/claude-code-templates

All 618
1cobosteven avatarcobo-agentic-wallet-sandboxcobosteven/cobo-agent-wallet-manualCreate and manage agentic wallets with Cobo. Use for autonomous onchain operations via the caw CLI: token transfers, contract calls, pact creation and approval,420skills.sh installs
2tencentcloudbase avatarcloudbase-agent-tstencentcloudbase/skillsBuild and deploy AI agents with Cloudbase Agent (TypeScript), a TypeScript SDK implementing the AG-UI protocol. Use when: (1) deploying agent servers with @clou420skills.sh installs
3jezweb avatarclaude-agent-sdkjezweb/claude-skillsBuild autonomous AI agents with Claude Agent SDK. Structured outputs guarantee JSON schema validation, with plugins system and hooks for event-driven workflows.415skills.sh installs
4davila7 avatarai-productdavila7/claude-code-templatesEvery product will be AI-powered. The question is whether you'll build it right or ship a demo that falls apart in production. This skill covers LLM integration399skills.sh installs
5davila7 avatarrag-engineerdavila7/claude-code-templatesExpert in building Retrieval-Augmented Generation systems. Masters embedding models, vector databases, chunking strategies, and retrieval optimization for LLM a392skills.sh installs
6davila7 avatarai-wrapper-productdavila7/claude-code-templatesExpert in building products that wrap AI APIs (OpenAI, Anthropic, etc.) into focused tools people will pay for. Not just 'ChatGPT but different' - products that379skills.sh installs