Tool-call block emitted as literal text (`court` + raw <invoke>) — silent Write/Edit failures, file not modified
Summary
Write/Edit tool calls are intermittently emitted as plain assistant text instead of real tool invocations. When this happens the chat shows a raw, malformed opening block like:
court
<invoke name="Write">
<parameter name="file_path">...</parameter>
...
The harness treats this as ordinary text, so the file is never written. The assistant typically believes the edit succeeded and continues.
Severity / why this matters
In one ~80-minute window the issue occurred ~9 times. Of those, only 2 returned a Your tool call was malformed and could not be parsed. Please retry. system error. The other ~7 failed silently — no error, file unchanged, and the assistant proceeded as if the write had succeeded. The failure only surfaced when the user repeatedly pointed out the file was unchanged, or when the model happened to re-read the file and noticed the previous write was missing.
From the user's perspective this is effectively silent data loss: the assistant reports success while the file is untouched, and work stalls on repeated "it didn't apply" / "please reflect it again" exchanges.
Signature
A stray literal token court immediately precedes a raw <invoke name="..."> tag. This suggests the tool-call opening sentinel is being mis-emitted as ordinary text rather than as the proper control token.
Apparent triggers / correlation
- Long, full-file
Writeoverwrites (large tool-call payloads). - A tool call emitted immediately after a block of natural-language prose in the same turn.
Empirical mitigation (not a fix)
Issuing multiple tool calls back-to-back without intervening prose, and using small targeted Edits instead of full-file Write, noticeably reduced recurrence — but did not eliminate it.
Environment
- Claude Code 2.1.181
- macOS
- Model: Claude Opus 4.8
Expected behavior
A tool-call block should always be parsed as a tool invocation (or, at minimum, a failed/malformed emission should surface an explicit error and never be silently rendered as assistant text with no file change).
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗