[BUG] Panic: UTF-8 byte boundary error when processing Korean characters in file paths
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?
Description
Claude Code crashes with a panic when processing file paths or content containing Korean (Hangul) characters. The error indicates an incorrect UTF-8 byte boundary calculation when slicing strings.
### Error Message
byte index 15 is not a char boundary; it is inside '은' (bytes 13..16)
### Environment
- Claude Code version: 2.1.5
- OS: macOS (Darwin 25.2.0)
- Terminal: iTerm2 (also reproducible in other terminals)
- Shell: zsh
### Steps to Reproduce
- Navigate to a directory with Korean characters in the path
- Example:
/Users/username/Library/CloudStorage/GoogleDrive-.../내 드라이브/HIP 업무/PE본부 Work/
- Run
claude - Perform operations that involve reading files or processing text containing Korean characters
- Crash occurs intermittently
### Root Cause Analysis
The Rust code is attempting to slice a UTF-8 string at a byte index (15) that falls in the middle of a multi-byte Korean character '은', which occupies bytes 13-16 (3 bytes). Korean Hangul characters are encoded as 3 bytes in UTF-8, and the string slicing operation is not respecting character boundaries.
### Expected Behavior
Claude Code should properly handle UTF-8 multi-byte characters (Korean, Japanese, Chinese, etc.) without panicking.
### Workaround
Using English-only paths reduces the frequency of crashes:
```bash
ln -s "/path/with/한글" ~/english_path
cd ~/english_path && claude
Additional Context
This is a critical issue for users working in non-ASCII environments. The panic is non-recoverable and requires restarting Claude Code.
What Should Happen?
-
Error Messages/Logs
Steps to Reproduce
### Workaround
Using English-only paths reduces the frequency of crashes:
```bash
ln -s "/path/with/한글" ~/english_path
cd ~/english_path && claude
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.5
Claude Code Version
2.1.5
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗