Streaming tool_use leaks raw invoke syntax ('court' + <invoke>) into chat and hangs on 'invoking' (Desktop app, macOS, v2.1.193)
Open 💬 0 comments Opened Jul 1, 2026 by homvi-kenmochi
Summary
In the Claude Code desktop app (chat UI), assistant turns that emit tool calls intermittently leak the raw tool-invocation syntax into the visible chat as plain text — a stray token court immediately followed by <invoke name="..."> — and the turn then hangs showing "invoking" / a running-agent spinner but never completes and no tool actually runs.
Environment
- Claude Code desktop app on macOS (Darwin 25.3.0)
- App/CLI version: 2.1.193
- Model: Claude Opus 4.8
- Setup: many MCP connectors enabled (Gmail/Drive/Slack/Calendar/freee/davinci-resolve/computer-use/github, etc.), ~40 skills, SessionStart/UserPromptSubmit hooks injecting context each turn.
Symptom
- Visible artifact: the literal text
courtappears, followed by leaked<invoke ...>/<parameter ...>XML, in the rendered assistant message. - It correlates with the boundary where the assistant transitions from prose to a tool call, and especially with Agent/Task (subagent) delegation calls.
- Two severities observed:
- (A) cosmetic —
courtshows but the tool still executes and returns results. - (B) destructive —
courtshows, the UI stays on "invoking"/"agent running", and the turn hangs permanently with zero result (the tool never runs). This recurs repeatedly ("連発").
Reproduction notes
- Intermittent (not every turn), so a single attempt does not reliably reproduce.
- Occurs after app restart and in fresh/lighter sessions, so it is not solely caused by a full context window.
Mitigations tried (reduced frequency but did NOT eliminate)
- Set
CLAUDE_CODE_MAX_OUTPUT_TOKENS=65536in~/.claude/settings.jsonenv. - Trimmed always-injected context (CLAUDE.md ~20% smaller, memory index shortened).
- Reduced permission allowlist.
- Destructive (B) hangs still occur in separate threads after these changes.
Impact
Makes the desktop app unreliable for tool-heavy / subagent-delegation workflows: the user cannot tell whether work ran, and turns silently produce nothing.
Questions
- Is this a known client-side streaming/tool_use rendering bug (raw invoke syntax surfacing as text, then hang)?
- Is there a setting or app channel/version that avoids it?
- Does the terminal CLI / IDE extension render streamed tool_use through a different path that is not affected?