This is an English version of an article first published in Japanese on Zenn.
Introduction
This article started from one annoyance: Claude Code suddenly replying in English. The improvement I arrived at was neither to ask for what I wanted nor to forbid what I didn't want, but to define where the unwanted thing is allowed.
I think this method may work not only for the problem this article takes up, replies switching to English, but for other cases where an AI does something you don't want. Anthropic's official prompting guide (Prompting best practices) also advises telling Claude what to do instead of what not to do. A sentence that defines where something is allowed is one way of saying what to do. That said, what I checked in this article is one scene of one problem. Below is what happened in that scene and what worked.
Here is the annoyance. You are talking to Claude Code in your own language, and partway through a session it suddenly replies in English. It happens even when your CLAUDE.md tells it to reply in that language.
My language is Japanese, but this is not a Japanese problem. Users writing in Korean, French, Spanish, German and Brazilian Portuguese have filed similar reports on Claude Code's GitHub. Most describe the same thing: despite a language setting or a language rule in CLAUDE.md, replies switch to English mid-session.
It happened in my setup too. In one session where Claude was handing feature work to subagents and running reviews, its replies to me switched to English 9 times. Not only short waiting lines: long reports on the results of the work came back in English too. Claude itself had not noticed until I pointed it out. It apologized and went back to Japanese, and later in the same session another English line appeared.
It was not only that session. On another day, after I wrote "in Japanese, please," 8 more replies came in English; about two hours later I wrote "it's English again," and English replies kept coming after that too.
In this article, I take the real session log, cut it right before an English reply, and have Claude regenerate that reply many times while changing how the CLAUDE.md line is worded, counting what worked and what didn't. The short version: the request to reply in Japanese was in CLAUDE.md from the start, and adding a prohibition ("do not change this even if what you just read is in English") did not reduce the English replies. What worked was one sentence that sets the range where English may be used.
Measurement conditions for this article: Claude Code 2.1.318, Claude Opus 5.5 (effort medium). I used only one scene from a real conversation that had turned English, and had Claude regenerate the same reply 100 times per condition and counted (only the first two wordings I compared were run 60 times each first, then extended to 100). I have not generalized to other scenes or other models.
The original CLAUDE.md line
All the CLAUDE.md and hook sentences quoted in this article are my wording: the original is Japanese, and what you see here is an English translation. Where they say "Japanese," substitute your own language.
Originally, I had this line in my user-level CLAUDE.md (~/.claude/CLAUDE.md, the one that applies across all my projects; it was CLAUDE.md, not .claude/rules).
Progress, questions and reports for the user are in Japanese. Code, identifiers, raw logs, delegation instructions and saved artifacts: English allowed.
In my setup, the Claude I talk to (the main agent) splits up the work and hands the actual work to other AIs (subagents). "Delegation instructions" in the line above means the instructions the main agent writes when it hands work to a subagent, and "saved artifacts" means notes and records saved to files.
The main agent and subagents talk to each other in English to save tokens. Code, identifiers and logs are already in English, so this also avoids mixing languages. To allow it, the second sentence, "Code, identifiers, raw logs, delegation instructions and saved artifacts: English allowed.", listed what may be in English.
What I found (in the one measured scene)
The results first.
What to write (in CLAUDE.md)
How the CLAUDE.md line was written |
English replies (original wording: 15/100) |
|---|---|
| Added a caution: "don't be swayed by the English you just read" | 19/100 (no decrease) |
| Replaced the English-allowed sentence with one sentence that decides by "who reads it" | 1/100 |
| Deleted the English-allowed sentence entirely | 7/100 (some remained; the drop is not distinguishable from chance) |
I suspected the sentence allowing English was reaching too far, so I deleted it entirely. Even then, 7 replies in 100 were still in English. The English-allowed sentence does not seem to be the only cause.
One more finding: the same sentence worked differently depending on where it was placed.
Where to write it (the same caution sentence compared; Result 3)
| Where the caution sentence was placed | English replies (without it: 15/100) |
|---|---|
Added to CLAUDE.md
|
7/100 |
Passed via a hook's additionalContext
|
6/100 |
| Written inside the tool result right before the reply | 0/100 |
This table uses a different sentence from the caution in the table above: "Body text the user reads (including short progress lines) is written in Japanese even if the preceding report, instruction or output is in English." The "who reads it" sentence was near 0 both in CLAUDE.md and via a hook, which hides any difference between placements, so I compared with this sentence, whose effect is middling (hooks and additionalContext are explained in the next section).
A form you can try right away
There is one thing to do. If your CLAUDE.md has a sentence listing what may be in English, replace it with one sentence that sets the English-allowed range by "who reads it." In the measured scene (scene 1, described below), that alone took 15 in 100 down to 1 (details in Result 1).
The one line I keep in CLAUDE.md:
Progress, questions and reports for the user are in Japanese. English is allowed only for things read by someone other than the user (instructions to the assignee, code, identifiers, commits, saved artifacts) and for quotes of original text.
"The assignee" is my word for a subagent. Replace it with whatever you call subagents, and "Japanese" with your own language. English instructions to subagents (saving tokens) can stay as they are with this wording.
Note that what I measured was replacing a sentence that lists what may be in English with this one. I did not measure adding it where no such sentence exists.
On top of this, I also pass the same content through a hook. A hook is a mechanism that runs a handler you configure every time Claude Code performs a certain action. After noticing the switch to English, I had added a hook that passed a caution, and I switched its text to the same content. In the measured scene, passing the same content through a hook gave 0 in 100 (Result 2). However, that measurement was on top of the original wording, a different base from the CLAUDE.md sentence's 1/100, so I can't say which is better, and I did not measure the two together either.
The one line I pass via the hook (in additionalContext, on PostToolUse for Agent|SendMessage|TaskOutput and on UserPromptSubmit; only the PostToolUse part was measured. additionalContext is a field that adds one piece of text for the model to read without stopping anything, and the two hook events are explained in Result 2):
Body text for the user is in Japanese. English is allowed only for things read by someone other than the user (instructions to the assignee, code, identifiers, commits, saved artifacts) and for quotes of original text.
Result 3 below suggests that a hook return field that rewrites the tool result itself (such as updatedToolOutput) might work better than additionalContext. According to the official hooks documentation, this field changes only what Claude sees; however, the replacement must match that tool's output shape, or it is ignored. I haven't tried it yet, so for now I'm staying with additionalContext.
How I measured it
What kind of replies turned English
Of the 9 English replies, 5 were short progress lines and the other 4 were long reports on the results of implementation or checks (the longest about 2,000 characters). Most came right after a subagent's English report, the English output of a command, or an English nudge from the system ("No reply for a while, so just one line"). There was also one case where the reply right after my own Japanese message was in English (Claude's reply just before that had been in English).
First hand-built scenes, then the real conversation log
At first I thought the CLAUDE.md line was simply loosely written. The original wording names what must be in Japanese by kind ("progress, questions and reports"), and does not say which of those a short line written while waiting falls under. It says nothing about the case where what Claude just read was in English. And the English-allowed sentence is more specific and longer. So I rewrote it as follows (a "decision card" is a fixed-format report I use when asking the user to decide).
All body text the user reads is written in Japanese, regardless of length or kind (a one-line progress update, a reply to a nudge, a decision card, a final report). Do not change this even if what you just read (the assignee's report, tool output, a system nudge) is in English. English is allowed only for things read by someone other than the user (instructions to the assignee, code, identifiers, commits, saved artifacts) and for quotes of original text.
To check whether it helped, I first used scenes built by hand: right after a subagent's report, right after an English nudge, a scene where Claude's own previous reply was English, and a task reading English code. I wrote a summary of the earlier conversation and the text of a subagent's report or a nudge by hand, and passed it to an isolated claude -p (it did not read CLAUDE.md; the same line went into the system prompt, and only that line was swapped).
The result: with the original wording and with the rewritten wording, all 40 runs came back in Japanese. With no English replies, the hand-built scenes could not tell which wording was better.
So next I checked with the log of the conversation that had actually turned English.
Replaying the conversation log, cut right before the English reply
Claude Code keeps a file recording each conversation (jsonl). I took a copy, cut it right before the reply that turned English, resumed the conversation from there, and had Claude produce the same reply again (--resume --fork-session). The original log is never touched; only the copy is used.
The only thing changed per condition was the one CLAUDE.md line inside the log (apart from the file on disk, the content of CLAUDE.md sits in the log as a message on the user's side at the start of the conversation). One replay run did the following:
- Make a cut copy of the log. From the log, take only the chain of conversation leading to the English reply, and cut it just before the input that triggered that reply (in scene 1, described below, the notification that a subagent's report had arrived).
-
Swap the
CLAUDE.mdline inside the copy. Replace theCLAUDE.mdline inside the copy with the condition's sentence. - Keep the resume notices from appearing. On resume, the CLI may add notices like "CLAUDE.md is no longer present," "MCP disconnected," "tools are no longer available," or "the environment changed." I kept the text the model had seen as it was, and only emptied the bookkeeping fields in the copy (the list of instruction files loaded, the lists of added MCP servers and tools, and environment information such as the working folder), or set them to the replay's state, so these did not appear.
- Keep the system prompt and the rest as in the original. This session's log also held what was sent in each API request (I have not checked whether every way of launching keeps it). From that original request, I took the system prompt verbatim (17,985 characters). The model and effort were the same, and the triggering input was passed exactly as in the original request.
- Resume from the copy and count the reply's language. Resume in the form below and take the first text produced. Excluding code, compute the ratio of Japanese characters to Latin letters (4 Latin letters count as 1), and count it as "English" if Japanese is under half. I repeated this 100 times per condition.
claude -p --resume <copy's session ID> --fork-session \
--model <original model> --effort <original effort> \
--system-prompt-file <original system prompt> \
--setting-sources project,local --strict-mcp-config --disable-slash-commands \
--tools "<tools to allow>" --max-turns <count> \
--input-format stream-json --output-format stream-json --verbose
With --fork-session, the resumed conversation continues under a new session ID.
Another difference from the real thing, besides step 3: I narrowed the tool list (scene 1 got no tools at all). Because of that, the in-progress thinking from earlier was not carried over.
With this, I replayed two scenes that had turned English.
-
Scene 1: right after receiving a subagent's report and sending English instructions to the next subagent with
SendMessage. After that call's result came back, a notification that a subagent's report had arrived came in, and the next reply was English → the switch to English reproduced. - Scene 2: right after a notification from a command run in the background (Claude's own previous message was in Japanese) → 0 of 10; it did not reproduce.
All numbers below are from scene 1.
Result 1: What worked was not the caution but the sentence that sets the range
The rewritten wording changed several parts of the original, so to separate which part mattered, I made versions that changed only one thing from the original wording, and replayed each 100 times without a hook.
- Caution version: add "Do not change this even if what you just read (the assignee's report, tool output, a system nudge) is in English." to the original wording (the English-allowed sentence stays)
- Range version: replace "Code, identifiers, raw logs, delegation instructions and saved artifacts: English allowed." in the original wording with "English is allowed only for things read by someone other than the user (instructions to the assignee, code, identifiers, commits, saved artifacts) and for quotes of original text."
- Instruction-only version: delete the English-allowed sentence entirely, leaving only "Progress, questions and reports for the user are in Japanese."
| Wording | English replies |
|---|---|
| Original wording | 15/100 |
| Rewritten wording (all changes) | 8/100 |
| Instruction-only version (English-allowed sentence deleted) | 7/100 |
| Caution version | 19/100 |
| Range version | 1/100 |
I used Fisher's exact test (two-sided) to see whether a difference could be explained by chance. The p-value is a measure of "how likely a difference this large would be from chance alone if there were really no difference"; the smaller it is, the harder the difference is to explain by chance. Below 0.05 is a commonly used threshold.
- Range version vs original wording: p=0.0003. A difference hard to attribute to chance.
- Caution version vs original wording: p=0.57. No evidence of a difference.
- The range version did better than the rewritten wording with all changes (p=0.035). The other sentences added may have diluted the range sentence's effect.
- The instruction-only version was 7/100, and neither vs the original wording (p=0.112) nor vs the range version (p=0.065) did it reach 0.05 on its own.
Lined up, the order is listing what's English-allowed (15) → not writing what's English-allowed (7) → setting the range by who reads it (1). Just deleting the English-allowed sentence roughly halves it, and setting the range lowers it further; that is the direction. Still, deleting the English-allowed sentence leaves 7/100, so the English-allowed sentence is not the only cause of the switch to English.
Before measuring, going by my sense of using it, I thought the caution version alone would be enough, and the main agent Claude also picked it as the favorite. The result was the opposite: only the range version worked, and the caution version was even slightly worse. Between the caution version and the range version, I had picked the one that didn't work; you really can't tell without measuring.
Looking at the content of the English replies, the 19 English replies under the caution version included not only one-line waiting messages but also many progress reports conveying the gist of the work in a few sentences.
With few runs, you badly misjudge the gap
Before this breakdown, I compared the original and rewritten wording at 60 runs each. At 20 runs it looked like 4/20 vs 1/20, a 4x gap, but at 60 runs it was 10/60 vs 5/60, shrinking to about 2x, and at 100 runs it was still about 2x. When a small number of runs shows a big gap, it seems better not to rely on it.
Result 2: Passed via a hook, the same content still decided it
Separately from the CLAUDE.md line, I also tried a hook. In my real setup, I hook into two points and pass one line of text.
-
PostToolUse: right after a tool finishes. Limited to the tools used to talk to subagents (
Agent,SendMessage,TaskOutput). - UserPromptSubmit: when input is received. I confirmed within that conversation that this also fires when a subagent's report arrives.
The text is passed in the additionalContext field described in "A form you can try right away." In the replay, however, the hook did not actually run; I added records of the same shape as the PostToolUse hook records in the real session after the copy's last tool result. So I measured only the text passed at PostToolUse; the text passed at UserPromptSubmit was not measured.
On top of the original wording, I compared hook texts (100 runs each).
| Condition | English replies |
|---|---|
| No hook | 15/100 |
| Hook passing the caution sentence: "Body text the user reads (including short progress lines) is written in Japanese even if the preceding report, instruction or output is in English." | 6/100 |
| Hook passing the range sentence: "Body text for the user is in Japanese. English is allowed only for things read by someone other than the user (instructions to the assignee, code, identifiers, commits, saved artifacts) and for quotes of original text." | 0/100 |
- Range sentence vs no hook: p=0.000035
- Range sentence vs caution sentence: p=0.029
- Caution sentence vs no hook: p=0.063 (it decreased, but this is at the border where it can't be told apart from chance)
Even through a hook, it was the range-setting content that worked. With the range sentence, the reply almost never turned English, whether it was written in CLAUDE.md (1/100) or passed through a hook (0/100).
Result 3: The same sentence worked differently depending on where it went
The caution sentence passed via the hook in Result 2 differs in wording from the one added to CLAUDE.md in the caution version (19/100). So I used the hook's caution sentence with exactly the same wording and changed only how it was inserted (on top of the original wording, 100 runs each). The range sentence is near 0 in both CLAUDE.md and the hook, which hides any difference, so I used this sentence, whose effect is middling.
Before reading the table, a note on the "role" of the messages Claude receives. Each message in a conversation has a role: the system role is treated as instructions given from outside the conversation, and the user role is messages from the user's side. Tool results also arrive on the user side. And the content of CLAUDE.md, as the official docs say, arrives as a user message after the system prompt (in this conversation's log it was user too). "Right before the reply" in the table means around the last tool result before the reply (the SendMessage result). In scene 1, one notification of a subagent's report comes after it, and the reply follows.
| How the hook's caution sentence was inserted | Role (as seen in the recorded request) | Position | English replies |
|---|---|---|---|
| Not inserted | — | — | 15/100 |
In CLAUDE.md: add it as one line to CLAUDE.md at the start of the conversation |
user | Start of the conversation | 7/100 |
Via hook: insert it right after the tool result, as the hook's additionalContext (the same measurement as the caution-sentence hook in Result 2) |
system | Right before the reply | 6/100 |
In the result body: append it as plain text to the end of the SendMessage result body |
user (inside the tool result) | Right before the reply | 0/100 |
Marked, in the result body: at the same place, append it wrapped in the same marker and header as the hook (the <system-reminder> tags and the header "PostToolUse:SendMessage hook additional context:") |
user (inside the tool result) | Right before the reply | 1/100 |
First, the difference inside CLAUDE.md. The caution version (19/100) and the hook's caution sentence added to CLAUDE.md (7/100) both mean "don't be swayed by the English just before," yet they differed at p=0.019. The two differ, however, not only in wording but also in placement (the caution version was inserted inside the original line, before the English-allowed sentence; the hook's caution sentence was added as a separate line after the original line). So even with the same intent, the effect changed with the wording or the placement. Note that the hook's caution sentence in CLAUDE.md (7/100) vs nothing added (15/100) is p=0.112, which cannot be told apart from chance.
Next, the difference in how it was inserted.
- In
CLAUDE.mdvs via hook: p=1.0. Different role and different position, but no visible difference. - In
CLAUDE.mdvs in the result body: p=0.014. Both user role, yet they differed. - In the result body vs via hook: p=0.029.
- Marked in the result body vs in the result body: p=1.0. Wrapping in the marker and header did not weaken it.
- Marked in the result body vs via hook: p=0.118. This difference on its own can't be told apart from chance.
What separated the strong group from the weak one was whether it was written inside the tool result, right before the reply. Role alone doesn't explain it, since the user-role "in CLAUDE.md" is in the weak group. Position alone doesn't either: the via-hook version was also right before the reply, yet got 6/100. However, this experiment cannot separate whether what worked was "being on the user side right before the reply," "being part of the tool output," or both. The in-the-result-body version is confounded with "looking like part of the SendMessage output."
I'll also note what I observed about how the hook was sent. Looking at the request recorded in the log, in this version of Claude Code the additionalContext of PreToolUse, PostToolUse and UserPromptSubmit was sent as a system-role message, without the <system-reminder> wrapper (Stop's additionalContext was user role, with the wrapper). The official hooks documentation says additionalContext is wrapped as a system reminder and goes next to the tool result for PreToolUse and PostToolUse, and alongside the submitted prompt for UserPromptSubmit. What I saw differs from that, and may change between versions. Whether this difference matters for the effect cannot be said from these results.
What was happening in my setup
As described in "The original CLAUDE.md line," the English-allowed sentence in the original wording was an exception I added for the English exchanges with subagents. My first guess was that this exception was reaching too far, into the replies meant for me. But as Result 1 shows, deleting the English-allowed sentence entirely still left 7/100, and even back when I didn't have subagents talk in English, replies sometimes suddenly came back in English. The exception may be one contributor, but it is not the only cause.
Why did the range sentence work? (My reading)
From here on it's my reading; the mechanism is unverified.
The original wording listed, one by one, what may be in English, and that list included instructions to subagents ("delegation instructions" in my wording). Scene 1, where the reply turned English, was right after Claude wrote English instructions to a subagent. The work just before was on the "English allowed" side, so, I think, Claude carried on in English into the reply meant for me.
When, instead of a list, the sentence sets the range ("English is allowed only for things read by someone other than the user"), the reply to me is clearly outside that range. So even right after English work, it was less likely to be carried along. Read that way, the results make sense.
That said, the replacement sentence also changed some of the items in the parentheses ("raw logs" was dropped, "commits" and "quotes of original text" were added, and "delegation instructions" became "instructions to the assignee"). So this comparison cannot separate whether what worked was setting the range by "who reads it" or the change in items and phrasing.
One more thing: in CLAUDE.md, the caution "don't be swayed by the English just before" did not work, while the sentence that sets the range did. But this is one comparison, and the two sentences differ in wording and length. A caution with the same intent, the hook's caution sentence added to CLAUDE.md, got 7/100 (though vs 15/100 with nothing added, p=0.112, which can't be told apart from chance). So "a sentence that sets the range works better than a 'don't do X' caution" is, for now, a hypothesis.
Setting the exception's range by who reads it seems better than not writing the exception at all. From this one scene, that's about as far as I can go.
Related research
Around the same time, Tsuchida et al., "Do Coding Agents Follow AGENTS.md? The Effect of Policy Wording on Instruction Compliance" (arXiv:2611.04367) came out. It puts one rule in AGENTS.md / CLAUDE.md in four wordings (prescriptive, with a reason, conditional, prohibitive) and compares how often coding agents followed it. This article's "instruction-only version" corresponds to the paper's prescriptive wording.
That compliance varies a lot with wording, and that negative or prohibitive forms can be weak, agrees with what I saw. On the other hand, in that paper the wording that works changed between models. I measured only one model, so I can't say the range sentence's effect carries over to other models.
What this measurement covers that the paper doesn't: the language of the reply, how exceptions are listed, and that, in this scene, putting the sentence inside the tool result right before the reply worked best.
There is also research on negative instructions backfiring. Rana, "Semantic Gravity Wells: Why Negative Constraints Backfire" (arXiv:2601.08070), tests the instruction "do not use the word X" on a one-word answering task, and reports that in most failures the forbidden word itself pulled the answer toward it. It studies only one small open-weights model, though, and the idea that other phrasings (such as positive instructions) would do better is the author's prediction, not something the paper tests. My result, that a caution did not work and a sentence setting the range did, is one case that points the same way as that prediction.
I reported it on the Issue
Replies switching to English looks like a bug, so I also reported it on Claude Code's GitHub. There are a number of similar reports, and on one of them, anthropics/claude-code #96326, I commented with the method and results of this measurement. If there's a response, I'll add it to this article.
Closing
Every time Claude replied in English, I'd answer "Japanese, please." And after a while, it would go back to English. I still don't know why it switches.
But I did find a wording that reduces it. The interesting part is what kind of sentence it was. The instruction to reply in Japanese was in CLAUDE.md from the start. Telling Claude "in Japanese, please" during a session held only for a while. Adding a caution, "don't be swayed by the English you just read," still left 19 English replies in 100. Deleting the sentence that allowed English still left 7. What worked was a sentence that sets the range where English may be used: with the range set by who reads it, it went down to 1.
When replies suddenly switch to English, it's tempting to insist on your own language once more. That was my first idea too. Before that, try one sentence that sets the range where English may be used.
I don't think this is only about the reply language. When, as here, neither forbidding nor asking works, a sentence that defines where the thing is allowed may be worth a try.
Top comments (2)
The finding that appending the constraint directly inside the tool result dropped failures to zero matches how attention recency behaves in subagent loops. When subagents return raw execution traces or delegation updates, their token stream sits right before the generation step. The model's local context window gets dominated by that language, which easily overrides static guidelines sitting thousands of tokens back in system prompts.
Scoping by who reads the artifact is also much cleaner than listing allowed categories. Once you list exceptions like code, logs, and commits, the agent constantly blurs whether an intermediate status line counts as a log or a user report. Defining the boundary at the recipient level enforces a clear wall between internal runtime plumbing and the user presentation layer.
Thank you for reading it this closely. Your second point is how I read it too: with a list, the status line between tool calls has no clear home.
On the first point, one thing in my numbers doesn't fit recency alone. The same sentence sent through a hook also landed right before the reply, and it still gave 6 in 100. Inside the tool result it gave 0. So how close it sits didn't seem to be the whole story. How it is delivered seemed to matter as well.
Have you run into this in your own agent setups, where the same instruction works differently depending on how it is delivered (inside a tool result, through a hook, in the system prompt)? No rush.