[BUG] Panic on UTF-8 multi-byte character boundary when processing Korean text

Resolved 💬 3 comments Opened Dec 22, 2025 by TJ-Lee Closed Dec 25, 2025

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?

## Bug Description

Claude Code CLI panics when processing Korean text.

## Error

byte index 38 is not a char boundary; it is inside '힘' (bytes 36..39)
fatal runtime error: failed to initiate panic, error 5, aborting

## Environment

  • Version: 2.0.75
  • OS: Linux
  • Shell: zsh
  1. "Submit new issue" 클릭

What Should Happen?

Claude Code should properly handle multi-byte UTF-8 characters (Korean, Chinese, Japanese, emoji, etc.) without crashing. The CLI should use character-aware string slicing instead of raw byte indices.

Error Messages/Logs

thread '<unnamed>' panicked at .../core/src/str/mod.rs:833:21:
  byte index 38 is not a char boundary; it is inside '힘' (bytes 36..39) of `잇 워, 아워 페이시즈 프롬 힘; 히 워즈 디스파이즈드, 앤 위 디드 낫 에스팀 힘.`
  fatal runtime error: failed to initiate panic, error 5, aborting
  zsh: IOT instruction (core dumped) claude

Steps to Reproduce

  1. Have a file containing Korean text or Korean phonetic transcriptions
  2. Run claude in a directory with Korean text in context (e.g., CLAUDE.md or source files)
  3. The CLI processes the Korean text internally
  4. Crash occurs with "byte index is not a char boundary" panic

Note: The exact trigger is unclear, but the crash happened while processing text containing Korean characters like '힘'. The string in the error was: 잇 워, 아워 페이시즈 프롬 힘; 히 워즈 디스파이즈드, 앤 위 디드 낫 에스팀 힘.

This appears to be an internal string slicing bug where byte indices are used instead of character indices for multi-byte UTF-8 characters.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

Claude Code v2.0.75

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

Title:
Panic on UTF-8 multi-byte character boundary when processing Korean text

Body:
## Bug Description

Claude Code CLI panics when processing text containing Korean (multi-byte UTF-8) characters.

## Error Message

thread '<unnamed>' panicked at .../core/src/str/mod.rs:833:21:
byte index 38 is not a char boundary; it is inside '힘' (bytes 36..39) of 잇 워, 아워 페이시즈 프롬 힘; 히 워즈 디스파이즈드, 앤 위 디드 낫 에스팀 힘.
fatal runtime error: failed to initiate panic, error 5, aborting
zsh: IOT instruction (core dumped) claude

## Environment

  • Claude Code Version: 2.0.75
  • OS: Linux
  • Shell: zsh

## Analysis

Korean character '힘' occupies 3 bytes in UTF-8 (bytes 36..39). The code sliced at byte index 38, which is inside the character - not a valid UTF-8 boundary.

View original on GitHub ↗

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