claude-code - 💡(How to fix) Fix [Bug] Opus 4.7 with extended thinking intermittently emits unparseable tool_use blocks

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

Findings from my local session logs (~/.claude/projects/.../*.jsonl), 5/24-5/26:

  • ~20 "malformed and could not be parsed" retry prompts across 6 sessions; one session (83889c9d) hit it 8 times.
  • The failing assistant turns have stop_reason="tool_use" but NO parseable tool_use block — only a thinking block is present.
  • NOT caused by size: failing turns were only 164-1093 output tokens.
  • NOT caused by special chars: a plain 119-char single-line SQL (SELECT ... FROM information_schema.columns ...) triggered it.
  • Affects multiple tools: Read, Bash, mcp execute_sql.
  • Common factor: every failing turn is Opus 4.7 with an extended-thinking block.

Code Example

[]
RAW_BUFFERClick to expand / collapse

Bug Description

Title: Opus 4.7 + extended thinking intermittently emits unparseable tool_use blocks (small calls too)

Body: Frequent "The model's tool call could not be parsed (retry also failed)" hard-stops. CLI 2.1.150 (latest). Model: claude-opus-4-7.

Findings from my local session logs (~/.claude/projects/.../*.jsonl), 5/24-5/26:

  • ~20 "malformed and could not be parsed" retry prompts across 6 sessions; one session (83889c9d) hit it 8 times.
  • The failing assistant turns have stop_reason="tool_use" but NO parseable tool_use block — only a thinking block is present.
  • NOT caused by size: failing turns were only 164-1093 output tokens.
  • NOT caused by special chars: a plain 119-char single-line SQL (SELECT ... FROM information_schema.columns ...) triggered it.
  • Affects multiple tools: Read, Bash, mcp execute_sql.
  • Common factor: every failing turn is Opus 4.7 with an extended-thinking block.

Looks like a tool_use serialization defect when extended thinking is active. Auto-retry sometimes recovers; "retry also failed" is when the retry repeats it.

Environment Info

  • Platform: darwin
  • Terminal: ghostty
  • Version: 2.1.150
  • Feedback ID: 59d64386-04ba-4c37-ace9-f2c3a0830f55

Errors

[]

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING