Korean character handling causes panic (UTF-8 boundary error)

Resolved 💬 3 comments Opened Dec 20, 2025 by rudxokim Closed Dec 24, 2025

Bug Description

Claude Code CLI panics when processing Korean characters in status line or command output.

Error Message

thread '<unnamed>' (599100) 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
zsh: abort      claude --dangerously-skip-permissions

Analysis

The Rust code is attempting to slice a string at byte index 9, but this falls in the middle of the Korean character '킷' (which spans bytes 7-10). Korean characters in UTF-8 typically use 3 bytes each.

The string 재 버킷) breaks down as:

  • = bytes 0-2
  • = byte 3
  • = bytes 4-6
  • = bytes 7-9
  • ) = byte 10

Slicing at byte 9 breaks the UTF-8 encoding.

Environment

  • Platform: macOS (Darwin 24.3.0)
  • Claude Code version: Latest
  • Command used: claude --dangerously-skip-permissions

Context

This occurred while editing a skill file (.claude/commands/autocoder-trigger.md) that contains Korean text. The crash happened during an "Incubating" step.

Suggested Fix

String slicing operations in the CLI should use character boundaries rather than byte indices, or validate UTF-8 boundaries before slicing.

View original on GitHub ↗

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