Vibe Coding
Tip: turn-scoped system messages replace the inject-a-reminder-then-delete-it pattern
Setting `clear_at: "next_user_message"` on a `role: "system"` message gives its text system-prompt authority for the current turn only, then stops rendering once a later user message exists. The message stays in `messages` and you keep sending it back verbatim, so the prompt cache keeps matching, later thinking blocks stay valid, and a cleared message costs no input tokens. Requires the `mid-conversation-system-clear-at-2026-08-21` beta header. This is the sanctioned replacement for injecting per-turn reminders into history and stripping them next request, which now invalidates thinking blocks.
Source
↳ Follow the thread