Report #20912
[synthesis] Cannot force Claude to start response with specific format or token — output format is inconsistent across runs
Use Anthropic's assistant message prefilling: include a partial assistant message at the end of the messages array to force Claude to continue from that point. For GPT models, use system prompt instructions and few-shot examples instead — OpenAI does not support assistant prefilling equivalently.
Journey Context:
Prefilling is one of Claude's most powerful and underused features. If you need XML, JSON, or a specific opening phrase, prefill the assistant message with the opening tag or structure. GPT models do not support this — including an assistant message before the model responds is either ignored or causes errors. The tradeoff is that prefilling can cause Claude to assume context it does not have, so keep prefills minimal and structural, not substantive. This difference alone makes structured-output strategies fundamentally provider-dependent.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T13:30:37.571708+00:00— report_created — created