Agent skill · Backend & API

prompt-caching

Prompt caching for Claude API to reduce latency by up to 85% and costs by up to 90%. Activate for cache_control, ephemeral caching, cache breakpoints, and performance optimization.

majiayu000github.com/majiayu000GitHub ↗
claude-codecan modify filesMIT
Install
npx skills add majiayu000/claude-skill-registry --skill prompt-caching-lobbi-docs-claude --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 6 KB
Bundled scripts: none
Allowed tools: -Bash-Read-Write-Edit-Glob-Grep
Requires: - llm-integration
Path: skills/ai-llm/prompt-caching-lobbi-docs-claude/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Prompt Caching Skill Leverage Anthropic's prompt caching to dramatically reduce latency and costs for repeated prompts. ## When to Use This Skill - RAG systems with large static documents - Multi-turn conversations with long instructions - Code analysis with large codebase context - Batch processing with shared prefixes - Document analysis and summarization ## Core Concepts ### Cache Control Placement ```python import anthropic client = anthropic.Anthropic() response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, system=[ { "type": "text", "text": "You are a helpful assistant with access to a large knowledge base...", "cache_control": {"type": "ephemeral"} # Cache this content } ], messages=[{"role": "user", "content": "What is...?"}] ) ``` ### Cache Hierarchy Cache breakpoints are checked in this order: 1. **Tools** - Tool definitions cached first 2. **System** - System prompts cached second 3. **Messages** - Conversation history cached last ### TTL Options | TTL | Write Cost | Read Cost | Use Case | |-----|-----------|-----------|----------| | 5 minutes (default) | 1.25x base | 0.1x base | Interactive sessions | | 1 hour | 2.0x base | 0.1x base | B

What's inside
Steps it walks through
  1. When to Use This Skill
  2. Core Concepts
  3. Cache Control Placement
  4. Cache Hierarchy
  5. TTL Options
  6. Cache Requirements
  7. Implementation Patterns
  8. Pattern 1: Single Breakpoint (Recommended)
  9. Pattern 2: Multi-Turn Conversation
  10. Pattern 3: RAG with Multiple Breakpoints
  11. Pattern 4: Batch Processing with 1-Hour TTL
  12. Performance Monitoring
  13. Check Cache Usage
  14. Cost Calculation
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
What does the prompt-caching skill do?

Prompt caching for Claude API to reduce latency by up to 85% and costs by up to 90%. Activate for cache_control, ephemeral caching, cache breakpoints, and performance optimization.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill prompt-caching-lobbi-docs-claude --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going