[BUG] Rust panic on Korean (UTF-8) input: "byte index is not a char boundary" when processing '필터 적용'
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Claude Code CLI crashes with a Rust panic when handling Korean (UTF-8 multibyte) text, and the process aborts immediately.
The key error is:
- byte index 13 is not a char boundary
- it is inside '용' (bytes 11..14) of '필터 적용'
This strongly suggests the CLI is performing byte-index string slicing (or similar substring operations) and attempts to cut a UTF-8 string at a position that is not a valid character boundary, which causes a panic and abort.
Steps to Reproduce
1.Run claude --dangerously-skip-permissions
2.Ensure Korean text appears in the input/output/prompt (e.g., 필터 적용)
3.Observe the panic and immediate abort
Actual Result
-Rust panic occurs and the CLI aborts, making the tool unusable in this scenario.
Expected Result
-The CLI should handle Korean/Unicode input safely without crashing.
-At minimum, it should gracefully report an error and continue running.
Environment
-Claude Code: 2.0.70
-Binary path:.local/bin/claude
-OS: macOS (add version if available)
What Should Happen?
Even when Korean (UTF-8 multibyte) text appears in the input/output/prompt, the CLI should continue to work normally and must not crash due to a panic.
Error Messages/Logs
thread '<unnamed>' (1031632) panicked at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/str/mod.rs:833:21:
byte index 13 is not a char boundary; it is inside '용' (bytes 11..14) of
`'필터 적용'}`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5, aborting
[1] 75263 abort claude --dangerously-skip-permissions
Steps to Reproduce
1.Open a terminal on macOS.
2.Run: claude --dangerously-skip-permissions
3.Trigger any flow where Korean (UTF-8 multibyte) text appears in the input/output/prompt (e.g., 필터 적용).
4.The CLI crashes with a Rust panic and aborts, showing byte index ... is not a char boundary.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
v2.0.70
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
21 Comments
---
Found 2 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
---
👎
Same issues
https://github.com/anthropics/claude-code/issues/14272
https://github.com/anthropics/claude-code/issues/14287
https://github.com/anthropics/claude-code/issues/14435
Claude CLI 2.0.73
macOS 26.0.1
I'm experiencing same issue too
It happens without --dangeriously-sip-permissions too
same issue.
claude code cli v2.0.75
windows 10 pro
the error messages are almost identical to the original issuer's.
no problem with v2.0.72.
when i continue claude code cli with --resume, it seems ok for a while.
but when i try /export command, then it always happens.
This also affects Japanese text, particularly the Japanese period
。(U+3002, 3 bytes in UTF-8).The
。character appears at the end of almost every sentence in Japanese, making this bug especially disruptive for Japanese users.Related Japanese issues:
発and box-drawing characters除Example error:
byte index 17 is not a char boundary; it is inside '。' (bytes 15..18)
I'm experiencing the same issue with Japanese characters.
Error message:
Context:
The crash occurred when Claude Code was processing a PHP file containing the following Japanese comment:
The panic message shows it was trying to slice the string
ド後に修正(part of "アップグレード後に修正" meaning "fix after upgrade") at byte index 14, which falls inside the multi-byte character '正'.Environment:
I'm also experiencing the same issue. Sharing my case in hopes it might help.
---
Environment
Steps to reproduce
Expected behavior
File operations with Japanese text should complete successfully.
Actual behavior
Claude Code crashes with a panic:
Additional context
error 5), so full backtrace symbols are not availableWorkarounds attempted
<unknown>due to stripped symbolsImpact
This issue occurs very frequently when working with Japanese text, making Claude Code practically unusable for my workflow. I have been forced to use alternatives like OpenAI Codex as a workaround. Would really appreciate a fix for this.
Same issue here.
Environment:
Reproduction:
+1 for prioritizing this fix 🙏
same to me
같은 이슈 재현 (Ubuntu 24.04)
환경:
에러:
흥미로운 발견:
2025년인데 3바이트 UTF-8 문자 하나가 프로그램을 멈춘다는 게 신기하네요.
'에' 라는 한글 음절이 그렇게 위험한 문자였나요?
Rust의
.chars()메서드는 2015년부터 있었던 걸로 아는데,바이트 인덱스 슬라이싱을 고집하시는 특별한 이유가 있으신지 궁금합니다.
이미 #14392, #14310, #14862 등 유사 이슈가 계속 올라오는 걸 보니
CJK 사용자들은 "아직은 때가 아닌가보다" 하고 조용히 기다리는 중입니다.
언젠가 한국어로 코딩할 수 있는 날이 오겠죠.
그때까지 영어 주석으로 버텨보겠습니다.
---
Written by Claude AI 🤖
동일 이슈 발생
OS : mac Sequoia 15.6.1
Claude Code : 2.0.76
thread '<unnamed>' (4584184) panicked at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/str/mod.rs:833:21:
byte index 23 is not a char boundary; it is inside '신' (bytes 21..24) of 그아웃, 토큰 갱신, 현재 관리자 정보)
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5, aborting
[1] 78778 abort claude
Additional crash report
Environment:
Crash log:
Analysis:
byte index 22 is not a char boundary; it is inside ':' (bytes 20..23) of \\nお問い合わせ:
Same issue with Japanese text.
Still occurring in v2.1.2 (latest) with Japanese text.
(Following up on my previous comment)
Environment:
Error:
This issue is still affecting my daily use. Would appreciate any progress on a fix. Thanks for your work on this!
Hi all. I'm really sorry about this crash! I'm eager to fix it, but I'm unable to repro by trying a bunch of different patterns, languages, and file types. It'd be really helpful if folks could provide specific a file and prompt that triggers the crash from a blank slate. Please also mention which platform you're using.
As a short-term mitigation you can set environment variable
CLAUDE_CODE_SYNTAX_HIGHLIGHT=off, which will avoid the codepath that triggers the panic.<img width="1456" height="1132" alt="Image" src="https://github.com/user-attachments/assets/fa5bdf79-c695-4392-a0dc-d2afdf2c7158" />
@shawnm-anthropic
Thanks for the workaround!
I created a reproduction repository with Japanese text:
https://github.com/takatea/claude-code-utf8-crash-repro
Your workaround (
CLAUDE_CODE_SYNTAX_HIGHLIGHT=off) works perfectly.The crash seems related to the number of changes — many changes crash, few changes succeed.
Hi @sosukesuzuki,
We have a workaround, but the issue itself is not fixed yet. Could you tell us why this was closed?
If this was closed by mistake, please reopen it. I am waiting for this to be fixed, and I am happy to help if there is anything I can do.
Thanks.
The fix is scheduled to release today. Thank you for your patience!
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.