[MODEL] Text output gradually drifts to English during code-heavy work, even when user communicates in non-English
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
I work with Claude Code in Japanese. During a session that involved a multi-step procedure (git rebase, running tests, investigating test failures, fixing code), I communicated with Claude in Japanese throughout.
What Claude Actually Did
As the session progressed into code-heavy work (reading source files, running test suites, investigating failures), Claude's text output progressively shifted from Japanese to English. The drift was gradual:
- Early session (greeting, reading procedures): Full Japanese responses ✅
- Mid session (running commands, reviewing results): Terse Japanese labels wrapping English content — e.g.,
"check 両方パス"(only one word is Japanese, the rest is English) - Deep investigation (tracing code flow across multiple files): Output became full English — e.g.,
"Found the root cause. finalizeInboundContext at line 42 does const normalized = ctx as T & MsgContext; — NO copy, it mutates the original."
The agent never self-corrected. It was completely unaware of the drift until the user pointed it out. When asked about it afterward, the agent initially downplayed the severity ("英語混じりになった" / "it became English-mixed") when the reality was that outputs were fully English.
Expected Behavior
Text output (status updates, reports, confirmations, explanations) should remain in the user's language throughout the session, regardless of whether the agent is deep in English-language code.
Code, technical identifiers, and tool invocations are naturally in English — that's fine. But the agent's communication to the user (the text between tool calls) should stay in the user's language.
Permission Mode
Accept Edits was ON (auto-accepting changes)
Can You Reproduce This?
Yes, every time with the same prompt
Steps to Reproduce
- Start a session in any non-English language
- Give the agent a complex multi-step coding task (e.g., rebase a fork, run tests, investigate and fix failures)
- Let the agent work through multiple rounds of reading code, running tools, and analyzing results
- Observe that text output between tool calls gradually shifts to English
- The more code-heavy the work, the faster and more complete the drift
Claude Model
Opus
Relevant Conversation
Early in session (full Japanese):
今生まれました。あなたのことは聞いています 🫡
俺は Claude Code 族の新入り。Opus 4.6。[...]
Mid session (minimal Japanese wrapping English):
check 両方パス。次、テスト並行実行。
Deep in code investigation (full English):
Found the root cause. finalizeInboundContext at line 42 does
const normalized = ctx as T & MsgContext; — NO copy, it mutates
the original. The flow:
1. Handler calls mocked finalizeInboundContext → returns input as-is
2. Handler calls recordInboundSession({ctx: ctxPayload}) → mock captures object by reference
3. dispatchReplyFromConfigWithSettledDispatcher → getReplyFromConfig → calls the REAL finalizeInboundContext(ctx) which mutates ctx.BodyForAgent
4. Test assertion sees the mutated object → timestamp present
This is a JS reference capture issue, only manifests with the fork's timestamp injection. Let me fix the test.
Impact
Medium - Extra work to undo changes
Claude Code Version
2.1.71 (Claude Code)
Platform
Anthropic API
Additional Context
How this differs from existing issues:
- Not compaction-triggered (unlike #11567, #25677, #13524): There is no context compression event. The drift happens during normal, uninterrupted work.
- Not plan-mode-triggered (unlike #32107): No plan mode exit or clear context involved.
- Not about thinking blocks (unlike #27051): This is about visible text output, not extended thinking.
Why this matters for non-English users:
The agent's text output between tool calls is the primary communication channel with the user. When it drifts to English during implementation work, status updates, reports, and confirmation requests become unreadable for users who don't speak English. The agent is effectively talking to itself rather than to the user.
What makes this particularly hard to fix from the user side:
- Adding
languageto settings or CLAUDE.md helps initially but doesn't prevent drift during code-heavy work - The user can remind the agent mid-session, but this is reactive — the user has to notice the drift first, and by then communication has already broken down
- The agent itself is unaware of the drift, so it cannot self-correct
✍️ Author: Claude Code with @carrotRakko (AI-written, human-approved)
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗