Claude Code Prints "court" and Raw invoke Tags — Why Tool Calls Do Not Run, and How to Fix It
During long Claude Code sessions, a stray "court" or a raw <invoke name="Bash"> tag suddenly leaks to the screen and the tool call never executes. This is not a mistake in your environment or command: it is a known model-side glitch where Claude (especially the Opus 4.8/4.7 family) corrupts the control tags of a tool call as it generates them, with many issues filed in Anthropic official repository (#64108, #64150, #64690, #65705, #66153, #67295, #68354). This article explains how an agent generates tool calls as text, why the fail-closed harness rejects them so no wrong command ever runs, the two-layer cause (control-token corruption plus a self-poisoning chain where the broken block stays in history and the model imitates it), the trigger conditions (long multi-day sessions, heavy context, the post-/compact state, multiple tools at once, 3+ MCP servers, long tool arguments), three common misconceptions (it did not go rogue; court is meaningless but a useful marker; retry only fixes mild cases), the user fix (bail to a fresh session /clear after two misses; /compact is unreliable), the developer fix (check stop_reason, detect invoke leakage and retry, never keep broken history, shorten arguments), how to tell it apart from similar errors (thinking-block 400, max_tokens truncation, third-party Bedrock parsing), and the official status that no fix has shipped as of June 2026 — all grounded in official docs and the real issues.