Aident AI

Claude Code Korean Text Corrupted? Stop Unicode Escapes
If Claude Code shows readable Korean in normal replies but turns tool questions, task labels, or option descriptions into wrong Hangul syllables, add one explicit instruction to CLAUDE.md:
Start a new Claude Code session, verify that the file is loaded with /memory, and repeat the same tool-heavy task. This targets a specific Sonnet 5 failure mode reported in August 2026: the model writes Korean tool parameters as hand-spelled Unicode escapes and produces valid but incorrect code points. It does not fix every kind of Korean text corruption, so identify the signature before changing terminal or locale settings.
Match the Symptom to the Right Fix
What you see | Likely boundary | Next action |
|---|---|---|
Wrong but valid Hangul inside | Model wrote incorrect | Add the literal UTF-8 instruction |
The replacement character | UTF-8 stream decoding or an older client path | Update Claude Code and capture the client version |
Korean typing is broken before you submit a prompt | Terminal, IDE, or IME input | Test the same text outside Claude Code |
Korean gradually becomes repetitive or drifts to English | Separate long-session model behavior | Save a minimal transcript and open a distinct report |
Only one generated file is corrupted | File-writing or encoding path | Inspect the file bytes and editor encoding |
The distinction matters. Changing LANG, reinstalling an IDE, or switching fonts cannot repair wrong Unicode code points that are already present in parsed tool input. Conversely, a CLAUDE.md instruction cannot repair an IME problem or a stream that has already emitted U+FFFD replacement characters.
Prerequisites
Before testing, record the version and preserve one small example:
On Windows PowerShell, use:
Copy the corrupted text, the intended text, the tool surface where it appeared, and whether ordinary assistant prose stayed readable. Do not include API keys, private source code, customer data, or complete session logs in a public issue.
Expected result: you can tell whether the failure affects tool-call parameters specifically or all Korean input and output.
Step 1: Confirm the Escape-Writing Signature
The August 1 root-cause report gives a recognizable pattern:
ASCII, digits, and UI labels such as
Otherremain intact.Korean content words become different but valid Hangul syllables rather than
�.The failure appears in structured tool input, especially question and task fields.
Session JSONL may show only the already-decoded wrong syllable because JSON escapes were parsed before persistence.
For example, the report observed intended words such as 점검 and 완료 arriving as other valid syllables. That is not mojibake. The bytes decode successfully, but they decode to the wrong code points.
Expected result: if you see valid but nonsensical Hangul in a tool card while surrounding ASCII is clean, continue with the prompt-level guard. If you see �, broken keyboard input, or corruption everywhere, skip to the separate-failure section.
Step 2: Add a Literal UTF-8 Rule at the Correct Scope
For one shared repository, add the instruction to the project file at ./CLAUDE.md or ./.claude/CLAUDE.md:
For every project on your machine, put the same rule in ~/.claude/CLAUDE.md. For a private project-specific preference that should not be committed, use ./CLAUDE.local.md and keep it ignored by Git.
Do not add the same rule at all three scopes. Claude concatenates applicable instruction files, so one clear source is easier to maintain and test.
Expected result: the next session receives one concise instruction at the intended project or user scope.
Step 3: Verify Claude Code Loaded the Rule
Start a new session in the affected repository and run:
Confirm that the chosen CLAUDE.md or CLAUDE.local.md appears in the loaded file list. Anthropic documents these files as persistent context, not hard enforcement, so a missing file means the model never received the workaround.
Then repeat the smallest task that previously produced corrupted tool input. Keep the wording and model constant. A useful manual test asks Claude to present several Korean choices through the same question tool that failed, without accessing a real service or writing production data.
Expected result: the tool card contains literal, readable Korean and no syllable substitutions. The issue reporter's controlled experiment found corruption in all 45 escape-writing runs across two accounts, while forbidding escapes suppressed that class in the tested field workflow. Treat that as strong reproduction evidence for this signature, not proof that all Korean model errors are solved.
Step 4: Capture Raw Partial JSON Only When Needed
If the visual tool card is still wrong, capture a minimal print-mode reproduction with partial messages:
Search the raw file for escaped code points:
The file can contain prompts, tool arguments, paths, and model output. Keep it local, redact it before sharing, and delete it when the investigation is finished.
Expected result: raw partial_json evidence can distinguish model-written escapes from a display problem. If the parsed transcript is wrong but the raw stream contains no escapes, report that as a separate literal-output failure rather than forcing this workaround to fit.
Step 5: Keep the Workaround Narrow
Avoid broad changes that hide the actual boundary:
Do not escape all non-ASCII output yourself. That recreates the failure condition.
Do not rewrite generated Korean with a character-normalization pass. Normalization cannot infer the intended syllable from a different valid syllable.
Do not disable tools globally if the same workflow succeeds with literal UTF-8.
Do not publish a raw session log. Produce the smallest redacted reproduction.
Do not claim a terminal locale fixed a tool-parameter model error unless an A/B test shows it.
If your application calls the Claude API directly, place the same literal UTF-8 requirement in the system instruction that governs every tool parameter. Validate business-critical Korean fields before executing a write, and reject or request regeneration when content is unreadable. A validator can catch replacement characters or invalid JSON, but it cannot reliably recognize every valid-yet-wrong Hangul syllable. Human review remains necessary for high-impact Korean text.
Common Failure Modes
Failure | Better response |
|---|---|
The rule was added but the old session still fails | Start a new session and check |
Normal chat is clean but a question card is wrong | Keep the test focused on structured tool input |
| Capture the raw boundary and file a separate literal-output report |
| Include the exact client version and stream mode in the report |
The workaround fixes some runs but not rare substitutions | Record the residual separately; the root-cause report describes a distinct low-rate class |
A team duplicates the rule in many nested files | Keep one project or user source of truth |
Why This Fix Works
JSON permits both literal UTF-8 and Unicode escape syntax. For Korean, literal UTF-8 lets the model emit the intended text directly. Writing every syllable as four hexadecimal digits creates several additional opportunities for a near-miss that still decodes into a valid Hangul character. Because the JSON parser then removes the escape notation, the final session record can preserve only the wrong syllable and conceal how it was produced.
The fix mirrors the repeatable structure behind Aident's Ollama network guide: name the exact failure, test one boundary, apply a reversible change, verify the expected result, and explain why it works. If your symptom is instead a missing instruction file, use Claude Code Memory Missing in a Worktree?. If tool output is consuming too much context, see How to Reduce MCP Token Usage in Claude Code and Codex.
Verify Three Catalog Results in Korean
After the rule works, set up Aident Loadout by pasting:
Then ask:
Expected result: three current catalog records, three readable Korean explanations, and zero provider executions. That tests the workaround on a real structured capability workflow without copying API keys or changing an external system.
Sources
Sonnet 5 writes Korean tool-call parameters as
\uXXXXescapes, root-cause report opened August 1, 2026AskUserQuestion input contains corrupted Korean syllables, symptom report opened July 22, 2026
Sustained Korean sessions degrade into ill-formed Hangul, related report opened July 19, 2026
How Claude remembers your project, Anthropic Claude Code documentation, accessed August 2, 2026
Run Claude Code programmatically, Anthropic Claude Code documentation, accessed August 2, 2026
Prompting Claude Sonnet 5, Anthropic Claude Platform documentation, accessed August 2, 2026
Korean CJK characters corrupted to
U+FFFD, separate stream-decoding report opened March 28, 2026
Refresh this guide when Anthropic resolves issue 83033, changes Sonnet 5's tool-parameter behavior, or documents a client-side validation fix.


