Agent skill

Prompt Caching

by davila7 in davila7/claude-code-templates

Caching strategies for LLM prompts including Anthropic prompt caching, response caching, and CAG (Cache Augmented Generation) Use when: prompt caching, cache prompt, response cache, cag, cache…

MITAuto-check passedBackend & APIs

Install Prompt Caching

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

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install davila7/claude-code-templates prompt-caching --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/davila7/claude-code-templates.git skills-src && mkdir -p .claude/skills && cp -r skills-src/cli-tool/components/skills/ai-research/prompt-caching .claude/skills/prompt-caching && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
prompt-caching
GitHub stars
32k
Used in
5 other repos
Token cost
~452 tokens
SKILL.md length
180 words
Files
1
Skills in repo
478
Repo updated
First seen
Licence
MIT

At a glance

Caching strategies for LLM prompts including Anthropic prompt caching, response caching, and CAG (Cache Augmented Generation) Use when: prompt caching, cache prompt, response cache, cag, cache…

  • Works in 2 steps: Cache at the right level—prefix,… → K
  • : prompt caching
  • SKILL.md covers Capabilities, Patterns, Anti-Patterns and ⚠️ Sharp Edges, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Prompt Caching is an agent skill from davila7/claude-code-templates. Caching strategies for LLM prompts including Anthropic prompt caching, response caching, and CAG (Cache Augmented Generation) Use when: prompt caching, cache prompt, response cache, cag, cache augmented.

Its SKILL.md is about 450 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering LLM cost and token optimization and Caching. The repository describes itself as: CLI tool for configuring and monitoring Claude Code. The licence is MIT.

When your agent uses it

  • : prompt caching
  • Cache augmented

Example prompts

  • “/prompt-caching”

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

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

What it can do on your machine

Read from SKILL.md and the folder at commit 46b4d8b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Prompt Caching loads about 452 tokens when it runs. Until then it costs about 55 tokens; SKILL.md has 180 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~55
When it runs · the whole SKILL.md, loaded when a task matches
~452

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from davila7/claude-code-templates at commit 46b4d8b, republished under its MIT licence (© davila7). 180 words, ~452 tokens.

Download SKILL.mdSave it as .claude/skills/prompt-caching/SKILL.md (or your agent's skills folder).
name
prompt-caching
description
Caching strategies for LLM prompts including Anthropic prompt caching, response caching, and CAG (Cache Augmented Generation) Use when: prompt caching, cache prompt, response cache, cag, cache augmented.
source
vibeship-spawner-skills (Apache 2.0)

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

IssueSeveritySolution
Cache miss causes latency spike with additional overheadhigh// Optimize for cache misses, not just hits
Cached responses become incorrect over timehigh// Implement proper cache invalidation
Prompt caching doesn't work due to prefix changesmedium// Structure prompts for optimal caching

Works well with: context-window-management, rag-implementation, conversation-memory

© davila7, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in cli-tool/components/skills/ai-research/prompt-caching of davila7/claude-code-templates.

Open the folder on GitHubat commit 46b4d8b

Used in 5 other repositories

We found 8 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 5 other GitHub owners. This page covers the copy in davila7/claude-code-templates, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Prompt Caching next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Prompt Caching compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Prompt Caching this skilldavila7/claude-code-templates32k5 repos~452Automated safety check: PassMIT
Cache Credits AnalyzerTsinHzl/kiro2cc-proxy168—~1.1kAutomated safety check: PassMIT
LLM Cachingsickn33/agentic-awesome-skills47k2 repos~2.8kAutomated safety check: PassMIT
LLM Gatewaysickn33/agentic-awesome-skills47k1 repos~2.1kAutomated safety check: PassMIT
Continue Enable DefaultsOnlyTerp/prompt-cache-skills114—~977Automated safety check: PassCustom licence
Aider Prompt Caching DefaultOnlyTerp/prompt-cache-skills114—~638Automated safety check: PassCustom licence

Similar skills

  • Cache Credits Analyzer

    TsinHzl/kiro2cc-proxy

    分析 kiro2cc-proxy 访问日志,计算 Prompt Caching 节省的 credits。只要用户粘贴了含有"输入token 输出token 费用$ credits✓"格式的日志行,并询问节省了多少credits、缓存效率、cost分析等,立即使用此 skill。触发关键词:节省了多少credits、cache节省、分析日志、caching…

    168 GitHub stars~1.1k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • LLM Caching

    sickn33/agentic-awesome-skills

    Implement multi-layer LLM caching with exact match, semantic similarity, and provider-side prompt caching.

    47k GitHub starsUsed in 2 repos~2.8k tokens
    Backend & APIsAuto-check passed
  • LLM Gateway

    sickn33/agentic-awesome-skills

    Deploy an API gateway for LLM traffic with load balancing, rate limiting, key management, semantic caching, fallback routing, and cost tracking.

    47k GitHub starsUsed in 1 repo~2.1k tokens
    Backend & APIsAuto-check passed
  • Continue Enable Defaults

    OnlyTerp/prompt-cache-skills

    Continue's prompt caching is opt-in via config and off by default.

    114 GitHub stars~977 tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed
  • Aider Prompt Caching Default

    OnlyTerp/prompt-cache-skills

    Patch recipe that turns on Aider's --cache-prompts by default for models that support caching, with a verification procedure against the wire request.

    114 GitHub stars~638 tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed
  • Cline Prompt Cache Ladder Check

    OnlyTerp/prompt-cache-skills

    Verifies how Cline marks Anthropic prompt-cache breakpoints on the wire, then adds a tools breakpoint and tunes the cache TTL in its AI SDK code.

    114 GitHub stars~2k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed

More from davila7/claude-code-templates

All 478 skills in this repo
  • Perplexity Web Search

    davila7/claude-code-templates

    Runs web-grounded searches through Perplexity's Sonar models over OpenRouter for current events, recent literature and cited facts beyond the model's training cutoff.

    32k GitHub starsUsed in 11 repos~3.5k tokens
    Auto-check: notes
  • Neuropixels Data Analysis

    davila7/claude-code-templates

    Analyzes Neuropixels recordings from SpikeGLX or Open Ephys through preprocessing, drift correction, Kilosort4 spike sorting, quality metrics and curation.

    32k GitHub starsUsed in 9 repos~2.8k tokens
    Auto-check passed
  • Scientific Venue Templates

    davila7/claude-code-templates

    Supplies LaTeX templates and formatting rules for journals, conferences, posters, and grant proposals, then can check a draft against them.

    32k GitHub starsUsed in 9 repos~5.1k tokens
    Auto-check: notes
  • Brand Voice Content Creator

    davila7/claude-code-templates

    Analyzes a brand's existing writing to lock in a consistent voice, then builds SEO blog posts and platform-specific social content around it.

    32k GitHub starsUsed in 3 repos~1.9k tokens
    Auto-check passed
  • CAPA Officer

    davila7/claude-code-templates

    Guides corrective and preventive action (CAPA) work in a quality management system, from initiation and root cause analysis through effectiveness verification.

    32k GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed
  • Fda Consultant Specialist

    davila7/claude-code-templates

    Senior FDA consultant and specialist for medical device companies including HIPAA compliance and requirement management.

    32k GitHub starsUsed in 1 repo~2.7k tokens
    Auto-check passed

Questions about Prompt Caching

What does Prompt Caching do?

Caching strategies for LLM prompts including Anthropic prompt caching, response caching, and CAG (Cache Augmented Generation) Use when: prompt caching, cache prompt, response cache, cag, cache…. Prompt Caching is an agent skill from davila7/claude-code-templates. Caching strategies for LLM prompts including Anthropic prompt caching, response caching, and CAG (Cache Augmented Generation) Use when: prompt caching, cache prompt, response cache, cag, cache augmented.

When should I use Prompt Caching?

Prompt Caching fits situations like: : prompt caching; cache augmented.

How do I install Prompt Caching in Claude Code?

Run `npx skills add davila7/claude-code-templates --skill prompt-caching -a claude-code`. Or copy the skill folder (cli-tool/components/skills/ai-research/prompt-caching in davila7/claude-code-templates) into .claude/skills/prompt-caching in your project. Claude Code loads it when a task matches its description.

How do I install Prompt Caching in Codex?

Run `npx skills add davila7/claude-code-templates --skill prompt-caching -a codex`. Or copy the skill folder (cli-tool/components/skills/ai-research/prompt-caching in davila7/claude-code-templates) into .agents/skills/prompt-caching in your project. Codex loads it when a task matches its description.

Can I use Prompt Caching in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add davila7/claude-code-templates --skill prompt-caching -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/prompt-caching, .gemini/skills/prompt-caching, .github/skills/prompt-caching and .opencode/skills/prompt-caching in your project.

What does Prompt Caching need to run?

SKILL.md names no scripts, command-line tools or credentials: Prompt Caching is instructions for the agent only.

Does Prompt Caching access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Prompt Caching safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Prompt Caching use?

Prompt Caching is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Prompt Caching use?

About 452 tokens (SKILL.md is roughly 1.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Prompt Caching?

Skills that share tags, products or a category with Prompt Caching: Cache Credits Analyzer (TsinHzl/kiro2cc-proxy, 168 stars), LLM Caching (sickn33/agentic-awesome-skills, 47k stars), LLM Gateway (sickn33/agentic-awesome-skills, 47k stars) and Continue Enable Defaults (OnlyTerp/prompt-cache-skills, 114 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Prompt Caching?

davila7 (a GitHub user) maintains it in davila7/claude-code-templates, which has 32,483 GitHub stars. The repository holds 478 skills in this directory. The repository was last updated on October 9, 2026.

Source: davila7/claude-code-templates on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.