[Bug] Repetition loop (`course。` spam) + English leakage + empty responses at tool-call boundary in long Japanese sessions

Status Open
Reported on v2.1.211
Maintainer reply None cached
Activity 0 comments · opened Jul 24, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Environment

  • Claude Code version: 2.1.211
  • Surface: Claude Desktop app (Windows) — official desktop app, not a custom wrapper and not the bare terminal CLI
  • Model: claude-opus-4-8
  • Primary interaction language: Japanese
  • Session length: Long single session (many turns, large accumulated context)
  • Reproducibility scope: Reproduced across two different machines, both using the same Windows desktop app
  • Not yet tested: bare terminal claude CLI — so it is unknown whether this is desktop-app-specific (tool-call I/O plumbing) or model/CLI-layer. A triager running the same repro on the bare CLI would isolate this.

Summary

In long Japanese-language sessions, when the assistant emits prose immediately before a tool call, its decoding sometimes collapses into a degenerate repetition loop emitting the literal token course。 many times. Related symptoms in the same failure mode:

  • English fragments leak mid-Japanese (e.g. "I'll run the check now", "I apologize, master").
  • Some turns produce no user-visible output at all (the app reports "response had no visible output").

The specific, consistent artifact token course at a consistent structural position (just before tool use) is a signature that looks bug-like rather than generic long-context degradation.

Reproduction (observed; see caveats)

Same session, three conditions were tried (n=1 each):

| Preface before tool call | course loop triggered? |
|---|---|
| Japanese preface, then tool call | ✅ occurred |
| English preface, then tool call | ✅ occurred |
| No preface (silent tool call only) | ❌ did not occur |

Additional observations:

  • Early in the session (short context), short Japanese prefaces before tool calls did not trigger it.
  • Frequency increased as context grew → context fill appears to be an amplifier.
  • Reproduced independently in a different session on a different machine (same model/config, Japanese usage) → systematic, not session-specific.

Expected behavior

Assistant emits normal prose, then a well-formed tool call.

Actual behavior

Assistant enters a repetition loop (course。course。…) around the tool-call boundary, sometimes leaking English fragments or producing empty output.

Workaround (reliable in-session)

  • Avoid: Emitting the tool call with no preceding text prevents seeding the loop.
  • Break an active loop: A silent tool call also breaks an already-active loop — once the tool result enters the context, attention shifts to it and the self-reinforcing repetition is disrupted. Prose after the result is clean.
  • Practical rule: Don't narrate before a tool call; explain after the result returns. Text-only turns (no tool anchor) are the most failure-prone.

Caveats / what is NOT established

  • Trigger is not cleanly isolated. The 3-condition table is n=1 per cell and confounded by monotonically growing context, so we cannot claim "any preface deterministically causes it." What is robust: the symptom reproduces, and the silent-call workaround reliably avoids/breaks it.
  • The root layer (desktop app tool-call formatting vs. model-level decoding attractor) is unknown from the user side.
  • Why the specific token is course is unknown. One hypothesis: a decapitated "Of course" pre-action affirmation leaking through — unverified.

Why this looks like a bug (not generic degradation)

Generic long-context degradation produces varied, messy failures. This is a specific token at a specific structural position, reproducible across machines — a clear signature pointing to a specific cause (likely a repetition-loop vulnerability being triggered by something consistent at the tool-use boundary).

What Should Happen?

Assistant emits normal prose, then a well-formed tool call.

Error Messages/Logs

Steps to Reproduce

  1. Start a long Japanese-language session in Claude Desktop app (Windows)
  2. Continue the session until context grows large (many turns)
  3. Have the assistant emit Japanese prose immediately before a tool call
  4. Observe the assistant output

Note: Trigger is not cleanly isolated (see "Caveats" section above).
The symptom and workaround are the reproducible parts.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.211

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗