prompt-caching

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

1|Updated Aug 7, 2025
One-click install
npx skills add https://github.com/zzafergok/arktos --skill prompt-caching-zzafergok
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: prompt-caching
Source: https://github.com/zzafergok/arktos/tree/main/.agent/skills/prompt-caching
Command: npx skills add https://github.com/zzafergok/arktos --skill prompt-caching-zzafergok

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? LLM API costs and latency grow quickly when applications repeatedly send the same prompt prefixes or answer identical queries. This Skill provides caching strategies 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 caching, cutting input token costs. - Response Caching: Cache full LLM responses for identical or semantically similar queries to avoid redundant API calls. - 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 can reduce costs by up to 90% while improving time-to-first-token. ## Quick Start Ask the AI to design a caching strategy for your LLM application that caches the system prompt prefix and 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 the cached prefix instead of reprocessing it. Structure prompts with stable content first and variable content last, and verify current provider documentation for minimum cacheable sizes and billing.

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. CAG works well when the document set fits in the context window and changes infrequently, eliminating retrieval latency.

How do I cache LLM responses for repeated queries?▼

Response caching stores full LLM outputs keyed by the query, returning the cached result for identical or semantically similar requests. Semantic similarity matching often matters more than exact match, and cached entries need invalidation rules to avoid stale answers.

Why does prompt caching not work on my requests?▼

Prompt caching fails when the prefix changes between requests, since caches match on exact prefixes. Keep static content like system instructions at the start of the prompt and place dynamic user content at the end.

When should I not cache LLM responses?▼

Avoid caching responses generated with high temperature, since outputs vary intentionally, and avoid caching time-sensitive answers without invalidation. Caching everything indiscriminately leads to stale or incorrect responses over time.