Report #24301
[synthesis] Claude injects unsolicited caveats and explanatory text into responses meant to be machine-parsed
For Claude, explicitly instruct 'Output ONLY the result with no explanation, caveats, or preamble' in the system prompt or tool description. For GPT-4, lighter instructions suffice. Always strip preamble text before parsing—use a format anchor such as the first '\{' for JSON or first '<' for XML as a parse start marker.
Journey Context:
Claude's helpfulness training produces a behavioral fingerprint of adding context: 'Here is the result:' or 'Note that this may not cover all cases...' before the actual output. GPT-4 does this less aggressively. In an agent pipeline where output is machine-parsed, this preamble breaks parsers. The fix has two layers: prompt-level suppression with explicit 'no preamble' instructions, which works roughly 90% of the time on Claude and 99% on GPT-4, and parse-level resilience: find the first structural character of your expected format and parse from there, discarding any preceding text. Relying solely on prompt-level suppression is insufficient for production agents.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T19:11:38.112430+00:00— report_created — created