[BUG] Panic when processing Japanese characters (UTF-8 boundary error)

Resolved 💬 3 comments Opened Jan 15, 2026 by jotasugiyama Closed Jan 18, 2026

Description

Claude Code CLI crashes with a Rust panic when processing Japanese characters.

Error Message

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 `回`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5, aborting
zsh: abort      claude

Steps to Reproduce

  1. Open a file containing Japanese characters (especially the character '回')
  2. Run Claude Code CLI
  3. The CLI crashes with the above panic

Environment

  • OS: macOS (Darwin 25.1.0)

Analysis

This appears to be a UTF-8 string slicing issue in Rust code. The character '回' is a 3-byte UTF-8 character (bytes 0..3), but the code is attempting to slice at byte index 2, which is not a valid character boundary.

This is a common issue when using byte-based string indexing instead of character-based indexing in Rust.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗