-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Open
Labels
area:corearea:toolsbugSomething isn't workingSomething isn't workingduplicateThis issue or pull request already existsThis issue or pull request already existshas reproHas detailed reproduction stepsHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOSIssue specifically occurs on macOS
Description
Preflight Checklist
- I have searched existing issues and this hasn't been reported yet
- This is a single bug report (please file separate reports for different bugs)
- I am using the latest version of Claude Code
What's Wrong?
The Edit tool causes a Rust panic when editing files containing Korean (or other multi-byte UTF-8) text. The CLI crashes completely and terminates the session, losing any unsaved work.
The error occurs because string indexing calculates byte positions that fall in the middle of multi-byte UTF-8 characters (Korean characters are 3 bytes in UTF-8).
What Should Happen?
The Edit tool should correctly handle multi-byte UTF-8 characters by using character-aware indexing instead of byte-based indexing. Edits to Korean, Chinese, Japanese, emoji, and other Unicode text should work without crashing.
Error Messages/Logs
thread '<unnamed>' panicked at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/str/mod.rs:833:21:
byte index 9 is not a char boundary; it is inside '는' (bytes 7..10) of ` 평가는 익명 라벨로 진행되었습니다.`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5, aborting
---
thread '<unnamed>' panicked at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/str/mod.rs:833:21:
byte index 2 is not a char boundary; it is inside '이' (bytes 0..3) of `이`);`
fatal runtime error: failed to initiate panic, error 5, abortingSteps to Reproduce
- Open a project containing files with Korean text (JSX, JS, or any text file)
- Ask Claude to edit Korean strings using the Edit tool
- Example: "Change '상호 평가' to '크로스 심판' in the JSX file"
- CLI crashes with Rust panic before or during the edit operation
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
No response
Claude Code Version
2.0.76
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
- This bug is 100% reproducible when editing Korean text
- Likely affects all CJK (Chinese, Japanese, Korean) languages and emoji
- Workaround: Use Write tool to rewrite entire file instead of Edit tool
- Screenshot attached showing the crash in terminal
Metadata
Metadata
Assignees
Labels
area:corearea:toolsbugSomething isn't workingSomething isn't workingduplicateThis issue or pull request already existsThis issue or pull request already existshas reproHas detailed reproduction stepsHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOSIssue specifically occurs on macOS