claude-code - 💡(How to fix) Fix Tool calls rendered as raw text and fail to parse with claude-opus-4-8 in VS Code extension

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…

Tool calls from claude-opus-4-8 are rendered as raw text in the VS Code extension instead of being executed, causing the session to hang indefinitely. This does not occur with claude-opus-4-7 or claude-sonnet-4-6.

Error Message

The following error is displayed:

Root Cause

Tool calls from claude-opus-4-8 are rendered as raw text in the VS Code extension instead of being executed, causing the session to hang indefinitely. This does not occur with claude-opus-4-7 or claude-sonnet-4-6.

Fix Action

Fix / Workaround

Workaround: Set "model": "sonnet" in ~/.claude/settings.json, or switch via /model sonnet.

Code Example

count
<invoke name="Read">
  <parameter name="file_path">...</parameter>
</invoke>
RAW_BUFFERClick to expand / collapse

Summary

Tool calls from claude-opus-4-8 are rendered as raw text in the VS Code extension instead of being executed, causing the session to hang indefinitely. This does not occur with claude-opus-4-7 or claude-sonnet-4-6.

Environment

  • Claude Code version: 2.1.145
  • Platform: VS Code extension
  • OS: Windows 11 Enterprise
  • Model affected: claude-opus-4-8
  • Models NOT affected: claude-opus-4-7, claude-sonnet-4-6

Steps to Reproduce

  1. Open a project in VS Code with the Claude Code extension
  2. Ensure the model is set to claude-opus-4-8 (default or via /model)
  3. Ask Claude to perform any task that requires tool use (e.g., read a file, search code)
  4. Observe that the tool call appears as raw text in the chat

Actual Behavior

The tool call is rendered as raw XML-like text in the chat with a spurious count token at the beginning:

count
<invoke name="Read">
  <parameter name="file_path">...</parameter>
</invoke>

The following error is displayed:

"The model's tool call could not be parsed (retry also failed)."

The session stops and does not recover automatically. The user must manually intervene to resume.

Expected Behavior

Tool calls should be executed without appearing as raw text in the chat.

Additional Context

Verified across 5 projects with a clear model-version correlation:

ModelTool calls executedIssue occurs
claude-opus-4-8yesyes (2 projects)
claude-opus-4-7yes (75+ calls)no (2 projects)
claude-sonnet-4-6yes (20+ calls)no (1 project)

Workaround: Set "model": "sonnet" in ~/.claude/settings.json, or switch via /model sonnet.

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