prompt-caching

prompt-caching is a skill for Claude Code from ArieGoldkin/claude-forge. It costs 37 tokens per session (1,745 once invoked), scanned A, original, MIT.

A provider-specific way to reuse repeated parts of prompts sent to Claude and OpenAI models. It places cache points around stable content such as system instructions and examples.

In plain words
What is it for?
Use it when optimizing requests with repeated system prompts or few-shot examples, with short or extended cache lifetimes where supported.
Why use it?
It can reduce processing costs and repeated work when many requests share the same prompt beginning. The changing user content remains outside the cached section.

Skill for Claude Code

Written for Claude Code: paths in frontmatter. Also seen: positional $N argument; mentions Claude Code.

Part of the atk plugin — 16 skills, 25 commands, 1 agent, 1 hook shipped together

Good fit Use it when optimizing requests with repeated system prompts or few-shot examples, with short or extended cache lifetimes where supported.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ariegoldkin/claude-forge/prompt-caching
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ArieGoldkin/claude-forge --skill prompt-caching
Clone the repo
git clone --depth 1 https://github.com/ArieGoldkin/claude-forge

Made for: Claude Code.

Or install atk, the plugin that ships this one along with the rest of its 16 skills, 25 commands, 1 agent, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for prompt-caching

README.md
[![agentmods](https://agentmods.dev/badge/skills/ariegoldkin/claude-forge/prompt-caching/github.svg)](https://agentmods.dev/skills/ariegoldkin/claude-forge/prompt-caching)
Your own site
<a href="https://agentmods.dev/skills/ariegoldkin/claude-forge/prompt-caching"><img src="https://agentmods.dev/badge/skills/ariegoldkin/claude-forge/prompt-caching/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for prompt-caching

Your own site · 80×15
<a href="https://agentmods.dev/skills/ariegoldkin/claude-forge/prompt-caching"><img src="https://agentmods.dev/badge/skills/ariegoldkin/claude-forge/prompt-caching.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,745 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00037 $0.01745
Opus 5 $0.00018 $0.00873
Sonnet 5 $0.00007 $0.00349
Haiku 4.5 $0.00004 $0.00175

Measured 8d ago against content hash 7e44b849fb4b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

prompt-caching scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (templates/prompt-cache-wrapper.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/ai-toolkit/skills/prompt-caching/SKILL.md · 217 lines

How it starts

The opening of the file, as written. The whole thing — 217 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Prompt Caching

Cache LLM prompt prefixes for 90% token savings.

Supported Models (2026)

Provider Models
Claude Opus 4.1, Opus 4, Sonnet 4.5, Sonnet 4, Sonnet 3.7, Haiku 4.5, Haiku 3.5, Haiku 3
OpenAI gpt-4o, gpt-4o-mini, o1, o1-mini (automatic caching)

Claude Prompt Caching

def build_cached_messages(
    system_prompt: str,
    few_shot_examples: str | None,
    user_content: str,
    use_extended_cache: bool = False
) -> list[dict]:
    """Build messages with cache breakpoints.

    Cache structure (processing order: tools → system → messages):
    1. System prompt (cached)
    2. Few-shot examples (cached)
    ─────── CACHE BREAKPOINT ───────
    3. User content (NOT cached)
    """
    # TTL: "5m" (default, 1.25x write cost) or "1h" (extended, 2x write cost)
    ttl = "1h" if use_extended_cache else "5m"

    content_parts = []

    # Breakpoint 1: System prompt
    content_parts.append({
        "type": "text",
        "text": system_prompt,
        "cache_control": {"type": "ephemeral", "ttl": ttl}
    })

    # Breakpoint 2: Few-shot examples (up to 4 breakpoints allowed)
    if few_shot_examples:
        content_parts.append({
            "type": "text",
            "text": few_shot_examples,
            "cache_control": {"type": "ephemeral", "ttl": ttl}
        })

    # Dynamic content (NOT cached)
    content_parts.append({
        "type": "text",
        "text": user_content
    })

    return [{"role": "user", "content": content_parts}]

Cache Pricing (2026)

┌─────────────────────────────────────────────────────────────┐
│  Cache Cost Multipliers (relative to base input price)      │
├─────────────────────────────────────────────────────────────┤
│  5-minute cache write:  1.25x base input price              │
│  1-hour cache write:    2.00x base input price              │
│  Cache read:            0.10x base input price (90% off!)   │
└─────────────────────────────────────────────────────────────┘

Example: Claude Sonnet 4 @ $3/MTok input

Without Prompt Caching:
System prompt:     2,000 tokens @ $3/MTok  = $0.006
Few-shot examples: 5,000 tokens @ $3/MTok  = $0.015
User content:     10,000 tokens @ $3/MTok  = $0.030
───────────────────────────────────────────────────
Total:            17,000 tokens            = $0.051

With 5m Caching (first request = cache write):
Cached prefix:     7,000 tokens @ $3.75/MTok = $0.02625 (1.25x)
User content:     10,000 tokens @ $3/MTok    = $0.03000
Total first req:                             = $0.05625

With 5m Caching (subsequent = cache read):
Cached prefix:     7,000 tokens @ $0.30/MTok = $0.0021 (0.1x)
User content:     10,000 tokens @ $3/MTok    = $0.0300
Total cached req:                            = $0.0321

Savings: 37% per cached request, break-even after 2 requests

Read the full file on GitHub · 217 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 217 lines · 37 tokens per session scan A 7e44b849fb4b

Subscribe to this mod's changes

prompt-caching is a skill published in the GitHub repository ArieGoldkin/claude-forge (6 stars, last pushed 1mo ago), licensed MIT. It adds 37 tokens to every session and 1,745 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

prompt-writer

Use when creating, reviewing, or revising prompts, system prompts, developer instructions, agent policies, prompt templates, eval prompts, or skill files consumed by LLMs and AI agents. Routes to OpenAI, Anthropic/Claude, or generic prompt-writing guidance based on the target model/provider.

SNIKO/agent-skills · 64 tokens

prompt-engineer

Use this skill when the user explicitly asks to create, write, improve, or optimize a prompt for use with an AI. Trigger on phrases like "write me a prompt", "improve this prompt", "create a system prompt", "how do I ask ChatGPT/Claude to...", or "quero um prompt para...". Do NOT trigger for direct task requests where…

ericgandrade/claude-superskills · 89 tokens

agent-orchestration-improve-agent

Systematic improvement of existing agents through performance analysis, prompt engineering, and continuous iteration.

lingxling/awesome-skills-cn · 25 tokens

copilot-sdk

Build agentic applications with GitHub Copilot SDK. Use when embedding AI agents in apps, creating custom tools, implementing streaming responses, managing sessions, connecting to MCP servers, or creating custom agents. Triggers on Copilot SDK, GitHub SDK, agentic app, embed Copilot, programmable agent, MCP server…

FluxonLab/Skillry · 72 tokens

prompt-engineering-patterns

Master advanced prompt engineering techniques to maximize LLM performance, reliability, and controllability in production. Use when optimizing prompts, improving LLM outputs, or designing production prompt templates.

FluxonLab/Skillry · 41 tokens

ai-prompt-engineering-safety-review

Comprehensive AI prompt engineering safety review and improvement prompt. Analyzes prompts for safety, bias, security vulnerabilities, and effectiveness while providing detailed improvement recommendations with extensive frameworks, testing methodologies, and educational content.

FluxonLab/Skillry · 50 tokens