[BUG] Opus 4.8 leaks raw tool-call syntax (<invoke>/call) as text, killing the turn
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
- Tool calls intermittently render as literal text (e.g. "call <invoke ...>")
in the reply body instead of being executed, which corrupts/stalls the turn.
- Happens even on the FIRST tool call of a fresh session.
- Reproducible on claude-opus-4-8. Switching to claude-sonnet-4-6 in the
SAME session/workspace makes it disappear entirely.
- Environment: Claude Code, VS Code extension, Windows 10.
What Should Happen?
- Tool calls intermittently render as literal text (e.g. "call <invoke ...>")
in the reply body instead of being executed, which corrupts/stalls the turn.
- Happens even on the FIRST tool call of a fresh session.
- Reproducible on claude-opus-4-8. Switching to claude-sonnet-4-6 in the
SAME session/workspace makes it disappear entirely.
- Environment: Claude Code, VS Code extension, Windows 10.
Error Messages/Logs
Steps to Reproduce
- Open Claude Code via the VS Code extension on Windows 10.
- Start a fresh session and set the model to Opus 4.8 (claude-opus-4-8).
- Give any task that requires the assistant to call a tool
(e.g. "read this file and check X", "run git status").
- Observe: instead of actually executing the tool, the assistant emits the
raw tool-call syntax as plain text in the reply body, e.g.:
call
<invoke name="Bash">
<parameter name="command">...</parameter>
The turn then stalls / dies — the tool never runs.
Additional notes:
- This happens even on the FIRST tool call of a brand-new session.
- It is NOT fixed by instructions/system prompt rules telling the model not to
do it — the model intends to call the tool but the call leaks as text at the
decoding level.
- Switching the model to Sonnet 4.6 (claude-sonnet-4-6) in the SAME session and
workspace makes the problem disappear completely; tools execute normally.
- So the issue appears specific to Opus 4.8 decoding/tool-call emission, not the
workspace or task.
Environment:
- Claude Code, VS Code extension
- Windows 10 Pro (10.0.19045)
- Model where it breaks: claude-opus-4-8
- Model where it works: claude-sonnet-4-6
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
2.1.181
Claude Code Version
2.1.181
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗