Skip to main content
skill

prompt-caching · davila7 — Claude Code skill: prompt and response caching

This skill covers prompt-prefix, response, and CAG caching for LLM workflows. Use it when repeated prompts or reusable answers make caching worth planning.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --skill ai-research/prompt-caching
Open on GitHub

What prompt-caching does

The skill maps out three caching targets: repeated prompt prefixes, complete LLM responses, and documents placed in a prompt through the CAG pattern. It also covers KV caching, semantic-similarity matches, and invalidation rules for stale entries.

For Claude, it describes native prompt caching; for repeated or closely related queries, it covers response caching. The material also addresses prompt structure, cache misses, and the extra latency they can introduce. High temperature makes response caching a poor fit, while missing invalidation means stored answers can become wrong over time.

What it helps with

  • choose a caching level for an LLM workflow
  • keep repeated prompt prefixes in cache
  • reuse answers for identical requests
  • preload documents with the CAG pattern
  • invalidate stale cached responses

Example prompts for the agent

  • Choose a caching strategy for a prompt with a repeated prefix in Claude.
  • Compare response caching with CAG for documents reused across many requests.
  • Review this design for cache invalidation and miss handling.

How to install prompt-caching

1claude-code-templates

npx claude-code-templates@latest --skill ai-research/prompt-caching

2Skills CLI (Vercel)

npx skills add davila7/claude-code-templates --skill prompt-caching -a claude-code

3Manually: put the files in place

~/.claude/skills/prompt-caching/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/prompt-caching/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about prompt-caching

How do I install prompt-caching in Claude Code?

Run npx claude-code-templates@latest --skill ai-research/prompt-caching.

What does prompt-caching do?

It helps plan caching for prompt prefixes, LLM responses, and documents used through CAG. It also covers KV caching and invalidation.

Why can prompt caching fail to deliver cache hits?

Changing the prompt prefix can prevent a match. Response caching is also a weaker fit when temperature is high.

Similar skills

All skills for AI and ML →

prompt-caching by other authors comes first.

From the same set495

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor