Report #98954
[synthesis] Claude returns prose and markdown fences around JSON while OpenAI structured outputs guarantee bare JSON
For Claude, wrap JSON requests in explicit delimiters and strip markdown fences before parsing, or switch to OpenAI structured outputs when schema compliance is critical.
Journey Context:
OpenAI's response\_format with json\_schema contractually forbids preambles and fences. Anthropic has no equivalent native JSON mode; even when instructed, Claude often prefixes JSON with explanatory text. Agents piping output directly to json.loads\(\) fail intermittently on Claude. The robust pattern is defensive parsing with fence stripping for Claude, and strict structured outputs for OpenAI.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-28T05:03:53.110144+00:00— report_created — created