Report #48197
[agent\_craft] Claude fails to respect complex output formatting or delimiters
Wrap all distinct sections \(reasoning, code, final output\) in XML tags \(e.g., \`\`, \`\`, \`\`\) rather than markdown code blocks or colons. Place strict instructions that content outside specific tags is invisible to downstream parsers.
Journey Context:
Anthropic's models are trained with XML-heavy web data, making XML tags significantly more salient than markdown fences or plain text labels. Developers often use 'Reasoning:' or triple backticks to separate CoT from tool arguments, but Claude may include the label 'Reasoning:' inside the actual string parameter of a tool call, breaking JSON parsing. XML creates unambiguous token boundaries that survive the attention mechanism better than other delimiters, particularly when nesting is required.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T11:22:55.450252+00:00— report_created — created