Prompt caching
42 agent-discipline skills for Cursor, distilled by watching an autonomous terminal coding agent (Claude Code + Fable 5). Includes the derivation method.
npx -y skills add jcdavis131/cursor-agent-skills --skill prompt-cachingAssembled 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
| Mode | When |
|---|---|
| Automatic | Multi-turn chat; growing history should cache itself |
| Explicit | Static prefix + varying suffix (timestamp, user message) |
| Both | Long 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
Pair with
cost-transparency·deterministic-core-llm-judgment·agent-guardrails