{"slug": "court", "title": "Court", "summary": "A bug in Anthropic's Claude Code CLI tool causes tool calls to leak as plain text instead of executing, with a stray 'court' token appearing before raw '<invoke>' blocks. The issue, reported across multiple GitHub issues including #64108, #64150, and #65705, primarily affects long sessions with high context and multi-day resumes on Opus 4.8 and 4.7 models, stalling workflows until users restart sessions.", "body_md": "[the original Japanese article](/articles/claude-code-court-tool-call-hang)\n\n# Claude Code 'court' bug: tool calls leak as text instead of running (Opus 4.8)\n\n## Contents\n\n## TL;DR\n\n**Symptom** Claude Code (Opus 4.8 family) stalls: instead of running a tool it prints a stray token like `court`\n\nplus a raw `<invoke>`\n\nas plain text\n\n**Workaround** Bail to a fresh session with `/clear`\n\nearly; hand off via a Markdown file, not the corrupted conversation log\n\n**Status** Updated as news lands. Still present on the latest build, no confirmed fix. A July 1 follow-up is at the end\n\nClaude Code prints just `court`\n\nright before it tries to call a tool and stops, or it shows `<invoke name=\"...\">`\n\nas literal text after `court`\n\nand nothing runs.\n\nThis isn’t only your local shell or MCP server jamming up — there are multiple reports of the same shape filed as Claude Code issues.\n\nThis is a bit different from the case where it hangs after `Bash`\n\n, `Read`\n\n, or `Edit`\n\nhas already run.\n\nThe shape of the problem is that at the stage of building the tool call, it doesn’t become a structured `tool_use`\n\nand leaks into the conversation as plain text.\n\nFrom the Claude Code harness’s point of view there’s no executable tool call, so to the user it looks like “nothing ran and it stalled.”\n\nIf you run long sessions parked in tmux, watch for this symptom as an extension of [How do you manage Claude Code sessions?](/en/articles/claude-code-session-management) that I wrote before.\n\nKeeping sessions around is convenient, but in this batch of issues, high context, multi-day resumes, and lots of Edit/Read/Bash keep showing up as triggers.\n\n## Raw invoke with court shows up verbatim\n\nThe representative one is GitHub Issue [#64108](https://github.com/anthropics/claude-code/issues/64108).\n\nThe reporter writes that in a long Claude Code CLI session, `Edit`\n\nand `Read`\n\ncalls didn’t execute and text like the following was shown verbatim.\n\n```\ncourt\n<invoke name=\"Edit\">\n<parameter name=\"file_path\">/path/to/file</parameter>\n...\n</invoke>\n```\n\nIn comments on the same issue there’s a follow-up report that `court`\n\nappeared 182 times in an Opus 4.8 1M session, and another that the same shape appeared 490 times on Opus 4.7 + Claude Code 2.1.148.\n\nSo there’s nothing here to claim it’s “only Opus 4.8” or “only Claude Code 2.1.158 and later.”\n\nThat said, across the issue list, reports involving Opus 4.8 and long sessions stand out from late May into early June.\n\n[#64150](https://github.com/anthropics/claude-code/issues/64150) is close to the “repeats the same breakage without executing” symptom I hit locally.\n\nOn Opus 4.8’s 1M context, the tool call gets `court`\n\nprepended, the namespace drops, the block is shown as text, and the tool doesn’t run.\n\nEven after the user said “that just came out as text, nothing actually ran,” the reporter writes it repeated the same breakage about 10 times.\n\n[#65705](https://github.com/anthropics/claude-code/issues/65705) makes the symptom even clearer.\n\nThe assistant message’s `stop_reason`\n\nbecomes `end_turn`\n\n, and a `court`\n\n-prefixed `<invoke name=\"Bash\">`\n\nends up in the body.\n\nIn that case the harness has no `tool_use`\n\nblock to execute.\n\nSo the command doesn’t fail — it just never runs in the first place.\n\n## It’s not that the tool is heavy — the call’s shape is broken\n\nIf you loosely call the symptom “Claude Code hung,” the list of possible causes gets too wide.\n\nThis `court`\n\nfamily is, at least in the issue reports, treated as a serialization break of the tool call.\n\nThe difference is easy to isolate locally.\n\n| What you see on screen | Closest cause |\n|---|---|\nDoesn’t come back after `Bash` execution logs appear | command, subprocess, stream, timeout |\n| Freezes without an approval prompt appearing | permission prompt, UI renderer |\n`court` and `<invoke name=\"...\">` show up as prose | broken tool_use generation |\n`tool call could not be parsed` appears | tool-call parser or model output |\n\nWhen `court`\n\nshows up, restarting the MCP server sometimes doesn’t fix it.\n\nThe output is broken before execution, so the request never reached the server side.\n\n## In early June the official status side was rough too\n\nOn Anthropic’s status page, from June 1 to 7, 2026, incidents for Opus 4.7, Opus 4.8, Sonnet 4.6, multiple models, and Claude Code services line up.\n\nIn the [June 3 Claude Code services incident](https://status.claude.com/), Claude Code security reviews, code reviews, routines, and some Claude Code web sessions were recorded as degraded.\n\nOn June 5 many Claude models had elevated errors, on June 6 Opus 4.8 had elevated errors and degraded service, and on June 7 several models had degraded performance.\n\nThe impact showed up outside Anthropic too. Notion’s status page logged the Opus 4.7 and 4.8 degradation as a June 5–7 incident.\n\nBecause the failure rate rose for Notion AI users who picked those models, Notion writes that it temporarily disabled all Anthropic models in its model picker and routed requests to other providers.\n\nThat’s an outside service treating it as an Opus 4.7/4.8-side problem and acting on it, not a user misconfiguration.\n\nThis isn’t grounds to tie the cause of the `court`\n\nissue directly to an official outage.\n\nBut it’s a fact that model-side and Claude Code-side errors ran back to back in the same week.\n\nRather than writing it off as “only my machine is broken,” it’s faster to line up the timestamps on the status page and the GitHub issues.\n\nApril’s [Claude Code quality postmortem](https://www.anthropic.com/engineering/april-23-postmortem) sits in a nearby context.\n\nAnthropic explains that the March 4 reasoning effort change, the March 26 thinking-history deletion bug, and the April 16 system prompt change affected Claude Code quality.\n\nThat article also touched on reports where long latency at `high`\n\neffort made the UI look frozen.\n\nThis `court`\n\nisn’t written up as the same bug as those three in the April postmortem.\n\nBut in that long sessions, thinking history, tool calls, and a sense of UI stall are all involved, it shows up on the same operational surface.\n\n## To check locally, look at the jsonl\n\nClaude Code’s local sessions are kept in JSONL under `~/.claude/projects/`\n\n.\n\nA comment on Issue #64108 had an example of grepping for the shape where the assistant message is `stop_reason: \"tool_use\"`\n\nbut the content is just `court`\n\nwith no `tool_use`\n\nblock.\n\nLocally, I look at these first.\n\n- Did just\n`court`\n\nappear on screen - Did\n`<invoke name=\"Bash\">`\n\nor`<invoke name=\"Edit\">`\n\nshow up as prose - Right after that, is there an actual file change, command execution, or MCP server-side log\n- Is\n`stop_reason`\n\n`tool_use`\n\nwhile there’s no`tool_use`\n\nblock - Is it\n`stop_reason=end_turn`\n\nwith`<invoke name=`\n\nin the body\n\nIf there are no execution logs here, deciding to throw the session away before diving into Bash or MCP debugging is the faster call.\n\nIf you say “do it again” in the same conversation, it can step on the broken `<invoke>`\n\nas the template for its next output.\n\nThe [#64150](https://github.com/anthropics/claude-code/issues/64150) report also writes that it repeated the same breakage after the user pointed it out.\n\n## What happens after court\n\nIn GitHub issues, the full text of `<invoke name=\"...\"><parameter name=\"...\">`\n\nshowing up verbatim is common.\n\nBut when you actually hit it locally, breaking that cleanly is rarer.\n\nThe most common one is the pattern where, after `court`\n\n, only the `Bash`\n\ntool-call header is shown and nothing executes.\n\nThe screen shows it trying to call Bash.\n\nThe command doesn’t run, no result comes back, and it just stops.\n\nIt’s also different from the state where no approval prompt is shown.\n\nLooking at the local process list, no Bash child process has started either.\n\nIn issue reports there are cases where even the `<parameter name=\"command\">`\n\ntag is shown as text, but locally the `<parameter>`\n\ntag has never leaked out for me.\n\n`court`\n\n→ Bash header → silence was nearly all of it.\n\nThere are stages to how it breaks: the whole XML structure falling into text like in the issue reports is a fairly advanced state, and in terms of how often you actually run into it, the form where only the Bash header shows and goes quiet is far more common.\n\nLocally, it comes out like this.\n\n```\n⏺ Moving on to check the output. Generating 4 and looking at how each turned out.\n\ncourt\n\n✻ Brewed for 45s · 2 shells still running\n\n❯ actually run it\n\n⏺ court\n\n✻ Cooked for 10s · 2 shells still running\n\n❯ it stalled again, keep going\n\n⏺ Bash(cd ~/project && python gen.py ...)\n  saved out_01.png\n\n⏺ Got 4. Checking each.\n\ncourt\n\n  Read 3 files\n\n⏺ The first one is off from what I expected. Re-reading so I don't misread it.\n\ncourt\n\n  Read 1 file\n\n⏺ The tool call shifted and the read offset moved. Re-reading to pin it down.\n\ncourt\n```\n\nAs you can see, `court`\n\nshows up right before a tool call every time, at the boundary where it moves from text to `Bash`\n\nor `Read`\n\n.\n\nAs the `✻ Brewed for 45s · 2 shells still running`\n\nline shows, the background shells are still running, so what’s stuck is only the session’s tool-call generation.\n\nIf you prod it loosely with “resume” or “go” in this state, the next turn generates a normal `tool_use`\n\nand the command runs too.\n\nBut it’s not fixed — after a few more tool calls it breaks the same way again.\n\nIt moves when you say “go,” but the root cause hasn’t changed.\n\nWith the previous turn’s broken output in context, when a “resume” message gets inserted the model rebuilds the tool-call structure from scratch.\n\nSo the next single call goes through.\n\nThe broken context itself doesn’t disappear, so after a while it breaks again.\n\nThe reporter in Issue [#64150](https://github.com/anthropics/claude-code/issues/64150) writing “it repeated the same breakage 10 times” is the result of this cycle going on and on.\n\nThe moment you see court, tool calls in that session have become unstable.\n\nRather than trusting the one call that went through on “go” and continuing with file edits or git operations, cutting the session is safer.\n\n## The workaround is to keep sessions short\n\nThere’s no confirmed fix on the GitHub issues yet.\n\nWhat you can do locally comes down to not keeping a broken session alive.\n\nDropping the model is an option, but escaping to Opus 4.7 for the `court`\n\nproblem is a poor trade.\n\nOpus 4.7 has its own reported habit of skipping tool calls — the Opus 4.8 release notes mention fixing exactly that — and Notion disabling all Anthropic models rather than switching to 4.7 reflects that both 4.7 and 4.8 were off.\n\nIf you stay on Claude, Sonnet 4.6 is steadier, though it’s still not a confirmed fix for `court`\n\nitself.\n\nWhen `court`\n\nshows up in a long session, move to a new session first.\n\nDon’t leave unfinished work with Claude Code — offload it to git diff, a TODO file, or a work log.\n\nThis approach is a poor fit for always-on setups like [Wiring up Claude Code and Codex in tmux to build a game overnight (practice)](/en/articles/tmux-claude-codex-ai-loop-practice), but given the current issue shape, trusting long-lived sessions too much is the riskier move.\n\nOn the prompt side: keep the pre-tool explanation short, don’t pack multiple tool calls into one message, and split the operations you want to run into smaller pieces.\n\nThis isn’t a real fix, but in the issues, many reports fired on “long sessions,” “heavy editing,” and “tool calls in rapid succession.”\n\n[#63800](https://github.com/anthropics/claude-code/issues/63800) also reports that after about 2 hours of use it froze before a tool call and reproduced after a message ending in `let me ...`\n\n.\n\nIt’s not the same `court`\n\nsignature, but the form of stalling right before moving to a tool call in a long conversation is shared.\n\nI looked at Claude Code’s internal implementation and the Bun runtime before in [Claude Code’s full source exposed and OpenAI Codex’s token-theft vulnerability surfaced around the same time](/en/articles/claude-code-npm-sourcemap-codex-branch-injection).\n\nThis `court`\n\nisn’t a source leak or a local-tool vulnerability — it breaks at the boundary between model output and the harness.\n\nThe moment raw `<invoke>`\n\nshows on screen, attaching the session JSONL and the issue number and running `/bug`\n\nis more useful as information than chasing tool-side logs.\n\n## Update (2026-07-01)\n\nIt’s still happening on the latest build. The main issue [#64108](https://github.com/anthropics/claude-code/issues/64108) was still getting updates on June 30.\n\nThe stray leading token varies by environment. Besides `court`\n\n, people report `count`\n\n/ `courtesy`\n\n/ `courceforge`\n\n/ `courthood`\n\n; it isn’t always `court`\n\n.\n\nOn June 30 a new failure shape showed up, where a burst of broken tokens ends in `API Error: Claude Code is unable to respond to this request`\n\nand is rejected as a Usage Policy (AUP) violation.\n\nMore related issues keep opening. [#64658](https://github.com/anthropics/claude-code/issues/64658) reproduces “tool call could not be parsed” on Desktop 1.9659.4, and [#60584](https://github.com/anthropics/claude-code/issues/60584) is a separate malformed `tool_use`\n\nreport.\n\nTriggers are still long, high-context sessions; short tasks rarely hit it.\n\nFor a practical handoff, when you continue from a session that hit `court`\n\n, the conversation log (the JSONL) is itself corrupted by the stray tokens, so carrying it over is pointless. Have the model write the working state into a handoff Markdown file, then move to a fresh session.\n\nYou’d expect `/compact`\n\nto drop the broken parts and clear it, but the post-compact state is actually a common trigger, and compacting doesn’t resolve it.", "url": "https://wpnews.pro/news/court", "canonical_source": "https://lilting.ch/en/articles/claude-code-court-tool-call-hang", "published_at": "2026-07-12 18:24:37+00:00", "updated_at": "2026-07-12 18:35:11.734949+00:00", "lang": "en", "topics": ["ai-tools", "large-language-models", "ai-products"], "entities": ["Anthropic", "Claude Code", "Opus 4.8", "Opus 4.7", "GitHub"], "alternates": {"html": "https://wpnews.pro/news/court", "markdown": "https://wpnews.pro/news/court.md", "text": "https://wpnews.pro/news/court.txt", "jsonld": "https://wpnews.pro/news/court.jsonld"}}