Report #54949
[agent\_craft] XML delimiters in tool output causing premature stream termination in Claude
Escape XML special characters in tool return values when using Claude's XML tool format
Journey Context:
Anthropic's tool use \(Claude\) uses XML tags like and to delimit tool calls in the stream. If a tool returns content containing the literal string '' or unescaped '<', the parser may prematurely close the block, truncating the output or breaking the conversation tree. Unlike JSON mode, XML requires escaping or base64 encoding of arbitrary tool output.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T22:43:28.441008+00:00— report_created — created