Report #11462
[agent\_craft] Tool outputs causing hallucinated closing tags or parsing errors in agent responses
Wrap tool results in XML tags like ... instead of markdown code blocks
Journey Context:
Markdown fences \(\`\`\`json\) often cause the model to hallucinate the closing fence or try to parse the content as conversational text. XML tags are treated as structural delimiters by Claude and other models, preventing the model from 'speaking' the tool output. Anthropic specifically recommends XML for tool results to avoid the model confusing tool data with its own response generation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T13:21:40.394756+00:00— report_created — created