Claude

IntuitionLabs is now a member of the Claude Partner Network – AI training and upskilling with Claude for pharma and biotech. Book a call.

IntuitionLabs
Back to Articles
IntuitionLabs

claude prompt caching · cache miss diagnostics

Claude Prompt Caching Cache Miss Diagnostics for Pharma AI

December 5, 2026
30 min read

Claude prompt caching cache miss diagnostics in 2026: reason codes, cache_read_input_tokens, cost arithmetic from $0.009 to $0.153 per call, ZDR limits and change control for pharma AI agents.

Claude Prompt Caching Cache Miss Diagnostics for Pharma AI
Summary
  1. 01Claude API cache diagnostics left beta on 23 September 2026. The beta header is no longer required, and responses always include the diagnostics field.
  2. 02Diagnostics reports the first structural divergence between requests. Log cache_read_input_tokens alongside it to see whether tokens were actually read from the cache.
  3. 03Matching request prefixes can still miss because of expiry, concurrent requests or a prefix below the model's minimum cacheable length.
  4. 04Log the diagnostics result, usage counters, elapsed time and your own prefix hashes. Measure hit rate as cache-read tokens divided by cache reads, cache writes and uncached input combined.
  5. 05In the article's list-price example, rewriting the prefix on every call costs 24.4% more than running without caching. Actual savings depend on how often the cache is read.
  6. 06For pharmaceutical AI, put diagnostics-driven prompt changes under change control and run a separate scientific-output regression check.
01

Executive Summary

Anthropic moved cache diagnostics for the Claude API out of beta on 23 September 2026, and the release removed the need for the cache-diagnosis-2026-04-07 beta header ([1]). The feature compares a request with the previous one and reports where the prompt prefix first diverged: model, system prompt, tools or message history ([2]). It reports request structure only, independent of whether the cache actually hit ([3]). Whether a cache entry was actually read must still be taken from usage.cache_read_input_tokens. This distinction is the core of any audit design.

The diagnostics output has three shapes: null, a pending {"cache_miss_reason": null} that the documentation says to treat as inconclusive, or a typed reason. The typed reasons are model_changed, system_changed, tools_changed, messages_changed, previous_message_not_found and unavailable. Only the earliest divergence is reported, so fixes must be applied in order ([4]). Two of the reasons are not evidence of a request change at all: previous_message_not_found is explicitly "not evidence that your request changed" ([5]), and unavailable means no comparison was produced. Fingerprints hold only hashes and token-count estimates, never raw prompt content ([6]), but the documentation gives no numeric retention period, only "a short period" ([7]).

Cost evidence is strong in direction but variable in size. An arXiv preprint across three providers measured API cost reductions of 41 to 80 percent and time-to-first-token gains of 13 to 31 percent in agent sessions ([8]). The same study found that naive full-context caching can increase latency ([9]). Under the current Claude price list, the illustrative calculation in this report shows a 60,000-token cached prefix on Sonnet 5.5 costing about $0.009 per call on a hit, against $0.123 uncached and $0.153 on a cache write. A prefix that writes on every call is therefore about 24 percent more expensive than not caching (the report's own arithmetic from the list-price multipliers on [10]). No savings figure is promised here.

For pharmaceutical and biotech teams, diagnostics is an engineering and FinOps signal, not a scientific validation signal. Caching does not change model outputs ([11]), yet inference endpoints can still return different completions for identical prompts under load ([12]). The fixes that diagnostics suggests (moving a timestamp out of the system prompt, fixing tool order, holding the model constant) change the bytes sent to the model, so they belong under change control and a scientific-output regression check ([13]). Diagnostics is eligible for zero data retention (ZDR) on a qualified basis ([14]), which does not remove the need to confirm the organization's own retention terms.

5 minutes

Default cache lifetime, refreshed at no extra cost on each use

4,096

Minimum cacheable tokens for Opus 4.6, Opus 4.5 and Haiku 4.5

24.4%

Illustrative Sonnet and Opus input cost increase when every call writes and none reads, compared with no caching

41 to 80 percent

API cost reductions measured in agent sessions by an arXiv preprint covering three providers

02

Introduction and Background

Long-running agents in pharmaceutical and biotech settings tend to resend very large, nearly constant prefixes: a fixed system prompt, deterministic tool schemas for retrieval and calculation, and a protocol, standard operating procedure (SOP) or regulatory dossier excerpt. For this reason prompt caching is attractive. It is also fragile. Anthropic's own documentation warns that a reordered tool, an interpolated timestamp or an edit to an earlier message can silently invalidate the cache. A hit requires fully identical prompt segments up to the cached block. An arXiv empirical study of 120 caching-related pull requests across 10 open-source agent systems concluded that most mis-integrations fail silently without observable runtime errors ([15]).

Before September 2026 the only signal of such a failure was a cache_read_input_tokens value falling to zero, which says that a miss happened but not why. Diagnostics adds the "why" at the level of request structure. This report is an adjacent analysis: it examines the documented behavior of a third-party product and does not sell or compare products. IntuitionLabs, an AI acceleration consultancy for life sciences, helps pharmaceutical, biotech and medtech teams adopt Claude, ChatGPT and Microsoft Copilot one department at a time, with GxP governance, computer system validation (CSV) and quality controls. That perspective informs the qualification section below. Factual claims about Claude, regulation and costs cite Anthropic, regulator or other third-party sources, and the description of IntuitionLabs is the publisher's own.

The report answers the questions practitioners search for: why a Claude prompt cache is not hitting, what the miss reasons mean, how cache_read_input_tokens is read next to diagnostics, what invalidates a cache, the minimum cacheable length, hit-rate monitoring, cost effects and limits for regulated use. Three questions are kept apart throughout:

  • Structural diagnosis: did the request prefix change between two turns?
  • Cache use and cost: did the platform actually read a cache entry, and what did the call cost?
  • Scientific and data-governance questions: is the output valid, reproducible and handled under the right retention terms? Diagnostics answers none of these.

Claude prices and documentation statements reflect the published pages as of 5 December 2026. The pricing page carries no as-of date, so re-check it before budgeting.

03

Key Changes: What Became Stable and What It Covers

Release timeline from beta to stable

Cache diagnostics launched in beta on 13 May 2026: a request passed diagnostics.previous_message_id, and the API reported a cache_miss_reason explaining where the cached prefix diverged from the previous turn ([16]). The official Python SDK changelog records the beta support entry as "Add support for cache diagnostics beta" ([17]). A practitioner write-up from May 2026 tested the beta with the Vercel AI SDK and flagged observations in Langfuse when the reason ended in _changed, while noting that diagnostics checks the request and not whether the cache hit ([18]). That article was accurate for its date but describes a beta header that is no longer needed.

Three release-note entries in September 2026 changed behavior in ways that matter for logging:

  • 9 September: a request that sends only the beta header is still accepted, but no fingerprint is stored. Callers must include the diagnostics object on every turn.
  • 18 September: a response to a request that sends the beta header always includes the diagnostics field, which is null when the request had no diagnostics object; previously the field was omitted.
  • 23 September: diagnostics is out of beta on the Claude API and the header is no longer required. Responses now always include the diagnostics field, and requests that still send the old header work as before.

The practical consequence is a schema rule for log pipelines: after 23 September a missing diagnostics key should be treated as a pipeline defect, because the key is now always present.

Platform and API coverage

As of 5 December 2026, the documentation's availability section lists the Claude API and Claude Models on Google Cloud (Anthropic managed), with the same availability requirements on all supported platforms. The applicable endpoint is /v1/messages with the diagnostics parameter, and Managed Agents is listed as not supported. Teams that reach Claude through other cloud channels should not assume diagnostics exists there. The Amazon Bedrock caching documentation, as retrieved, tells users to check the cache usage fields in the model response to determine whether a hit occurred ([19]), and Google Cloud's Vertex AI page scopes Claude caches to the Google Cloud project ([20]). Neither page, as retrieved, describes a diagnostics feature, so on those channels usage-field monitoring remains the only documented signal.

Opt-in, fingerprint lifecycle and the workspace boundary

Opt-in is the presence of the diagnostics object on the request; the API stores a fingerprint only for requests that include it and stores nothing for requests that omit the object. The first turn passes "previous_message_id": null, and each later turn passes the id of the previous response. The documentation advises including the object on every turn and keeping consecutive turns close together in time.

Three properties of the fingerprint define what an audit can and cannot learn:

  • Content: fingerprints contain only hashes and token-count estimates, never raw prompt content.
  • Scope and retention: they are retained for a limited time and scoped to the organization and workspace. Lookups expire after a short period, so comparisons should run between closely spaced requests. No numeric duration is published, so any retention figure quoted elsewhere should be treated as unverified.
  • Workspace rule: the previous request must have run in the same organization and workspace ([21]). On the Claude API the check is to compare the anthropic-workspace-id response header on the two responses; Anthropic added that header to the Claude API and it carries the wrkspc_-prefixed workspace identifier.

The workspace rule has a second consequence. Prompt caches are themselves isolated per workspace on the Claude API, so two agents deployed in different workspaces never share a cache even when their prompts are byte-identical. Splitting a validated agent across workspaces for access-control reasons can therefore lower hit rates by design.

Response shape and streaming

In a streaming call the whole diagnostics object arrives on the message_start event. A response of {"cache_miss_reason": null} means the comparison had not finished when the response was serialized, and the documentation tells callers to treat it as inconclusive and check the next turn. Diagnostics is best effort: it never blocks or fails a request. Typed reasons for the four *_changed cases carry a token-count estimate of the affected span; the numerical value should be used as a magnitude indicator for prioritization and not as a billing figure.

F.01
2026 Claude cache diagnostics release timeline
  1. 13 MayBeta launch

    Requests could reference the previous turn and receive a reason explaining where the cached prefix diverged.

  2. 9 SeptemberFingerprint opt-in clarified

    The beta header alone was accepted, but storing a fingerprint required the diagnostics object on the request.

  3. 18 SeptemberResponse field standardized in beta

    For requests with the beta header, responses always included the diagnostics field. It was null when the request omitted the diagnostics object.

  4. 23 SeptemberStable release

    The beta header became optional and responses began to include the diagnostics field on every request.

“

A cache hit therefore says nothing about scientific correctness.

04

Reading the Reason Codes Against Cache Usage

The reason matrix

Table 1 below pairs each documented reason with the cause most likely in a pharmaceutical retrieval-augmented generation (RAG) agent, the field to log, and a corrective test. The "likely cause" column is an engineering inference built on the documented meaning; it is not a vendor statement.

T.01
ReasonDocumented meaningLikely cause in a protocol or RAG agentLog fieldCorrective test
model_changedThe model differs from the previous request, for example from a router, A/B test or fallbackA cost router sends easy questions to a smaller model mid-sessionmodel on each request and responsePin one model per session; replay the session and confirm the reason disappears
system_changedThe system parameter differs, typically from a timestamp, request ID or other per-request valueRun date, user name or study identifier interpolated into the system promptHash of the system blockMove the variable into the new user message; compare system hashes across ten turns
tools_changedTools were added, removed or reordered, or schema JSON was serialized non-deterministicallyTool list built from an unordered set; per-user tool lists; schema keys emitted in random orderHash of canonical tools arraySort tools and schema keys; assert hash equality in a unit test
messages_changedAn earlier message was altered, reordered or removed rather than appended to; history should be treated as append-onlyTruncation, summarization or re-serialization of earlier turns or retrieved passagesHash of messages up to the last breakpointResend history verbatim; fail the build if a prior message hash changes
previous_message_not_foundNo stored fingerprint for the supplied id; not evidence that the request changedPrevious call lacked the diagnostics object, ran in another workspace, or too much time passedprevious_message_id, workspace id headerCheck that the diagnostics object is sent on every turn; use own hashes for this turn
unavailableNo diagnostic information for this requestA prompt-affecting parameter such as tool_choice or thinking changed, or the conversation is very longHash of request parameters other than the prefixHold prompt-affecting parameters constant
null (response diagnostics value)No divergence found, first turn, or no opt-inHealthy, or a miss that is not structuralusage fieldsRead cache_read_input_tokens next (Table 2)

The table makes one design point visible: only four of the six typed reasons point at a request change. The other two, previous_message_not_found and unavailable, report the absence of a comparison, and treating them as "the request changed" would send engineers to fix the wrong thing. Because the response reports only the earliest divergence, a system_changed result can hide a tools_changed problem behind it. Correct the reported item and re-run before concluding that the prompt is stable.

A further limit matters for audit: diagnostics says which section diverged, not what changed, because it stores hashes and not content. A team that needs to show an inspector or internal quality reviewer what changed has to keep its own canonical hashes of the system block, tool array and message prefix. Such hashes are an application-layer design choice, not a Claude feature.

Pairing the reason with cache_read_input_tokens

The documentation's own matrix combines the diagnostics result with cache read tokens to separate a request change from an expiry. Table 2 restates it with the practical follow-up for each combination.

T.03
Diagnostics resultcache_read_input_tokensInterpretationNext action
nullhighThe cache hitNone; record the hit rate
nulllow or zeroRequests match, but there was no cache entry to read: it expired or the prompt is below the minimum cacheable lengthCheck time between turns, minimum length, concurrency and workspace; consider the 1-hour TTL
A *_changed typelow or zeroThe request changed; fix the cause named by the typeApply the corrective test from Table 1
A *_changed typehighRare: a late change occurred but an earlier cache_control breakpoint still hitLow priority; fix at the next release
previous_message_not_found or unavailableanyNo comparison; read usage aloneUse own prefix hashes to decide whether the request changed

The interpretive rule is that diagnostics and usage answer different questions and must be logged together. A null diagnostics result with zero reads is the case most often misread: the structure is intact, so editing the prompt will not help, and the investigation turns to time, size and concurrency. The first turn of a conversation is also expected to show zero reads, since the cache is being written, not read.

What invalidates a cache

Anthropic documents a hierarchy of tools, then system, then messages, in which a change at one level invalidates that level and all later ones. Practitioners often ask for a list of invalidation causes; the documented ones are:

  • Tool definition edits: modifying names, descriptions or parameters invalidates the entire cache.
  • Toggling web search or citations: this modifies the system prompt.
  • Adding or removing images: this affects the message blocks anywhere in the prompt.
  • Thinking configuration changes: changing it always invalidates message blocks.
  • Randomized JSON key order: some languages randomize key order during JSON conversion, breaking caches.
  • Model switches: the cache is per model. Anthropic's Claude Code team notes that switching to a smaller model late in a long Opus conversation can cost more than letting the larger model answer, because the cache must be rebuilt ([22]).
  • Compaction with a different prompt: a summarization call that uses a different system prompt and no tools shares no prefix with the main conversation ([23]).

Common ordering causes of this kind include a timestamp placed in the static system prompt and non-deterministic tool ordering, and any change anywhere in the prefix invalidates everything after it.

Why identical requests can still miss

When diagnostics returns null and reads are still low, the documented non-structural causes are the following.

  • Time to live (TTL): the default lifetime is 5 minutes, refreshed at no extra cost on each use, and it is measured from the start of the request, so generation time counts against it.
  • Concurrency: a cache entry only becomes available after the first response starts, so parallel fan-out of the same prefix can all miss.
  • Minimum length: prompts below the model's minimum are processed without caching and no error is returned ([24]). The minimum is 512 tokens for the newest models such as Fable 5.2, 1,024 for a middle group that includes Sonnet 5 and Sonnet 4.6, 2,048 for Claude Mythos Preview and Opus 4.7, and 4,096 for Opus 4.6, Opus 4.5 and Haiku 4.5. A practitioner article summarizes the spread as model-dependent, varying by a factor of eight ([25]). Cross-provider documentation shows the same range: Bedrock lists minimums of 512 to 4,096 tokens per checkpoint ([26]).
  • Lookback window: each breakpoint checks at most 20 positions, and a request may carry up to four breakpoints.
  • Breakpoint placement: a breakpoint on a block that changes every request means paying for a fresh write each time and never getting a read.
  • Intermediaries: a gateway that strips cache markers while returning success causes the whole history to bill as uncached input every turn ([27]).
F.02
How to read diagnostics alongside cache usage
Null diagnostics result
  • High cache-read tokens indicate a hit.
  • With low or zero reads, check the interval between turns, minimum cacheable length, concurrency and workspace.
Typed change reason
  • With low or zero reads, start by fixing the change named in the reason.
  • High reads can still occur if an earlier cache breakpoint hit before a later part of the prefix changed.

A null diagnostics result can also mean first turn or no opt-in. With previous_message_not_found or unavailable, use cache usage to assess reads and your own prefix hashes to check for changes.

05

Implementation Considerations and Process Changes

Logging fields and the hit-rate formula

A usable audit record per request needs both structural and usage evidence. The Claude usage object separates three input counters: input_tokens counts only tokens after the last breakpoint and does not represent all input ([28]), cache_creation_input_tokens counts tokens written to the cache, and cache_read_input_tokens counts reads. Total input is the sum of the three. Claude Code's documentation defines its hit ratio on the same basis, with a denominator that counts cache reads, cache writes and uncached input ([29]). The hit-rate formula for an agent fleet is therefore:

  • Hit rate = cache_read_input_tokens divided by (cache_read_input_tokens + cache_creation_input_tokens + input_tokens).
  • Rebuild signal: if creation stays high turn after turn, something is changing in the prefix ([30]).
  • Miss threshold: Claude Code counts a miss only when more than 5 percent and at least 2,000 tokens of what could have been read were not read ([31]). Fleet dashboards can adopt a similar threshold to avoid alerting on trivial differences.

Recommended fields per call, kept free of prompt content:

  • Identifiers: request id, previous_message_id, workspace id header, agent run id and step number.
  • Configuration: model, TTL choice, breakpoint count, thinking and tool_choice settings.
  • Own fingerprints: SHA-256 of the canonical tools array, system block and pre-breakpoint messages (application-layer, not a vendor feature).
  • Usage: input_tokens, cache_creation_input_tokens, cache_read_input_tokens, output_tokens.
  • Diagnostics: the full diagnostics value, including the pending and null forms.
  • Timing: elapsed seconds since the previous call, to separate expiry from change.

A practitioner recommendation consistent with this design is to log creation and read counters separately, broken out by model, TTL and workflow ([32]). Anthropic's documentation recommends regularly analyzing hit rates. Anthropic's Claude Code engineering post advises monitoring cache hit rate the way uptime is monitored ([33]).

For organization-level reporting the Admin usage endpoints can supply token counts by type. The legacy usage API measures uncached input, cached input, cache creation and output tokens, with data typically appearing about 30 minutes after a request completes, so it suits cost reconciliation and not per-turn alerting. The newer analytics endpoint returns token counts by type. Per-turn diagnosis belongs in the application log.

Illustrative request pair and log record (Hypothetical Example)

The following hypothetical agent answers questions over a clinical protocol. It carries a fixed system prompt, deterministic tool schemas for retrieval and unit conversion, and a 60,000-token protocol and SOP excerpt, with about 1,500 new tokens per turn. All values are invented to show the diagnostic logic and are not measurements.

Turn 1 opts in with a null previous id:

{
  "model": "claude-sonnet-5-5",
  "diagnostics": {"previous_message_id": null},
  "system": "FIXED_SYSTEM_PROMPT_V3",
  "tools": ["retrieve_passage", "convert_units"],
  "messages": ["...protocol excerpt...", "Question 1"]
}

Turn 2 appends one message and points at the first response. Suppose a developer also adds the current date to the system prompt. The hypothetical response would read:

{
  "id": "msg_B",
  "usage": {"input_tokens": 1500, "cache_creation_input_tokens": 60000,
            "cache_read_input_tokens": 0, "output_tokens": 400},
  "diagnostics": {"cache_miss_reason":
      {"type": "system_changed", "cache_missed_input_tokens": 60000}}
}

The application's own log shows a changed system hash, 41 seconds since the previous call and zero reads, so this is a structural miss and not an expiry. The corrective action is to move the date into the user message and then re-run the pair. If instead system_sha256 were unchanged, diagnostics were null and reads were zero after 12 minutes, the entry would have expired under the 5-minute default and the choice between a keep-alive pattern and the 1-hour TTL would become a cost decision.

Qualification, change control and what diagnostics does not prove

Three layers must be kept apart in a validation file.

Layer 1: structural diagnosis. This is an engineering control. It can be documented as a monitoring feature with defined alert thresholds, and its own output is a log. Its limitations are best-effort operation and the absence of content in the fingerprint.

Layer 2: cache use and cost. This is a FinOps control. Caching does not change model outputs: the documentation states that results are identical to what would be obtained if prompt caching were not used. A cache hit therefore says nothing about scientific correctness.

Layer 3: output quality and reproducibility. This is where qualification effort belongs. Inference endpoints can be nondeterministic even when the cache is irrelevant: one analysis traces the main cause to load-dependent batch composition ([12]), and in its test of 1,000 temperature-zero completions the first divergence appeared at the 103rd token ([34]). A cache hit or miss should therefore never be used to explain or excuse a difference between two scientific outputs.

The changes that diagnostics prompts teams to make are prompt changes. Moving a run date from the system prompt to the user message, canonicalizing tool schemas, pinning a model or altering thinking settings each alters the request the model sees, and the effect on outputs has not been measured by Anthropic in the documents reviewed. Frameworks used in regulated settings treat this as change management:

  • Quality risk management: ICH Q9(R1) states that the level of effort, formality and documentation should be commensurate with the level of risk ([35]), and ICH Q10 says quality risk management should be used to evaluate proposed changes ([36]).
  • Post-change evaluation: Q10 also calls for an evaluation after implementation to confirm the change achieved its objectives without deleterious impact ([37]).
  • Computerized systems: the 2011 Annex 11 requires changes to a computerized system, including configuration, to be made in a controlled manner ([38]). The 2025 consultation draft adds that significant changes that may affect quality or data integrity should be subject to re-qualification and validation ([39]), and that the regulated user remains fully responsible even when relying on a vendor's qualification ([40]).
  • Electronic records:21 CFR Part 11 requires validation of systems for accuracy, reliability and consistent intended performance ([41]), secure, computer-generated, time-stamped audit trails ([42]) and revision and change control procedures ([43]).
  • Risk-based assurance: the FDA computer software assurance guidance, reissued on 3 February 2026 ([44]), defines the approach as risk-based for establishing and maintaining confidence that software is fit for its intended use ([45]). It is device quality-system guidance ([46]), so for drug GxP it is an analogy and not a rule. It does recommend digital records such as system logs and audit trails as assurance evidence ([47]).

Regulatory text on AI is still moving, and generative models are treated cautiously. The 2025 consultation draft of EU GMP Annex 22 states that it does not apply to generative AI and large language models ([48]), covers only deterministic-output models that give identical outputs for identical inputs ([49]), and says other models should not be used in critical GMP applications ([50]). For non-critical uses it keeps qualified personnel in the loop ([51]). An EMA workshop page describes the 2026 effort to gather expert input on control and mitigation measures for such models ([52]), and the sources cited here describe Annex 22 only as a draft. The FDA's January 2025 draft credibility framework centers on a defined context of use ([53]), and its stated scope excludes AI used for operational efficiencies such as drafting where patient safety, drug quality and study reliability are not affected ([54]). The EMA reflection paper warns that generative language models are prone to include plausible but erroneous or incomplete output ([55]), and expects GxP SOPs on data and algorithm governance to be extended accordingly ([56]). EMA and FDA jointly identified ten principles for good AI practice in January 2026 ([57]), and the FDA draft defines life cycle maintenance as the management of changes to AI models ([58]). ISPE positions its GAMP artificial intelligence guide for use in parallel with GAMP 5 ([59]), and PIC/S guidance observes that computer systems seldom remain static ([60]). For traceability, NIST's generative AI profile suggests inventory entries that record the versions of underlying models ([61]), ICH E6(R3) calls for audit trails, reports and logs not to be disabled ([62]), and FDA's data integrity guidance defines metadata as the contextual information required to understand data ([63]). A tested model is also expected to be under configuration control before deployment ([64]). Whether a literature or protocol agent falls inside or outside those scopes depends on its context of use and requires a documented determination, ideally with a quality unit. This report does not provide legal or regulatory advice; professional review is needed for a specific deployment.

A scientific-output regression check should be kept separate from cache metrics:

  • Frozen test set: a versioned set of questions with reference answers approved by subject-matter experts.
  • Paired runs: run each question before and after a diagnostics-driven change, with the same model and settings.
  • Acceptance criteria: set in advance and tied to the context of use, in the way the Annex 22 draft expects a change to be evaluated to decide whether retesting is needed ([13]).
  • Variance baseline: repeat unchanged runs to measure the endpoint's own variability before attributing differences to the change.
  • Records: store prompt hashes, outputs, reviewers and decisions in the quality system.

Retention, ZDR and what stays outside the fingerprint

Diagnostics stores a fingerprint of cryptographic hashes and token-count estimates, retained briefly to allow comparison against the next request, and Anthropic states it does not store the raw text of prompts or outputs for this feature. The feature's ZDR status is "eligible (qualified)", and the same data-handling panel lists HIPAA as not eligible ([65]). Prompt caching itself is ZDR eligible, with cryptographic hashes of cached content held in memory only.

Model-specific terms add a second check. Anthropic's data-retention page states that Covered Models require 30-day data retention and are not available under Legacy ZDR ([66]), and the diagnostics page excludes Covered Models from its ZDR status. ZDR arrangements are reviewed and applied per organization ([67]), so a platform team should confirm its own status and the model in use before assuming an eligibility claim applies. Own-application logs are a separate retention surface: they should hold hashes, counters and identifiers, not protocol or patient text.

Benchmark design

No public benchmark measures diagnostics on pharmaceutical workloads. A defensible internal benchmark would:

  • Replay real sessions: capture anonymized call sequences with structure preserved and content replaced by placeholders of equal token count.
  • Use arms: a control arm with current practice, and a treatment arm with fixes applied one at a time in the order diagnostics reports them.
  • Hold the TTL constant within each arm, and run a separate arm for the 1-hour TTL.
  • Record diagnostics, usage counters, latency and cost for each call, and compute the hit rate with the formula above.
  • Report ranges, not a single number: the 5-minute default and the arrival pattern of requests will dominate results.
  • Pair with the scientific regression check so that cost gains are never reported without the quality evidence.
F.03
Scientific-output regression check
01Freeze the test set

Version a set of questions and have subject-matter experts approve the reference answers.

02Set acceptance criteria

Define acceptance criteria in advance and tie them to the context of use.

03Measure baseline variability

Repeat unchanged runs to measure how much the endpoint varies before attributing differences to the change.

04Run paired comparisons

Run each question before and after the diagnostics-driven change, using the same model and settings.

05Record the decision

Store prompt hashes, outputs, reviewers and decisions in the quality system.

06

Data Analysis and Evidence

Illustrative cost arithmetic

Claude cache pricing is expressed as multipliers of the base input price: a 5-minute write costs 25 percent more, a 1-hour write costs 2x, and reads cost 0.1x on most models, with Opus 5.5 and Sonnet 5.5 at 0.05x ([68]). The pricing page notes that caching saves money after a small number of cache reads. Per million tokens, Sonnet 5.5 is listed at $2 input, $2.50 for a 5-minute write and $0.10 for a read, and Opus 5.5 at $4 input, $5 write and $0.20 read. All prices are in USD. The following calculation uses the hypothetical agent above (60,000 cached tokens plus 1,500 new tokens per call), the 5-minute TTL, and excludes output tokens, batch discounts and the 1.1x multiplier that applies to US-only inference.

The cost per call is: uncached = (cached + new) × base price; write = cached × write price + new × base price; hit = cached × read price + new × base price. Table 3 shows the results per 100 calls.

T.02
Scenario (100 calls)Sonnet 5.5Opus 5.5Hit rate
A. No caching$12.30 ($0.123 per call)$24.60 ($0.246 per call)0%
B. Every call writes, none reads (prefix changes every call)$15.30 ($0.153 per call), 24.4% above A$30.60 ($0.306 per call), 24.4% above A0%
C. 5 writes and 95 reads$1.62, 86.8% below A$3.24, 86.8% below A92.7%
D. One hit call, for comparison$0.009 per call, 92.7% below A$0.018 per call, 92.7% below A97.6% for that call

Table 3 is arithmetic on published list prices, not a measurement. Scenario B is the cost of an undiagnosed structural miss: it is more expensive than not caching at all, which is why a cache-hit alert is a cost control and not an optimization extra. Scenario C shows the same agent after fixes, but the real mix of writes and reads depends on request timing and TTL. The hit rate in C is 5.7 million read tokens divided by 6.15 million total input tokens.

Independent and vendor evidence on savings

Anthropic's 2024 caching announcement claimed reductions of up to 90 percent in cost and up to 85 percent in latency for long prompts ([69]). This is a vendor claim for favorable cases. An independent arXiv preprint evaluated caching across OpenAI, Anthropic and Google models using more than 500 agent sessions with 10,000-token system prompts ([70]). It reported cost reductions of 41 to 80 percent and time-to-first-token improvements of 13 to 31 percent ([8]). For Claude Sonnet 4.5 the cost reduction range was 78 to 79 percent ([71]). At a 50,000-token prompt the paper reports 89 percent savings for GPT-5.2 ([72]), and it also found that three models showed first-token regressions of 10 to 18 percent below the cacheable size ([73]). It warns that naive full-context caching can increase latency ([9]). The study predates the models and prices of late 2026, so it supports direction and not a budget.

Provider context

Other providers publish comparable checks. OpenAI documents a cached-input discount of up to 95 percent ([74]) and ships diagnostics that explain why a request reused fewer tokens than expected ([75]), reporting the first classified reason ([76]). Google's Gemini documentation states that implicit caching offers no guaranteed retention window or cost savings ([77]).

F.04
Illustrative Sonnet 5.5 input cost per callUSD per call
Source: Table 3
07

Implications and Future Directions

Four implications follow for pharmaceutical AI platform teams. First, cache health becomes an observable service level, in the same way uptime is, with owners and alert thresholds. Second, any fix prompted by a diagnostics reason is a prompt or configuration change that belongs in the change record, because fixes alter the exact input to a non-deterministic system. Third, the audit trail of a diagnostics decision should consist of the team's own hashes, the diagnostics value and the usage counters, since the vendor fingerprint is short-lived and holds no content. Fourth, the cost case is real but conditional: the arithmetic above shows that a persistently missing cache is worse than none.

IntuitionLabs' perspective, as an adjacent advisor and not a software vendor, is that departments adopting Claude in GxP-adjacent work should start with the lowest-risk context of use, document monitoring controls early, and keep cost telemetry and scientific validation in separate evidence streams. That advice is consultative and is not drawn from the cited sources.

Several items remain open. Annex 22 and the revised Annex 11 were still at consultation or workshop stage in the sources reviewed, and a final text may change the treatment of generative models ([78]). Anthropic has not published a numeric fingerprint retention period, a price for diagnostics, or a measurement of its detection accuracy in the pages reviewed. An arXiv study of caching-related defects suggests that static analysis of agent code is a complementary control to runtime diagnostics ([79]). Teams should also delete the retired beta header from their code, even though the API still accepts it.

08

Frequently Asked Questions (FAQs)

Why is my Claude prompt cache not hitting? Read two things together: the diagnostics value and cache_read_input_tokens. A *_changed reason means the prefix changed. A null result with low reads means the requests match but no entry existed, typically from expiry or a prompt below the minimum length.

What does cache_read_input_tokens mean? It is the number of input tokens read from the cache on that request. Total input is reads plus creation plus input_tokens, because input_tokens counts only the portion after the last breakpoint.

What are the main Claude cache invalidation causes? Edits to tools, system prompt text, thinking settings, images, the model, or earlier messages, and non-deterministic serialization.

What is the minimum token length for caching? It depends on the model: the documentation lists tiers of 512, 1,024, 2,048 and 4,096 tokens, so check the current table for the model in use. Shorter prompts are processed without caching and without an error.

How much does prompt caching save? Cache reads cost 0.1x base input on most models and 0.05x on Opus 5.5 and Sonnet 5.5, but a prefix that writes on every call costs more than not caching. A published study reports 41 to 80 percent cost reductions in agent tasks ([8]). No savings figure can be promised for a given workload.

How should hit rate be monitored for agents? Compute reads divided by reads plus writes plus uncached input per run, alert on sustained drops, and log diagnostics reasons beside it ([29]).

Does diagnostics work on every platform? The documentation lists the Claude API and Claude Models on Google Cloud (Anthropic managed), and not Managed Agents.

Can it be used in regulated pharma work? Diagnostics is ZDR eligible on a qualified basis and, per the data-handling panel described in the retention section, is not HIPAA eligible, so teams handling PHI should not rely on it; eligibility also does not validate scientific output, and Covered Models carry separate retention terms. A quality unit should decide how it is used under the organization's validation approach.

Is diagnostics proof that outputs are valid or unchanged? No. It reports request structure, and the cache does not change outputs.

09

Conclusion

Cache diagnostics turns a silent cost failure into a labeled structural event, but only within narrow limits. It identifies the first section of the request that diverged, it must be paired with the cache_read_input_tokens field to tell a request change from an expiry, and it does not reveal what changed or prove that a cache entry existed. For pharmaceutical agents that repeat long protocol, literature or regulatory prefixes, the useful design is a log record that combines the diagnostics value, usage counters, elapsed time and the team's own prefix hashes, reviewed against a hit-rate threshold.

The governance conclusion is equally important. Diagnostics, cache hit rate and ZDR eligibility are three different evidence streams, and none of them is a scientific validation signal. Fixes suggested by diagnostics change the prompt and should pass through change control with a separate scientific-output regression check. Teams that keep these streams separate can use diagnostics to reduce unexplained token spend without overstating what it demonstrates.

The publisher

About IntuitionLabs

Build practical AI for pharma and biotech with IntuitionLabs. We help life-science teams turn complex information and workflows into useful software, governed knowledge systems and AI tools.

IntuitionLabs is an AI consulting, custom software development and data engineering firm serving pharmaceutical, biotechnology, medical-device and other life-science organizations. We work with clinical, regulatory, medical-affairs, commercial, quality and IT teams to connect technology decisions with the work people need to accomplish.

AI consulting and adoption

Our AI enablement services cover readiness assessments, use-case selection, governance and policies, team workshops, adoption measurement and ongoing advisory support. We help organizations structure the information layer behind AI: source material, context, permissions and maintained knowledge that make generated answers useful and reviewable. Private LLM inference and hosted AI options support teams evaluating how to operate AI with appropriate control over their data and infrastructure.

Software, data and life-science workflows

IntuitionLabs develops custom software for pharma and biotech, integrates enterprise systems, and builds data engineering and business intelligence solutions. Areas of focus include AI agents, regulatory research, medical writing, medical affairs, CMC information, competitive intelligence and clinical-document workflows. Our eTMF intelligence work includes cross-system reconciliation and inspection-readiness support.

Enterprise platforms and regulated delivery

We provide Veeva services, application support, managed services, integrations and custom applications, alongside enterprise content work involving platforms such as Egnyte. For regulated workflows, our services include GxP enablement, computer-system validation and software development addressing 21 CFR Part 11 requirements. The applicable controls, validation responsibilities and acceptance criteria are defined for each engagement.

Work with IntuitionLabs

Explore AI enablement, pharma and biotech software development, data engineering and BI, and Veeva services. Contact IntuitionLabs to discuss your workflow, information sources and implementation needs.

IntuitionLabs publishes educational research to help life-science teams make informed technology decisions. Coverage of a product or organization does not imply a client relationship, endorsement or partnership.

Sources / 79
Adrien Laurent

Need Expert Guidance on This Topic?

Let's discuss how IntuitionLabs can help you navigate the challenges covered in this article.

I'm Adrien Laurent, Founder & CEO of IntuitionLabs. With 25+ years of experience in enterprise software development, I specialize in creating custom AI solutions for the pharmaceutical and life science industries.

Disclaimer

The information contained in this document is provided for educational and informational purposes only. We make no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability, or availability of the information contained herein. Any reliance you place on such information is strictly at your own risk. In no event will IntuitionLabs.ai or its representatives be liable for any loss or damage including without limitation, indirect or consequential loss or damage, or any loss or damage whatsoever arising from the use of information presented in this document. This document may contain content generated with the assistance of artificial intelligence technologies. AI-generated content may contain errors, omissions, or inaccuracies. Readers are advised to independently verify any critical information before acting upon it. All product names, logos, brands, trademarks, and registered trademarks mentioned in this document are the property of their respective owners. All company, product, and service names used in this document are for identification purposes only. Use of these names, logos, trademarks, and brands does not imply endorsement by the respective trademark holders. IntuitionLabs.ai is an AI software development company specializing in helping life-science companies implement and leverage artificial intelligence solutions. Founded in 2023 by Adrien Laurent and based in San Jose, California. This document does not constitute professional or legal advice. For specific guidance related to your business needs, please consult with appropriate qualified professionals.

Related Articles

Need help with AI?

© 2026 IntuitionLabs. All rights reserved.