2.5 Prompt Reuse: Caching, Modular Prompts, and Skills
What You Need to Know
Section titled “What You Need to Know”Prompt reuse covers text that Claude receives on many requests. Three mechanisms answer three different reuse questions. A prefix is the opening part of a prompt. Prompt caching stops a repeated prefix from costing full price each time. Modular prompts stop ten features from each keeping its own copy of the same policy text. Such copies become different over time. Skills give occasional access to a long, detailed procedure without paying for it on every request.
This lesson uses one made-up example throughout: an optician that uses Claude in ten features, including a booking assistant and a recall-letter writer. Each booking request sends one long policy prompt again, and each feature has its own pasted copy of that prompt. Occasionally a customer asks about contact-lens aftercare, which needs a long procedure.
Prefix Mechanics: Stability First
Section titled “Prefix Mechanics: Stability First”Cache prefixes are created in the order tools, system, messages. Each level depends on the levels before it, so a change at any level invalidates that level and everything after it. This is the reason for the rule “front-load stability”. Put the static system prompt, policy documents and few-shot examples first, and dynamic per-request content last. A timestamp early in the prompt changes on every request, so it silently stops the entire cache from working. The optician puts the current time last, beside the customer’s message.
How caching behaves in operation matters more than its parameters. A breakpoint marks where the cacheable prefix ends. You can set it explicitly, or it can be managed automatically. Cache entries are short-lived by default, and a longer duration is an option. Every use refreshes the entry at no additional cost, so steady traffic keeps a cache warm (not expired) indefinitely. Each model has a minimum cacheable prefix length, and a shorter prompt runs uncached without an error. A near-zero hit rate means dynamic content is invalidating the prefix, or the prefix is too short to cache.
Cache Economics
Section titled “Cache Economics”The cache economics follow a fixed pattern.
- Cache writes cost a premium over base input.
- With the longer duration, the write premium is higher.
- Cache reads get a large discount on every reused token.
Anthropic’s pricing page states the break-even point: caching recovers its cost within the first read or two, depending on the duration that you choose. The multipliers are quick-reference material. The judgement that the multipliers require is not quick-reference material.
At high volume, the read discount is the largest effect. Caching then cuts both per-request cost and time to first token, because cached prefix tokens are not processed again. The TTL is the lifetime of a cache entry. For sporadic traffic outside the TTL, the write premium can be more than the savings. The optician’s occasional aftercare query is one such case. “Cache everything” is not universally correct. Do the arithmetic.
Caching is none of these.
- Persistence: the TTL limits how long entries last.
- Freeing window space: cached tokens still occupy the context window (objective 2.4).
- A way to improve quality.
Modular Prompts
Section titled “Modular Prompts”A modular prompt is built from versioned sections (role, policy, task instructions, format contract, examples). For each feature, the sections are assembled from a shared library. One reviewed change to the shared policy section reaches every feature. Ten hand-copied prompts become different over time and get fixed nine times. The optician edits its policy section once for all ten features.
A modular prompt is also a cache design. Shared stable sections form common prefixes across features. Their position before the feature-specific sections decides how much of the prefix caches. This applies the template discipline of objective 2.2 to a whole organisation. Prompts are treated as a managed asset with ownership, review and eval coverage.
Skills and Progressive Disclosure
Section titled “Skills and Progressive Disclosure”A Skill is a folder with a SKILL.md file. The YAML frontmatter of that file contains a name and a description with maximum lengths. An instruction body follows. Reference files and executable scripts can be bundled too. The description is also the trigger, so it must say what the Skill does and when to use it.
Progressive disclosure saves tokens in three documented levels.
- Metadata only: a very small, fixed number of tokens per Skill loads into the system prompt at startup. Thus, many Skills can be installed without a meaningful context cost.
- The SKILL.md body loads only when the task triggers the Skill.
- Bundled resources cost nothing until Claude reads them. Scripts execute, and only their output enters context.
With a monolithic system prompt (one prompt that holds every capability’s instructions), you pay for every capability’s instructions on every request, used or not. In the booking prompt, the aftercare procedure would add cost to every request. As a Skill, the procedure costs only metadata until a customer needs it.
Custom Skills do not sync across surfaces (the API, claude.ai and Claude Code).
- API Skills are workspace-wide and require the code execution tool.
- claude.ai Skills are per-user.
- Claude Code Skills are filesystem-based.
Choosing the Mechanism
Section titled “Choosing the Mechanism”- Standing per-request policy belongs in the cached system prompt, because every request reuses it.
- On-demand expertise and multi-file procedures belong in Skills, because most requests never need them.
- Per-request data belongs in messages, because it changes every time and must come after the cached prefix.
So the optician caches its booking policy, makes aftercare a Skill and sends each customer’s question in messages.
In the exam
Section titled “In the exam”Questions describe one situation and include the other two mechanisms, plus a model change, as wrong options. The guide’s own sample tests putting stable content first, the cost-and-latency pairing, and when caching does not save money. Questions also test the placement rule and the surface caveat for custom Skills.
Where the Figures Live
Section titled “Where the Figures Live”The Domain 2 quick reference holds current cache figures and Skill field limits.
Exam Traps
Section titled “Exam Traps”Practice Scenario
Section titled “Practice Scenario”A claims-processing API serves 40,000 requests per day. Every request sends a 12,000-token system prompt that opens with a short claim record, including a request timestamp, followed by policy rules and few-shot examples that never change. Finance flags input spend, and p95 latency misses the SLA. Answer quality must stay as it is. What should the architect do?
- A. Enable prompt caching on the request as currently structured
- B. Reorder so all static content precedes the dynamic claim record, then cache the static prefix
- C. Cut the few-shot examples to shrink the prompt
- D. Downsize to a smaller model to cut cost and latency
Answer & explanation
Correct: B
- A — The early timestamp invalidates the prefix from that point on every request. Without reordering, the cache writes repeatedly and reads almost nothing.
- B — Static-first ordering makes the 12k-token prefix cacheable. At 40k requests a day, the steep cached-read discount and the refreshed-on-use entry cut recurring input spend on the prefix to a fraction. They also reduce time-to-first-token, with quality untouched.
- C — The question excludes this: answer quality must stay as it is, and this trades it for a saving the cache delivers with quality untouched. The examples hold format and boundary behaviour, and removing them risks regressions caching would never cause.
- D — The question excludes this: a smaller model puts answer quality at risk to solve a prefix-reuse problem. Right-sizing needs eval evidence (objective 2.1), and the stated symptoms point at the repeated 12k-token prefix, not the model tier.
Sources
Section titled “Sources”- Prompt caching — Anthropic
- Pricing — Anthropic
- Agent Skills overview — Anthropic
- Claude Certified Architect Professional Exam Guide (v1.0) — Domain 2 — Anthropic