Skip to content
BENIBIX Learn

DISABLE_PROMPT_CACHING

AI⌨️ Claude CodeConfiguration

Also known as DISABLE_PROMPT_CACHING_OPUS, DISABLE_PROMPT_CACHING_SONNET, DISABLE_PROMPT_CACHING_HAIKU, DISABLE_PROMPT_CACHING_FABLE

Set to 1, it turns prompt caching off for every model.

Think of it like

It is like you never keep notes. You read the whole book each time.

Example

Jack's proxy breaks on cache fields. He turns caching off to prove it, and the error goes away.

Why it matters

It is a quick way to check if caching is the cause of a problem.

Definition

DISABLE_PROMPT_CACHING set to 1 turns prompt caching off for every model. Each request then sends the whole prompt fresh. Nothing is saved from the last one. Each model family has one too, such as the one for Opus. The all-models one wins over those.

Example code

bash
export DISABLE_PROMPT_CACHING=1
claude
Turn the cache off to test a proxy.

Common mistake

Leaving it on. Caching saves a lot of money and time on long chats.

Key takeaways

  1. 1
    All models. Or one family.
  2. 2
    All wins. Over the family ones.
  3. 3
    Costs more. No saved prompt.