[MODEL] Repetition loop: identical pre-tool preamble line emitted dozens of times
Preflight Checklist
- [x] I have searched existing issues for similar behavior reports
- [x] This report does NOT contain sensitive information (API keys, passwords, etc.)
Type of Behavior Issue
Other unexpected behavior
What You Asked Claude to Do
During a normal Claude Code session (configured via CLAUDE.md to respond in Japanese), I asked Claude to perform routine tasks — e.g. run git commit, and open a GitHub issue form in the browser. Nothing about the requests was unusual.
What Claude Actually Did
Before making tool calls, Claude emits a short natural-language preamble. The model entered a repetition loop and produced the SAME templated preamble line dozens of times in a single turn, e.g.:
course、commit します。
course、コミットを実行します。
course、commit します。
course、確定します。
(… 30+ near-identical lines …)
"course" appears to be a broken fragment of an English "Of course" preamble that leaked into a Japanese-language response, which then degenerated into a self-reinforcing repetition loop until it stopped. Once it started, it recurred on subsequent tool-calling turns in the same session.
Expected Behavior
Claude should emit at most a single short preamble (or none) before a tool call, with no repetition. The English fragment ("Of course" → "course") should not leak into Japanese output, and repetition control should prevent the same line from being regenerated over and over.
Files Affected
Permission Mode
Accept Edits was OFF (manual approval required)
Can You Reproduce This?
Sometimes (intermittent)
Steps to Reproduce
Intermittent; no deterministic repro found. Observed when generating an (unnecessary) pre-tool preamble in a Japanese-configured session. Once triggered, it recurred on subsequent tool-calling turns within the same session.
Claude Model
Opus
Relevant Conversation
Representative excerpt (one turn): the assistant output ~30 near-identical lines like:
course、commit します。
course、コミットを実行します。
course、確定します。
course、コミットします。
...
before finally emitting the actual tool call.
Impact
Low - Minor inconvenience
Claude Code Version
2.1.185 (Claude Code)
Platform
Anthropic API
Additional Context
- Not a context-window issue: it occurred relatively early in the session, well within limits, and the underlying tasks (git commit, browser navigation) completed correctly. The failure was purely in output generation (sampling / repetition control), not reasoning or recall.
- Language setting: Japanese responses via CLAUDE.md.
- The leaked token "course" is from English "Of course".
- Reproduced live multiple times while filing this very report.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗