Why Appending to Your Agent's System Prompt Breaks Prompt Caching
Appending a timestamp or status line to an agent's system prompt changes the prompt prefix on every turn. Prompt caching matches only a contiguous token range from position zero, so the first changed token ends reuse and everything after it is reprocessed at full price. The post reports a case where a task that should have cost about $21 billed about $200, explains the arithmetic, and shows a cache-stable ordering: static system prompt first, volatile text at the tail. Full write-up: https://hackyjs.com/posts/why-appending-to-your-agents-system-prompt-breaks-prompt-caching
llm-agentsprompt-cachinginference-costsystem-promptsai-architecture