Rubric
Contents — domains, guide and mocks

Prompt reuse: caching, modules, Skills

CCAR-P 2.514 min read · checked 21 September 2026

Task statementImplement prompt reuse strategies (caching, modular prompts, Skills)

A reuse-friendly prompt, stable to volatile

Top: stable and cached → bottom: changes on every request

  1. Tool definitionschange rarely — first in the cache order
  2. Core system promptshared modules: role, policy, style
  3. Skill metadataname and description only, ~100 tokens each
  4. Reference materialmanuals, catalogues — daily or weekly
  5. Conversation so fargrows each turn; auto-cached as it goes
  6. This requestquestion, timestamp, user data — never cached
Order the prompt by how often each part changes. Everything above a cache breakpoint must be byte-identical across requests to be reused; volatile material belongs at the bottom.

Three kinds of reuse, three different problems

StrategyWhat is reusedWhat it savesTypical failure
Prompt cachingProcessed tokens of an identical prefixInput cost and time to first tokenCache never hits: a volatile value sits above the breakpoint
Modular promptsSource text of shared prompt sectionsAuthoring effort, drift, review and test timeCopy-pasted variants diverge across teams
Agent SkillsPackaged instructions, files and scriptsAlways-on context; repeated re-explainingVague description, so the Skill never triggers

They work together. A modular system prompt assembled in a fixed order produces a stable prefix, which is what caching needs. Skills keep specialised procedures out of that prefix until they are relevant, so the always-on part stays small (context budgeting is covered in 2.4).

Prompt caching: pay once for a stable prefix

Prompt caching stores the processed form of a prompt prefix so later requests that start with the same prefix skip that work. The prefix is built in a fixed order — tools, then system, then messages — and a change at one level invalidates that level and everything after it. Changing a tool definition therefore throws away the whole cache; adding an image affects only the messages.

There are two ways to turn it on. Automatic caching is a single top-level cache_control on the request; the breakpoint moves forward with a growing conversation, which the docs recommend for chat. Explicit breakpoints put cache_control on individual blocks — up to four per request — so sections that change at different rates are cached separately. Place each breakpoint on the last block that is identical across requests. The system looks back at most 20 blocks from a breakpoint for an earlier cache entry, so very long agent turns may need a second breakpoint.

SettingValue in current docsDesign implication
Default lifetime5 minutes, refreshed free on each hitSteady traffic keeps it warm on its own
Extended lifetime"ttl": "1h"For prefixes reused less often than every five minutes
Cache write price1.25× base input (5 min) · 2× (1 hour)A write pays back after about one or two hits
Cache read price0.1× base input on most modelsOpus 5: $0.50 instead of $5 per MTok
Minimum length512 tokens on Opus 5; 1,024 on Sonnet 5; 4,096 on Haiku 4.5Shorter prefixes are silently not cached
Rate limitsCache reads do not count toward input-tokens-per-minuteCaching also raises effective throughput
Two breakpoints for two change rates, then verify the hitpython
response = client.messages.create(
    model="claude-sonnet-5",
    max_tokens=1024,
    tools=TOOLS,                                  # stable: first in the prefix
    system=[
        {"type": "text", "text": REBOOKING_POLICY,    # changes quarterly
         "cache_control": {"type": "ephemeral", "ttl": "1h"}},
        {"type": "text", "text": TODAYS_DISRUPTIONS,  # changes daily
         "cache_control": {"type": "ephemeral"}},     # 5-minute default
    ],
    messages=[{"role": "user",
               "content": f"Now: {now}. Passenger: {query}"}],  # volatile, last
)

u = response.usage
total_in = u.cache_read_input_tokens + u.cache_creation_input_tokens + u.input_tokens
log.info("cache hit ratio %.0f%%", 100 * u.cache_read_input_tokens / total_in)

Two details in that code are easy to miss. Longer-lived entries must come before shorter ones, so the one-hour breakpoint sits above the five-minute one. And input_tokens in the response counts only the tokens after the last breakpoint; true input is the sum of the three fields. A dashboard that reads input_tokens alone will show a suspiciously cheap service.

Why the cache never hit

Cache miss on every requesttext

[system]
Current time: 09:41:07
Agent: Sam (id 5521)
You are the disruption desk
assistant for Aurora Air...
<rebooking_policy>
...40,000 tokens...
</rebooking_policy>
  ← cache_control here
[user]
Passenger question...

Stable prefix, volatile tailtext

[system]
You are the disruption desk
assistant for Aurora Air...
<rebooking_policy>
...40,000 tokens...
</rebooking_policy>
  ← cache_control here
[user]
Current time: 09:41:07
Agent: Sam (id 5521)
Passenger question...
On the left a timestamp at the top of the system prompt makes every prefix unique, so each request pays a cache write and gets no reads. On the right the same content is reordered: stable text first, breakpoint on the last stable block, volatile values last.

Modular prompts: write once, compose everywhere

A modular prompt is assembled from named, versioned sections — a brand-voice module, a data-handling policy, a refusal policy, an output-format module — each owned by one team and reviewed like code. Services compose the modules they need in a fixed order and add their own task section. This extends the template idea from 2.2 from one prompt to a fleet of them.

  • One source of truth. Legal changes the data-handling module once; every service picks it up on its next release instead of relying on ten teams to copy the edit.
  • Testable units. Each module change runs against every consuming service’s eval set before release, so a harmless-looking wording change cannot quietly break a downstream workflow.
  • Cache-friendly by construction. Assemble modules from most stable to least stable. Two services only share a cache entry if their prefixes are byte-identical and they run in the same workspace, so a module shared at the top of the prompt, with identical tools, is where cross-service cache reuse can happen.
  • Traceable. Log the module versions with each request, so an output can be traced to the exact prompt that produced it.

Agent Skills: expertise that loads on demand

An Agent Skill is a folder with a SKILL.md file — YAML frontmatter with a name and a description, then instructions — plus any reference files and scripts it needs. Anthropic’s engineering post compares writing one to putting together an onboarding guide for a new hire. The design idea is progressive disclosure: Claude sees only the metadata of every installed Skill, reads the instructions when a task matches, and opens further files or runs scripts only if the instructions call for them.

Progressive disclosure in a Skill

  1. Metadataname + description, ~100 tokens, always loaded
  2. Task matchesClaude judges from the description
  3. SKILL.md bodyinstructions, under 5K tokens
  4. Files and scriptsread or run only when needed
Only the first level is always in context. That is why an organisation can install many Skills without paying for all of them on every request — and why the description decides whether a Skill is ever used.

The authoring guide makes a few rules that carry straight into exam reasoning. The description must say what the Skill does and when to use it, in the third person, because it is injected into the system prompt and is the only thing Claude uses to choose. Keep the SKILL.md body under 500 lines and link reference files one level deep. Prefer bundled scripts for fragile, exact operations: a script runs without its code entering context, and gives the same result every time. And build evaluations first — measure Claude without the Skill, then write just enough to close the gap.

SurfaceHow Skills are suppliedNotes an architect needs
Claude APIcontainer.skills list with type (anthropic or custom), skill_id, version; needs the code execution toolUp to 20 per request; custom Skills are private to the workspace; pin a version in production, latest in development
Claude CodeFolders in ~/.claude/skills/, .claude/skills/, plugins or managed settingsdisable-model-invocation: true for side-effect workflows such as deploys; context: fork runs one in a subagent
Claude appsPre-built document Skills plus uploaded custom SkillsEnabled per account; see the drift note below on syncing
SKILL.md for a regulatory-submission formatter (excerpt)text
---
name: formatting-regulatory-submissions
description: Formats clinical study summaries to our
  submission template and validates section numbering.
  Use when drafting or checking regulatory submission
  documents, CTD modules or study summaries.
---
# Formatting regulatory submissions

1. Read TEMPLATE.md for the required section order.
2. Draft the document following that order.
3. Run: python scripts/validate_sections.py draft.docx
4. Fix every error the script reports, then re-run.

For terminology rules, see GLOSSARY.md.

Which reuse strategy fits?

What are you trying to reuse?
  • Same long prefix, many calls
    Prompt cachingstable first, breakpoint last
  • Same text, many services
    Modular promptsversioned modules, fixed order
  • Procedures needed sometimes
    Agent Skillmetadata always, body on demand
  • Work that can wait
    Batch + cachingdiscounts stack
The strategies answer different questions, so a mature system usually uses all three.

Traps the wrong answers are built from

Tempting but wrongDo this instead
Putting timestamps, user IDs or request data at the top of a cached promptKeep volatile values after the last breakpoint, in the user turn.
Reading input_tokens alone to judge cache savingsSum cache reads, cache writes and input_tokens, and track the hit ratio.
Toggling tools per request in a cached deploymentKeep tool definitions stable; changing them invalidates the entire cache.
Copy-pasting shared policy text into each service’s promptCompose versioned modules in a fixed order and test changes against every consumer.
Loading every procedure into an ever-growing system promptPackage specialist procedures as Skills with a clear what-and-when description.

You should now be able to

  • Lay out prompts from stable to volatile and place cache breakpoints on the last stable block.
  • Choose between automatic caching, explicit breakpoints and the one-hour lifetime.
  • Verify caching with cache_read_input_tokens and cache_creation_input_tokens and compute true input.
  • Design modular, versioned prompt sections that one team owns and many services reuse.
  • Explain Skill progressive disclosure and write a description that triggers reliably.
  • Deploy Skills per surface, with version pinning and security and retention review.

Practice questions

Original questions written for this lesson, in the exam’s style. Answer first, then open the reasoning — every option is explained, including why the wrong ones are tempting.

  1. Question 1

    A bank’s internal policy assistant sends a 60,000-token policy manual with every request. Caching was enabled, but the bill did not change. The system prompt begins with “Today is {date}, user {employee_id}” followed by the manual, with the breakpoint at the end of the system prompt.

    What is the most effective fix?

    1. ASwitch to the one-hour cache lifetime so entries last longer.
    2. BMove the date and employee ID below the manual, into the user turn.
    3. CAdd three more breakpoints inside the manual for finer granularity.
    4. DShorten the manual below the minimum cacheable length.
    Show answer and reasoning
    1. AIncorrect. The prefix is different on every request, so a longer lifetime still yields no hits.
    2. BCorrect. With volatile values after the breakpoint, the manual becomes an identical prefix that can be read from cache.
    3. CIncorrect. Every breakpoint still sits after the changing first line, so none of them can match.
    4. DIncorrect. That disables caching altogether rather than making it work.
  2. Question 2

    An architect is reviewing a customer-service platform where eight teams each keep their own copy of the company’s complaints-handling policy inside their system prompts. After a regulatory change, two teams’ assistants still gave old guidance a month later.

    Which two changes best address this? (Select 2.)

    1. AExtract the policy into one versioned module that every service composes at build time.
    2. BRun each consuming service’s eval set whenever the shared module changes.
    3. CEnable prompt caching so each team’s copy is stored centrally.
    4. DAsk each team to review their prompt monthly for regulatory updates.
    5. EMove the policy into the user turn so it is easier to edit.
    Show answer and reasoning
    1. ACorrect. A single source of truth removes the copies that drifted.
    2. BCorrect. Modules are only safe to share if every consumer is tested against the change before release.
    3. CIncorrect. Caching reuses processed tokens, not source text; it does nothing to keep copies consistent.
    4. DIncorrect. It relies on eight manual processes, which is the failure that already happened.
    5. EIncorrect. Its position in the prompt does not solve duplication across teams.
  3. Question 3

    An organisation has installed 30 custom Skills, and a stakeholder worries that this will add every Skill’s instructions to every request. What is the most accurate response?

    1. ACorrect: every Skill’s full instructions load at startup, so remove most of them.
    2. BNo context is used at all until a user names a Skill explicitly.
    3. COnly names and descriptions are always loaded; bodies and files load on demand.
    4. DSkills are loaded into the cache, so their token count does not matter.
    Show answer and reasoning
    1. AIncorrect. Only the metadata loads at startup; the full instructions load when a task matches.
    2. BIncorrect. Metadata is always present; that is how Claude decides when a Skill applies without being told.
    3. CCorrect. Progressive disclosure keeps the always-on cost to roughly a hundred tokens per Skill.
    4. DIncorrect. Caching reduces price, not context usage, and it is not how Skills limit their footprint.
  4. Question 4

    A finance team’s custom Skill, used through the API, builds quarterly board packs. A colleague uploaded a new version with a reworded template, and the next morning’s production packs changed format without warning.

    What should the architect change?

    1. AMerge the Skill’s contents into the system prompt so it cannot change.
    2. BRename the Skill after each change so Claude notices the new version.
    3. CTell Claude in the system prompt to always use the previous template format.
    4. DPin a specific Skill version in production and promote new versions after evals pass.
    Show answer and reasoning
    1. AIncorrect. That gives up progressive disclosure and simply moves the change-control problem somewhere else.
    2. BIncorrect. A name change does not control which version production uses.
    3. CIncorrect. A prompt instruction fighting the Skill’s own instructions is unreliable and hides the real issue.
    4. DCorrect. The API guide recommends pinned versions for production and latest only for development.

Sources

Drafted with AI assistance and checked against the sources above; expert review is in progress. Spotted an error? Tell us and it gets fixed, dated and listed on how this is written.