[BUG] Crash when processing Chinese text: byte index not a char boundary
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 crashes with a Rust panic when processing Chinese text. The error occurs during string slicing where the byte index falls inside a multi-byte UTF-8 character.
This happens both when:
- Resuming sessions containing Chinese text (
claude --resume) - Normal usage with Chinese todo items in the status bar
What Should Happen?
Claude Code should handle Chinese/CJK text without crashing. UTF-8 string operations should use character-aware slicing.
Error Messages/Logs
thread '<unnamed>' panicked at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/str/mod.rs:833:21:
byte index 17 is not a char boundary; it is inside '。' (bytes 15..18) of `是内置命令。`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5, aborting
Aborted (core dumped)
Steps to Reproduce
- Start Claude Code and have a conversation in Chinese
- Exit the session with
/exit - Run
claude --resume --verbose - Select the session containing Chinese text
- Program crashes immediately
Alternative reproduction:
- Use Claude Code normally with Chinese text
- When Claude's todo list shows Chinese content in status bar, it may crash
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.3 (Claude Code)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
Environment: Windows 11 + WSL2 + Windows Terminal
This bug affects ALL Chinese/CJK users. Multiple issues have been reported:
- #14310
- #15268
- #15394
- #15647
- #15769
The fix is straightforward: use str::floor_char_boundary() or char_indices() instead of raw byte indexing.
I'm a Max subscriber ($100/month) and this makes Claude Code unreliable for daily use in Chinese.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗