claude-code - 💡(How to fix) Fix [Bug] Claude Opus 4.8 emits malformed tool calls with parsing errors

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…

Fix Action

Fix / Workaround

Workaround

  • Use Opus 4.7 (still available via --model claude-opus-4-7, though not listed in /model).

Code Example

[]
RAW_BUFFERClick to expand / collapse

Bug Description Title: Opus 4.8 — tool calls frequently emitted as malformed (Your tool call was malformed and could not be parsed)

Summary On Opus 4.8 in Claude Code, tool calls (especially Bash/Read/Edit) are frequently emitted in a broken form and rejected with Your tool call was malformed and could not be parsed. Switching the same conversation to Opus 4.7 immediately resolved the issue.

Symptoms

  • A stray token (e.g. literal court) appears where the tool-invocation tag should start, breaking the parser.
  • Same operation retried within seconds sometimes succeeds, sometimes fails — appears intermittent.
  • Write/Edit calls succeed more often than Bash/Read/Grep calls (search/read paths are the worst).
  • Occurs in normal sessions, no special skill or MCP usage.

Reproduction

  1. Start Claude Code with Opus 4.8 (claude default).
  2. Ask the model to run several Bash commands or Read multiple files in sequence.
  3. Within ~5–20 calls, observe one or more malformed tool call errors.
  4. Switch the same conversation to Opus 4.7 via claude --model claude-opus-4-7 --resume → errors stop.

Impact

  • User has to copy commands manually and paste outputs back, blocking long-running work.
  • Multiple-hour development sessions become impractical on 4.8.

Workaround

  • Use Opus 4.7 (still available via --model claude-opus-4-7, though not listed in /model).

Environment

  • Claude Code CLI on macOS (Darwin 25.5.0)
  • Affected model: claude-opus-4-8 (default Opus)
  • Works fine on: claude-opus-4-7

Environment Info

  • Platform: darwin
  • Terminal: vscode
  • Version: 2.1.158
  • Feedback ID: 537c28a3-fa17-4a4e-b33e-c310783123cd

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

claude-code - 💡(How to fix) Fix [Bug] Claude Opus 4.8 emits malformed tool calls with parsing errors