prompt-caching

Implements LLM caching strategies including Anthropic prompt caching, response caching, and cache augmented generation.

1|Updated May 10, 2026
One-click install
npx skills add https://github.com/Tgoldi/claude-skills --skill prompt-caching-tgoldi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prompt-caching
Source: https://github.com/Tgoldi/claude-skills/tree/main/prompt-caching
Command: npx skills add https://github.com/Tgoldi/claude-skills --skill prompt-caching-tgoldi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? LLM API costs and latency grow quickly when applications repeatedly send the same prompt prefixes or regenerate identical responses. This Skill provides caching patterns that reduce token spend and response times by caching at the prompt prefix, full response, and document levels. ## Core Features & Use Cases - Anthropic Prompt Caching: Structure prompts so repeated prefixes are cached by Claude's native prompt caching, cutting input token costs. - Response Caching: Cache full LLM responses for identical or semantically similar queries to avoid redundant generation. - Cache Augmented Generation (CAG): Pre-cache documents directly in the prompt as an alternative to runtime RAG retrieval. - Use Case: A support chatbot sends the same 10,000-token system prompt with every request. Applying prompt caching to that prefix reduces input costs dramatically while keeping per-user context dynamic. ## Quick Start Ask the AI to design a caching strategy for your LLM application that combines Anthropic prompt caching for the system prompt with response caching for repeated user queries.

Frequently Asked Questions about prompt-caching

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use Anthropic prompt caching to reduce LLM costs?

Anthropic prompt caching stores repeated prompt prefixes so subsequent requests reuse them at lower cost. Structure your prompt so static content like system instructions and documents comes first, with dynamic user input at the end.

What is cache augmented generation (CAG) vs RAG?

Cache augmented generation pre-loads documents directly into the cached prompt instead of retrieving them at query time like RAG. It works well when the document set is small and stable enough to fit in the context window.

When should I cache LLM responses instead of prompts?

Response caching fits workloads with identical or semantically similar queries, such as FAQ bots. Prompt prefix caching fits workloads where the context is shared but each query is unique.

Why does prompt caching not work on my requests?

Prompt caching fails when the prefix changes between requests, since the cache matches on exact prefixes. Keep all static content at the start of the prompt and avoid inserting timestamps or per-request values into the cached portion.

What are the risks of caching LLM responses?

Cached responses can become stale or incorrect as underlying data changes, and cache misses add latency overhead. Implement explicit cache invalidation policies and avoid caching outputs generated with high temperature.