Prompt layout

Stable first. Variable last. Always.

1. Tools
Names, schemas, descriptions — frozen per agent version
Cache this
2. System
Persona, policy, long instructions
Cache this
3. Static context
Docs, few-shots, retrieved corpus that is reused
Cache this
4. History
Prior turns, appended only — never rewritten or reordered
Cache this
5. New user turn
The only tokens that should change on this request
Compute this

On Claude, place cache_control on the last block that stays identical — usually the end of history, never a timestamp or the incoming question.