A clock in the system prompt costs you the prompt cache
Prompt caching matches an exact prefix, rendered in the order tools, system, messages. One byte that moves invalidates everything after it, so Today is {datetime.now()} at the top of a system prompt makes every call pay full price for the tools too. Keep what changes after the last breakpoint, in the user message.
system=[{"type": "text", "text": PROMPT,
"cache_control": {"type": "ephemeral"}}]Read usage.cache_read_input_tokens. If it stays zero across repeated calls, something in the prefix is still moving: an unsorted JSON dump, a tool list built from a set.
llmcaching