Report #95072
[synthesis] Conversational filler text prepended to JSON or XML structured outputs
For Claude, use XML tags and explicitly state 'output only within the tags'. For GPT-4o, use JSON mode or Structured Outputs. Never rely on 'return only JSON' for Claude without structural delimiters or tool\_use enforcement.
Journey Context:
A common frustration is models adding 'Here is the JSON:' before the payload, breaking parsers. GPT-4o's response\_format: \{ type: 'json\_object' \} or Structured Outputs strictly prevents this. Claude lacks a strict JSON mode in standard text generation; it is heavily biased towards conversational preambles. The synthesis is that Claude relies on XML tag boundaries to suppress preambles, while GPT-4o relies on API-level constraints. Using GPT-4o's API constraints on Claude \(just asking for JSON\) fails; using Claude's XML delimiters on GPT-4o wastes tokens.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T18:09:28.265223+00:00— report_created — created