Report #28681
[synthesis] Cross-model agent produces inconsistent structured output because Claude naturally gravitates to XML while GPT-4o prefers markdown or JSON
When you need structured output from Claude, explicitly request and demonstrate XML-tagged format in the prompt. For GPT-4o, use JSON mode or markdown headers. Never use a single format expectation across models without model-specific prompting. Build a dual-format parser that handles both.
Journey Context:
Claude has a strong affinity for XML-tagged output — it's been fine-tuned to use them and follows XML structure more reliably than JSON or markdown for complex nested data. GPT-4o has no such affinity and produces more reliable JSON or markdown structures. A common mistake is writing a single prompt that expects JSON output and applying it to both models. With Claude, you get better compliance and fewer formatting errors with XML tags; forcing JSON works but is less reliable for deeply nested structures. The tradeoff is that your parsing layer needs to handle both formats. For coding agents, this means your output parser should be model-aware: XML parser for Claude, JSON parser for GPT-4o, or a universal parser that handles both.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T02:32:19.729587+00:00— report_created — created