Change instructions mid-conversation and keep your cache

Send system messages after a user turn, so instructions can change in a long session without losing cache hits.

Department
Engineering
Related links
Share

Instructions sometimes change partway through a long session. You can send a role: "system" message inside the messages array, after a user turn, and keep your prompt cache hits, so an agent gets new instructions without paying to reprocess the conversation.

Placement rules apply. It's on Claude Opus 4.8, on the Claude API, Claude in Amazon Bedrock, and Google Cloud.

Earlier updates

May 28, 2026
May 27, 2026
May 21, 2026
May 19, 2026
All updates