[BUG] Recurring "Your tool call was malformed and could not be parsed" stalls in long /compact-ed sessions (claude-opus-4-8, macOS desktop)

Resolved 💬 2 comments Opened Jun 11, 2026 by fresh-egg-company Closed Jun 14, 2026

Claude Code bug report — recurring "tool call was malformed" stalls

Environment

  • Claude Code Desktop app (macOS, Darwin 25.5.0)
  • Claude Code version: 2.1.146
  • Model: claude-opus-4-8 (user later switched the session to claude-fable-5 as a workaround)
  • Long-running Japanese-language documentation-audit session; multiple /compact cycles; heavy batched Bash tool use (command strings contain Japanese text, regex, and shell quoting)

Symptom

Five or more times in a single session, an assistant turn ended with the harness error:

Your tool call was malformed and could not be parsed. Please retry.

From the user's perspective the session simply stalls and must be manually re-prompted ("処理が止まったようです。再開して下さい。") each time. It also happened on the very first tool call immediately after resuming from /compact, so a single session stalled repeatedly.

Diagnosis from inside the session

The model intermittently emits its tool-invocation markup in a near-miss form — the internal tag-namespace prefix required by the parser is dropped — so the block is rejected as unparseable text instead of executing. Identically-purposed calls serialized correctly in the same session ran fine. The local environment (macOS, the scripts being run) and the API service were healthy throughout; this is model-output serialization drift, not a server outage and not a local failure.

Observed correlations:

  • sessions that have been /compact-ed at least once (the drift recurred on the first tool call right after a compaction resume)
  • long batched Bash invocations mixing Japanese text, regex, and nested quoting

Impact

Long autonomous audit/verification workflows cannot run unattended; the user has to babysit the session and nudge it after every stall.

Requests

  1. Investigate tool-call serialization drift on claude-opus-4-8 in long / compacted contexts. The user's hypothesis: a conflict between recent Claude model improvements, Claude desktop-app behavior changes, and execution of scripts generated from inference.
  2. Harness resilience: on a tool-call parse failure, automatically re-prompt / retry the model instead of ending the turn and waiting for user input.

---
Filed via gh CLI from within the affected session, at the user's request.

🤖 Generated with Claude Code

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗