Output enters an infinite loop repeating the token "court"

Status Open
Maintainer reply None cached
Activity 3 comments · opened Jun 16, 2026

Description

During a long Japanese (LaTeX editing) session in the Claude Code VS Code extension, the assistant's text generation repeatedly collapses into an infinite loop, emitting the single word "court" hundreds of times instead of the intended response or tool call. Once it starts, it recurs across many turns within the same session.

Trigger / Pattern

  • Appears tied to generating Japanese prose immediately before or around a tool call (e.g. an Edit).
  • Workaround that often helps: emitting the tool call with zero preamble text.

Impact

  • Edits and replies get interrupted; the user must repeatedly stop generation.

Environment

  • Claude Code: VS Code extension
  • OS: Windows 11
  • Model: claude-opus-4-8
  • Frequency: started mid-session, recurred 10+ times.

Notes

Starting a fresh session appears likely to resolve it (session state seems to be a trigger).

View original on GitHub ↗

3 Comments

yutonano · 2 months ago

Same phenomenon here (Japanese sessions, tool-call preambles, claude-opus-4-8). I filed transcript-level occurrence data as #79011 — 37 bursts, all at ≥434k context, always replacing a tool call right after a prose preamble. Your "no preamble before tool calls" workaround matches the onset pattern in our data.

lovelark2000-spec · 2 months ago

Additional reproduction — Claude Code CLI, claude-opus-4-8, Windows 11

Confirming this on a long-running Claude Code CLI session. Same literal token court repeatedly injected into the assistant's prose. Sharing quantified data from the session transcript in case it helps narrow the trigger.

Environment

  • Claude Code CLI on Windows 11, model claude-opus-4-8
  • Heavy browser-automation session (MCP screenshot/computer tool), ~170 assistant turns

Symptoms

  • The bare word court is inserted into Japanese/English prose, frequently followed by an English self-correction (e.g. "Let me take the screenshot.").
  • Tool calls themselves are unaffected and continue to succeed.

Quantified from the session log (jsonl, 504 lines / 172 assistant messages)

  • Genuine injections: 26 occurrences across 13 messages, ALL after the 82% point of the conversation (turn 142 of 172). Zero before that.
  • At the first occurrence, the context had accumulated ~56 browser tool round-trips and 24 screenshot images.
  • No correlation with long text input (form typing); injections cluster specifically during screenshot-heavy computer cycles.
  • tool_result success rate 78/78 (0 errors) — the degeneration is limited to free-text generation, not tool execution.

Trigger hypothesis

  • Multimodal context bloat (many accumulated screenshots) crossing a threshold late in a long session. Consistent with the "large context / long session" pattern in #64404, #66950, #65823, #65791.

Workaround (confirmed)

  • Minimizing prose / switching to tool calls reduces but does not fully eliminate it within the same session; starting a fresh session clears it.

Happy to share more log detail if useful.

MatrixYoshinoTakuya · 1 month ago

I ran into the same issue.
I'm using Claude Code 2.1.258 via the CLI on Windows with Opus 4.8, working on a Unity C# project. After I asked Claude to rebase a git branch, it started repeatedly outputting the word "court" in its responses. Claude kept working on the task, but while it continued to spam "court", the rebase itself ultimately failed. After that, I switched models and the problem did not recur.