agentsclimarketplace

Prompt caching

Skill jcdavis131/cursor-agent-skills/skills/prompt-caching

42 agent-discipline skills for Cursor, distilled by watching an autonomous terminal coding agent (Claude Code + Fable 5). Includes the derivation method.

Install
npx -y skills add jcdavis131/cursor-agent-skills --skill prompt-caching

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • 26 days oldThe repository was created 26 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Designs and wires Anthropic prompt caching for Messages API calls — automatic vs explicit breakpoints, prefix ordering, TTL, minimum token thresholds, and cache-invalidation traps. Use when building Claude API integrations, agent loops, multi-turn chats, large tool/system prompts, or when the user mentions prompt caching, cache_control, or cache_read_input_tokens.

SKILL.md

1.8 KB, as published. Nobody here has run it

Prompt Caching (Anthropic Messages API)

Caching reuses stable prompt prefixes; writes cost 25% more (5m TTL), reads cost 10% of base input.

Docs: https://platform.claude.com/docs/en/build-with-claude/prompt-caching

Decision

ModeWhen
AutomaticMulti-turn chat; growing history should cache itself
ExplicitStatic prefix + varying suffix (timestamp, user message)
BothLong system/tools + growing conversation

The one rule

Place cache_control on the last block whose prefix is identical across requests you want to share. Breakpoint on a per-request suffix (timestamp, session ID) → miss every time.

Structure

Order: tools → system → messages. Large stable content first; varying content last.

Verify

Check response.usage: cache_read_input_tokens, cache_creation_input_tokens, input_tokens. Both cache fields zero → not cached (too short, prefix changed, or first request).

Monorepo targets

  • worker: cache tools + system; automatic on messages.
  • Experiment loops: breakpoint before varying experiment config.
  • SME fanout: shared charter cached; per-lane charter after breakpoint.

Do not cache: under minimum tokens, one-shot calls, prefixes that change every request.

API shapes, TTL, invalidation, checklist, model minimums

reference.md

Pair with

  • cost-transparency · deterministic-core-llm-judgment · agent-guardrails

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.