Tool calls intermittently emitted as plain text (stray `court` + legacy `<invoke>` XML) instead of executing — hangs the session

Resolved 💬 3 comments Opened Jun 19, 2026 by vitormartinsc Closed Jun 25, 2026

Summary

Intermittently, instead of issuing a real tool call, Claude Code emits the tool call as plain text in the assistant message: a stray token court followed by the legacy XML-style <invoke name="..."> / <parameter name="..."> markup. When this happens the tool does not execute and the turn hangs (no tool result is ever returned). Re-emitting the same call cleanly almost always works.

Environment

  • Claude Code: 2.1.183
  • Model: Opus 4.8 (claude-opus-4-8)
  • OS: Linux on WSL2 (Windows) — 6.6.87.2-microsoft-standard-WSL2, x86_64
  • Node: v20.19.5
  • MCP: Playwright MCP (the affected calls were MCP tools)

What happens

The assistant output contains literal text like:

court
<invoke name="mcp__playwright__browser_navigate">
<parameter name="url">https://example.com/...</parameter>
</invoke>

instead of an actual function call. No tool runs and the session appears frozen until the user points it out, at which point re-emitting the call works.

Affected tools (observed)

  • mcp__playwright__browser_navigate
  • mcp__playwright__browser_evaluate

Both are MCP tools. It happened 8+ times across a single long session, more often on browser_navigate.

Frequency / pattern

  • Intermittent, non-deterministic. The same call re-emitted immediately usually executes fine.
  • Seemed more likely on longer browser_evaluate blocks and on navigation calls.
  • The leading stray token was consistently court.

Expected behavior

Tool calls should always be emitted in the proper function-call format and execute; they should never be rendered as literal <invoke>/<parameter> text.

Workarounds found

  • Re-emitting the identical call immediately usually succeeds.
  • For navigation, using browser_evaluate with window.location.href = '<url>' was more reliable than browser_navigate (though the leak still occasionally appeared on evaluate too).

Impact

Repeated hangs in long agentic / browser-automation sessions, requiring manual user intervention to recover.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗