claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Replies drift into English right after reading English tool output, despite a CLAUDE.md rule requiring Japanese; corrections do not hold

Open noboru007 opened this issue 2 months ago • 25 comments

What happened

The user-level ~/.claude/CLAUDE.md says every reply must be in Japanese, and the session language setting also says to always reply in Japanese. In one long agentic session, the model (Opus 5.5, 1M context, Concise output style) sent several user-facing replies in English. They always followed turns whose tool output was English: an English specification document, English subagent reports, and English code-review output.

The user corrected it three times. After each correction, the next reply started in Japanese. It then slipped back into English within the same turn or the turn after. For example, right after the model wrote that it would reply in Japanese from then on, the same turn contained the English line "All gates pass. Now for the pre-commit review."

User's words (translated from Japanese): "You are still breaking the Japanese rule" and, twice, "What is your reason for completely ignoring the instruction in CLAUDE.md to speak Japanese?"

Expected

A reply-language rule in CLAUDE.md holds for every user-facing message, regardless of the language of tool results or subagent output read just before.

Repro (shape)

  1. Put a rule in ~/.claude/CLAUDE.md requiring replies in a non-English language (here Japanese).
  2. Run a long agentic session. Its turns read English material: specs in a cloned repo, subagent reports, and /code-review output that is partly English.
  3. Watch the language of the next short status message to the user, especially one-line progress notes written between tool calls.

Environment

  • Claude Code CLI on Linux, model claude-opus-5-5 (1M context), Concise output style, 2026-09-23.
  • The drift happened mostly in short progress lines ("the user hasn't heard from you" updates) and in the final summaries after reading English tool output.

noboru007 avatar Sep 23 '26 11:09 noboru007

It happened again in the same session, after this issue was filed.

The model had just filed this report on the user's instruction and answered in Japanese for a few turns. Then two things triggered English again. One was a turn whose tool output was English (a git commit, and an English HANDOFF edit in a Python heredoc). The other was the user writing a short Japanese message ("ローカルサーバーをFunnel経由で検証します。先にコンパクトします。"). The model's reply to that message was entirely English.

The user then asked (translated): "Do you understand why you should file a bug report again?"

So filing the report and the in-session correction did not change the behaviour. The drift seems to follow the language of the most recent tool output, even when that output is only a commit message or a code edit, and even though the user's own message was in Japanese.

noboru007 avatar Sep 23 '26 11:09 noboru007

Recurred again in the same session (2026-09-23, after compaction). CLAUDE.md requires Japanese for every reply to the owner; the output style also says "Always respond in Japanese". The model's final reports for two consecutive turns (after a long tool-heavy stretch of work, with Japanese tool descriptions and Japanese progress lines just before) were written in English. The owner had to point it out again with a one-word message ("jap"). Pattern: drift happens in the final summary after many tool calls, even when interim one-line status messages were in Japanese.

noboru007 avatar Sep 23 '26 12:09 noboru007

Recurred twice more in the same session (2026-09-23). After the model had just apologised in Japanese and promised Japanese, its next two short replies (explaining a blocked permission and correcting a mistyped URL) were in English. The owner had to write "日本語で" again. Pattern now also seen on short replies right after a denied tool call, not only on long end-of-task summaries.

noboru007 avatar Sep 23 '26 14:09 noboru007

Added your case to the list of CLAUDE.md non-compliance https://github.com/anthropics/claude-code/issues/13689, consider upvoting it for visibility.

marcindulak avatar Sep 24 '26 00:09 marcindulak

Reproduced the same issue. Sharing observations that may help narrow down the cause.

Environment: Linux (WSL2), Opus 5.5 (1M context), Concise output style, Japanese required by both CLAUDE.md and the language setting.

1. The CLI version made a difference

Claude Code Model Replies that came back in English
2.1.280 (several sessions on 2026-09-23) Opus 5.5 0-7% (3 of 141 in one session)
2.1.281 (2026-09-24) Opus 5.5 14 of 31 (45%)

The model has been Opus 5.5 since 09-23 and did not change. The regression started on the day we updated to 2.1.281. (This may help with the version-vs-model question left open in #96601.)

2. Switching the output style within the same session

Segment Japanese English
Concise 17 14
Default 4 0
Concise (switched back) 6 1
Default (second time) 4 0

English only appeared in the Concise segments. The counts are small.

3. Subagents did not drift, even under Concise

We gave the same English-reading task (summarize three English issues) to a named subagent and to a fork, under both Default and Concise. In all four runs, every reply and every thinking block was in Japanese.

4. The difference we could see

In the main session, every tool result and every user message ends with the English reminder "Concise output style is active. Be concise: lead with the result, skip preamble and narration, keep only what the user needs." That is roughly 90 times per session. The fork inherits the Concise system prompt, yet its transcript contains this reminder zero times. The main session under Default does not get it either.

Every reply that came back in English started right after this reminder. It also happened when no English tool output had just been read (a reply to a Japanese user message). Our working hypothesis: the trigger is not the Concise style itself, but the English reminder appended at the end of every turn. It would help if you could check whether the way this reminder is injected changed in 2.1.281.

Workaround: switching the output style to Default removes the reminder, and in our environment the drift to English stopped.

d-kishi avatar Sep 24 '26 12:09 d-kishi

Correction to my previous comment.

After switching the output style to Default, the same session still produced a reply in English. Right before it, the model had read a shell script containing about 60 lines of English comments. In the Default segment, the English reminder ("Concise output style is active...") is not appended.

So I am weakening the hypothesis in my previous comment. The Concise reminder may be one trigger, but it is not the only one. Long English text read right before a reply (whether tool output or the Concise reminder) seems to override the language instruction. The zero English replies in the Default segments were likely because no long English text was read in those segments.

The workaround in my previous comment (switching to Default) is not a reliable fix. It may reduce how often this happens, but it does not stop it.

d-kishi avatar Sep 24 '26 12:09 d-kishi

Same behaviour in the Claude desktop app (macOS), model claude-opus-5-5, Japanese required by both ~/.claude/CLAUDE.md and "language": "japanese" in settings.json, plus a UserPromptSubmit hook injecting the rule on every turn.

Counting one long session's transcript (replies with prose only):

  • CLI 2.1.280: 5 of 119 replies in English (4%)
  • CLI 2.1.281 (from 2026-09-24 20:46 UTC): 11 of 98 replies in English (11%)

Every English reply came right after reading English tool output or an English message from another session. The injected per-turn rule did not prevent it.

tkdesign-jp avatar Sep 25 '26 06:09 tkdesign-jp

Same on Hebrew (Linux, Claude Code CLI). Hebrew is required by both the project CLAUDE.md and the language setting.

I counted the final reply of each turn (code stripped, ≥30 letters) across 278 local transcripts of one project, only in sessions where the user wrote in Hebrew:

Model CLI Final replies In English
claude-opus-5 2.1.246–2.1.273 174 2 (1.1%)
claude-opus-5-5 2.1.280 164 14 (8.5%)
claude-opus-5-5 2.1.281 6 0
claude-opus-5-5 2.1.282 22 7 (31.8%)

About a 10× jump on switching to Opus 5.5, and 2.1.282 does not fix it (small sample). The trigger looks the same as in the other reports: a lot of English text read just before the reply (tool output, subagent reports, a long English CLAUDE.md and skill instructions).

sagizaidor avatar Sep 25 '26 08:09 sagizaidor

Same pattern here with Italian instead of Japanese: Opus 5.5 on macOS, Claude Code 2.1.282, Concise output style. The English shows up mostly in the one-line status notes between tool calls and after subagent reports, and a correction holds for the next sentence at most.

On my last 30 days of transcripts it's 0.3% English on claude-opus-5 and 15.3% on claude-opus-5-5. Opus 5 on 2.1.281 had 0 out of 82, while Opus 5.5 drifted on 2.1.280, 2.1.281 and 2.1.282, so for me it tracks the model more than the CLI version. Full breakdown in #96601.

paoloalby avatar Sep 25 '26 09:09 paoloalby

Same on Korean: Claude desktop app (Code tab, macOS), CLI 2.1.280–2.1.286. Korean is required in three places: "language": "ko", a custom output style written in Korean, and ~/.claude/CLAUDE.md.

I counted assistant text blocks in turns where I wrote in Korean. Main thread and interactive sessions only, code and paths stripped, ≥30 letters. A block counts as English when Hangul is under 15% of its letters.

Model Period All text blocks Final reply of turn
claude-opus-5 09-11 – 09-22 171 / 4,182 (4.1%) 28 / 1,614 (1.7%)
claude-opus-5-5 09-23 – 10-04 204 / 1,657 (12.3%) 8 / 528 (1.5%)

On Opus 5.5 the English is mostly short progress notes between tool calls: 13.1% (194/1,484) when the previous item was a tool result, against 5.6% (10/178) right after my own message. Still happening on 2.1.286 today.

hyeoksuhan avatar Oct 04 '26 07:10 hyeoksuhan

Same on Traditional Chinese (zh-TW): Claude Code CLI 2.1.286 on Windows 11. Chinese is required by the project CLAUDE.md and by a custom output style written in Chinese.

The clean part of our data is the model comparison: the same project, the same instructions and the same kind of work ran on several models over the last three weeks. I counted assistant text blocks in the transcripts (code blocks, inline code, URLs and file paths stripped; a block counts as English when it has at least 80 Latin letters and CJK characters are under a third of them; synthetic messages such as usage-limit notices excluded):

Model Text blocks English
claude-fable-5 4,489 0
claude-fable-5-1 434 0
claude-opus-5 1,152 0
claude-opus-4-6 267 2 (0.7%)
claude-sonnet-5-5 50 1
claude-opus-5-5 3,607 147 (4.1%)

By day there were zero English blocks before we switched to Opus 5.5 (2026-09-24). Today it peaked at 9.0% (40 of 445). Same shape as the other reports: mostly the one-line progress notes between tool calls, right after reading long English tool output (code, test runs, subagent and reviewer reports), and right after system-inserted turns such as task notifications.

A per-prompt UserPromptSubmit reminder did not stop it in our session either; the model slipped again in the very next reply. We have now added a PostToolUse hook that injects a one-line reminder only when the tool output is mostly English, since that is where the drift happens. Too early to report numbers.

Minijinai75 avatar Oct 06 '26 08:10 Minijinai75

Same on Korean, Claude Code CLI 2.1.292 on macOS, claude-opus-5-5[1m]. Korean is required on the first line of ~/.claude/CLAUDE.md ("all output, including one-line progress notes, in Korean; no English sentences") and in auto-memory.

One long tool-heavy session (Xcode/simctl builds, GitHub API, Athena/CloudWatch queries, Linear), counted the same way as the Korean comment above (code, inline code, URLs and paths stripped, ≥30 letters, English = Hangul under 15%):

Previous item English text blocks
tool result 54 / 107 (50.5%)
user message 5 / 19 (26.3%)
total 59 / 126 (46.8%)

The user corrected it four times ("영어쓰지마"). Each time the model apologized in Korean and promised Korean only, then the next progress line after a tool call was English again. It also slipped right after the session resumed from a compaction summary and after task notifications.

donghyun-mp avatar Oct 07 '26 07:10 donghyun-mp

Supporting data for the tool-output trigger, from a Korean-language setup (1,840 turns of transcripts, method in #99704).

Opus 5.5 ended 9.4% of turns in English, against 0.6% for Opus 5 and Fable 5.1 under the same configuration. The rate was 10.8% after a skill with English text had been loaded and 5.4% before, and 11% in turns with more than ten tool calls against 7% with one to ten. The drift usually appears first in the status lines between tool calls. Context length and compaction showed no relationship, which fits the reading that recent English tool output, not the distance to the instruction, pulls the language.

Full breakdown: https://github.com/anthropics/claude-code/issues/99704

AndrewDongminYoo avatar Oct 07 '26 08:10 AndrewDongminYoo

Same behaviour with German, so this is not specific to Japanese or Hebrew. My own report (#99603) was flagged as a duplicate of this one.

Environment: Claude desktop app (Code tab), Windows 11, Opus 5.5 and Sonnet 5.5. All user messages are in German. My global CLAUDE.md is written in German but has no explicit language rule, so this happens even without a "reply in language X" instruction.

Observed

  • Replies switch to English mid-session while the user keeps writing German.
  • After the switch, the session keeps answering in English instead of returning to German.
  • It shows up in long, tool-heavy sessions, which fits the pattern above of drift after English tool output.

I have not measured reply counts or compared CLI versions, so I can't confirm the 2.1.281 regression from my side.

Computerhof avatar Oct 07 '26 08:10 Computerhof

I have the opposite problem, my rules specify all replies must be in English, but when working on a codebase using a lot of domain terms and comments that are not in English, it switches to that language when replying to the user.

S-Luiten avatar Oct 15 '26 11:10 S-Luiten

Data point from a Traditional Chinese (zh-TW) user — Windows, Claude Desktop Code tab, 427 sessions (Apr–Oct 2026)

We classified every user-visible assistant segment — text blocks plus the progress-update ("narration") thinking blocks that Opus 5.5 / Fable 5.1 emit between tool calls — across 427 interactive sessions (15,890 segments; resume/fork duplicates removed by uuid; headless and scripted turns excluded). The user's global instructions require Traditional Chinese for everything user-facing.

Model English share of user-visible segments Turns ending in English
claude-opus-5-5 23.8% (1,092 / 4,584) 2.1% (13 / 632)
claude-fable-5-1 6.6% (<1% in Sep → 12% in Oct) 1.0% (5 / 504)
claude-opus-5 1.7% (32 / 1,873) 0.3% (1 / 342)
claude-fable-5 0.7% (20 / 2,814) 0% (0 / 603)
claude-opus-4-7 0.2% (3 / 1,589) 0% (0 / 283)

Where it happens (Opus 5.5 unless noted):

  • Between tool calls, not when answering. The first segment after a user message is English ~5% of the time; a segment right after a tool result is English ~27% of the time (~10–14% even when the previous segment was Chinese).
  • More tool calls in the turn, more drift: 6.5% with 0 tool calls → 31% with more than 50.
  • Segments written without private thinking in the same response: 33% English. Across all models, segments after ≥2,000 thinking tokens are ~1% English, and when the stored thinking was in Chinese, 0 of 697 following segments were English.
  • Concentrated in a few sessions (the 9 most-affected sessions hold half of all English segments), and corrections don't stick: in sessions where the user had already explicitly asked for Chinese, later segments were still 16–19% English (all models).
  • Effort (small n, not significant): high 28.7% (69 sessions), xhigh 5.4% (4), max 14.2% (10).
  • Context length: no clear relationship (too few compactions to say anything about them).
  • The silent-turn reminder is not the cause: it has existed since late August, when no model drifted, and segments right after it are not more English than other mid-turn segments at the same tool depth. (How it interacts with progress-update blocks: #102697)

Workaround that holds up on replay: a Stop hook that classifies last_assistant_message; when it is entirely English (≥12 English words, no Chinese) and the user didn't ask for English, it returns hookSpecificOutput.additionalContext saying a Traditional Chinese version is needed, and the model restates it. Replayed over 2,725 historical turns it would fire on 15, with zero false positives, and it covers all 5 turns where the user complained. It can't help with mid-turn progress notes; we're A/B-testing a PostToolBatch reminder for those and will report back.

TipsyDrifter avatar Oct 16 '26 09:10 TipsyDrifter

Data point from a Russian-language setup (macOS CLI, "language": "ru" plus a global CLAUDE.md rule). Main-thread transcripts since 2026-09-01; a text block counts if it has >= 30 letters after removing code, URLs and paths; English = Cyrillic under 10% of letters.

Model Sessions (>= 20 blocks) with >= 5% English English text blocks
claude-opus-5-5 3 / 107 182 / 11,621 (1.6%)
claude-opus-5 2 / 34 101 / 3,611 (2.8%)
claude-fable-5-1 0 / 41 2 / 2,561 (0.1%)
  • Concentrated in a few long, agent-heavy sessions; in the worst one 87 of 166 text blocks (52%) were English.
  • Self-reinforcing: after an English block the next is English 62.5% of the time, after a Russian one 0.5%.
  • The user's format rules lapse together: blocks that open with the timestamp our rules require are 0.7% English, blocks that don't are 7.7%.
  • Progress-update thinking blocks between tool calls are 0.5% English on Opus 5.5 here.
  • A hook re-stating the language on every prompt and every 5 minutes of tool calls did not prevent it.

yartemlee avatar Oct 25 '26 21:10 yartemlee

Data point from a Persian setup, with live numbers for a Stop hook. So far this thread has a replay of that idea (from TipsyDrifter), not a live run.

Setup: Claude desktop Code tab on macOS, Claude Code up to 2.1.309, and an "always reply in Persian" rule in ~/.claude/CLAUDE.md. Counted the same way as the Russian data point above: main-thread interactive sessions; a text block counts if it has >= 30 letters after removing code, URLs and paths; English = Arabic-script letters under 10%.

Opus 5.5 only 1 Sep – 22 Oct, no global rule 23 – 24 Oct, global rule Since 24 Oct 23:18 UTC, rule + hook
Last text of a turn in English 34.8% of 4,106 14.9% of 583 7.1% of 772
All text blocks in English 69.3% of 10,243 37.6% of 866 25.0% of 1,162

This is not a controlled comparison: the middle window is two days, the work mix changed, and the counts include English-facing work such as drafting English documents.

The hook blocked 44 times in 18 sessions, and the next text was Persian all 44 times.

How it works (about 110 lines of Python, local, no model call):

  • It takes all assistant text since the last human message and removes code, URLs, paths, link targets and quoted lines.
  • If at least 15 words remain and under 30% are Persian, it returns {"decision": "block", "reason": ...}, asking for a rewrite and no new tool work.
  • It blocks once per stop (stop_hook_active), skips headless runs (entrypoint sdk-cli), and fails open.

The 30% word share matters, because a Persian reply full of English technical terms must pass.

What it does not fix: notes between tool calls stay out of its reach, and the user still sees the English draft before the rewrite.

Ask: the harness could run this check for everyone, tied to the language setting, so that users do not each have to write a hook.

SinaEstavi avatar Nov 02 '26 01:11 SinaEstavi

Measurements from replaying a real session where this happened, in case they help narrow it down.

Setup

  • Claude Code 2.1.318 driven through the Agent SDK from a VS Code extension, Windows 11, claude-opus-5-5, effort medium. User-level CLAUDE.md is Japanese and requires Japanese replies.
  • In one session the model sent four short status lines in English. All came right after English input mid-turn: a subagent report, an English "say in a few words what you're doing" harness nudge, or a SendMessage call in which the main agent had just written an English brief to a subagent.
  • Method: copy the session transcript, cut it just before one of those English replies, and regenerate that reply with --resume <copy> --fork-session. The system prompt is taken verbatim from the recorded request. The only thing changed between variants is one line of the user-level CLAUDE.md inside the copy (or one injected sentence). Scoring: share of Japanese characters in the reply; under 50% counts as English. Fisher's exact test, two-sided.
  • Synthetic prompts did not reproduce the drift at all (0 English in 40 runs, also with tools enabled). Only the real transcript did. Of two real scenes, one reproduced (the reply after the English SendMessage brief) and one did not (0/10).

Results (the reproducing scene, 100 runs per condition)

The original rule was: "Progress, questions and reports to the user are in Japanese. Code, identifiers, raw logs, delegation briefs and saved files may be in English." (translated)

Rule line English replies
original 15/100
original + "do not switch even if what you just read is English" 19/100
a longer rewrite containing several clauses 8/100
original, with the allowed-English list replaced by "English is allowed only for what someone other than the user reads (briefs to subagents, code, identifiers, commits, saved files) and for verbatim quotes" 1/100 (p = 0.0003 vs original)
  • What worked was defining the allowed-English part by who reads it instead of listing kinds of text. The "don't be swayed by English input" sentence had no effect. Adding more clauses on top diluted the one that worked.
  • The original list included "delegation briefs", and the drift came right after the model wrote one. That fits the reading that the model carries the "English is allowed here" mode over into the next user-facing line. This is an interpretation, not measured.

Where an injected sentence goes matters (same scene, original rule, 100 runs each)

Same sentence T ("text the user reads, including short status lines, is written in Japanese even if the preceding report, brief or output is English"), placed four ways:

Placement of T English replies
none 15/100
extra line in CLAUDE.md 7/100
PostToolUse hook additionalContext (arrives as a mid-conversation system-role message) 6/100
appended as plain text to the SendMessage tool_result content (user side) 0/100
same, but wrapped like a hook reminder (<system-reminder> + "hook additional context:") 1/100
  • CLAUDE.md vs late hook: no difference (p = 1.0). Position alone did not matter.
  • The same text in the same place worked better inside the tool result (user side) than as a system-role message (0/100 vs 6/100, p = 0.029). The wrapper text made no difference (1/100 vs 0/100).
  • From the recorded requests: PreToolUse/PostToolUse/UserPromptSubmit additionalContext was sent as a system-role message without the <system-reminder> wrapper. Stop-hook context was sent user-side with the wrapper.
  • With the "who reads it" sentence as the hook text, the hook alone reached 0/100 even on top of the original rule (p = 0.00004).

Limits

  • One scene, one model, one effort level. The drift before any English delegation (reported by others here and seen by us in the past) was not tested.
  • The replay used a reduced tool list, so earlier thinking blocks were dropped by the API.
  • Why system-role context is followed less than user-side text is not known. It may be worth checking on your side, because hooks are the documented way to add this kind of reminder.

What we run now: the "who reads it" sentence in CLAUDE.md, plus the same sentence as a PostToolUse (Agent|SendMessage|TaskOutput) and UserPromptSubmit hook.

murooka-t avatar Nov 05 '26 00:11 murooka-t

Two clarifications to my comment above, and the workaround in a form you can try.

Clarifications

  1. The rule I fixed had an allowed-English list. Most rules in this thread are just "reply in X". Mine also said that code, raw logs, delegation briefs and so on "may be in English", and the drift came right after the model wrote an English delegation brief. What worked was replacing that list with a definition by reader. I have not measured the effect on a plain "reply in X" rule. Still, the same definition injected by a hook reached 0/100 on top of the original rule, so adding the definition is worth trying even if your rule has no such list.
  2. Thinking was missing in the replay. The replay used a reduced tool list, so the API dropped earlier thinking blocks. TipsyDrifter's data above shows almost no English after long thinking (~1%). My 15/100 baseline may therefore be on the high side for a live session.

Workaround you can try

1. Define English by who reads it in ~/.claude/CLAUDE.md, in your language. Translated:

Text for the user is in . English is allowed only for what someone other than the user reads (briefs to subagents, code, identifiers, commits, saved files) and for verbatim quotes.

2. Inject the same sentence with a hook at the points where the drift starts. This does not block anything; it only adds context.

settings.json:

"hooks": {
  "UserPromptSubmit": [
    { "hooks": [ { "type": "command", "command": "node ~/.claude/hooks/reply-language-reminder.mjs", "timeout": 5 } ] }
  ],
  "PostToolUse": [
    { "matcher": "Agent|SendMessage|TaskOutput",
      "hooks": [ { "type": "command", "command": "node ~/.claude/hooks/reply-language-reminder.mjs", "timeout": 5 } ] }
  ]
}

reply-language-reminder.mjs:

const REMINDER = "<the sentence from step 1, in your language>";
let input = "";
process.stdin.setEncoding("utf8");
process.stdin.on("data", (c) => { input += c; });
process.stdin.on("end", () => {
  let event = "";
  try { event = JSON.parse(input).hook_event_name ?? ""; } catch {}
  if (event !== "PostToolUse" && event !== "UserPromptSubmit") return;
  process.stdout.write(JSON.stringify({ hookSpecificOutput: { hookEventName: event, additionalContext: REMINDER } }));
});
  • UserPromptSubmit also fires when a background subagent reports back, which is one of the trigger points.
  • Add other tools to the matcher if your drift follows them (for example Bash or Read output). I only measured the SendMessage case.
  • This context arrives as a system-role message, which was the weaker channel in my measurement (6/100 with a weaker sentence vs 0/100 inside the tool result). With the "who reads it" sentence it still reached 0/100. A sentence of the "don't be swayed by English input" kind did not hold up as well (6/100), so the wording matters more than the hook.
  • The Stop-hook rewrite described above is a fallback that catches what slips through. It cannot prevent the English draft from being shown first.

murooka-t avatar Nov 05 '26 00:11 murooka-t