Why does placing Current UTC Time or user_id on line 1 of a 6,500-token agent system prompt multiply your monthly LLM bill?
Prompt/KV caches hash prefixes sequentially starting from token 0. If even 1 character changes near the top of the prompt, the cache miss cascades through all 6,500 static instructions and tool JSON schemas below it, forcing full uncached prefill billing on every turn. Always freeze static rules + tool schemas first and inject timestamps/user context at the bottom of the user message.
// BAD: breaks 90% prefix cache hits on every call
const badPrompt = `Time: ${new Date().toISOString()}\n${STATIC_SYSTEM_RULES}`;
// GOOD: identical token prefix shares KV cache across all users
const messages = [
{ role: 'system', content: STATIC_SYSTEM_RULES },
{ role: 'user', content: `[Time: ${new Date().toISOString()}]\n${userQuery}` }
];