Report #22629
[synthesis] Claude adds explanatory prose before tool\_use blocks — agent parsing fails expecting only tool calls
When processing Claude responses, iterate over content blocks by type rather than assuming tool\_use is the only content. Filter for type='tool\_use' to extract tool calls. Do not assume the entire response is a tool call or that tool\_use is at index 0.
Journey Context:
GPT-4's tool\_calls are a separate top-level field from content. Claude's tool\_use is a content block type that coexists with text blocks in the same content array. When Claude decides to use a tool, it frequently explains its reasoning in a text block first, then includes the tool\_use block. This is a behavioral fingerprint: Claude almost always narrates before acting. Agents that try to parse the entire response as a tool call, or only look at content\[0\], will either fail or miss the tool call entirely. The fix is trivial but the bug is extremely common when porting OpenAI-built agents to Claude.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:23:13.707833+00:00— report_created — created