Panic: UTF-8 string boundary error when editing files with Korean text

Resolved 💬 3 comments Opened Jan 6, 2026 by rjwalters Closed Jan 10, 2026

Description

Claude Code panics with a UTF-8 string boundary error when using the Edit tool on files containing Korean (and likely other multi-byte UTF-8) text.

Panic Message

thread '<unnamed>' (301490899) panicked at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/str/mod.rs:833:21:
byte index 12 is not a char boundary; it is inside '다' (bytes 10..13) 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 --permission-mode bypassPermissions

Steps to Reproduce

  1. Use Claude Code to edit a file containing Korean text (in this case, .ftl translation files)
  2. The Edit tool attempts to modify content containing multi-byte UTF-8 characters
  3. Claude Code crashes

Context

  • Occurred while updating Korean translation file (web-demo/src/i18n/resources/ko.ftl)
  • Reproducible - happened in multiple consecutive sessions
  • The problematic string was 중입니다. (Korean text)

Likely Cause

Some code path (possibly diff display, edit preview, or output truncation) is slicing a UTF-8 string by byte offset rather than character boundary. In Rust, this causes a panic because &str[byte_index] requires the index to be at a valid UTF-8 character boundary.

Environment

  • OS: macOS (Darwin 25.2.0)
  • Model: claude-opus-4-5-20251101

View original on GitHub ↗

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