Intermittent malformed tool-call output (literal 'count' + non-namespaced invoke/parameter tags) renders as text instead of executing

Open 💬 0 comments Opened Jul 14, 2026 by Vampire-V

Summary

In a long Claude Code session (Opus 4.8, 1M context), the assistant intermittently emits malformed tool-call syntax — a literal word count followed by non-namespaced <invoke name="..."> / <parameter name="..."> tags instead of the correct function-call format. The harness does not recognize it as a tool call, so it prints the raw tags as plain text and nothing executes.

What the user sees

count
<invoke name="Bash">
<parameter name="command">...</parameter>
</invoke>

Printed as text; the command never runs. The next turn often repeats the same malformed output.

Impact

  • Tool calls silently fail (git commit/push, SSH, Read/Write, WebFetch, subagent dispatch).
  • Intermittent within one session — correct executions and malformed ones are mixed, so it is not a permissions/config issue.
  • Very confusing/frustrating: user keeps asking "did it run?" and "why the weird format?".

Environment

  • Claude Code CLI, model Opus 4.8 (1M context)
  • Long, high-token session (100+ turns)
  • Tools affected: Bash, Read, Write, WebFetch, Agent

Expected

Tool calls should always be emitted in valid function-call format and execute.

Notes

Frequency increases deep into a long session — looks like output-format drift under long context.

View original on GitHub ↗