[BUG] Crash when handling non-ASCII (Chinese) input: byte index is not a char boundary

Resolved 💬 3 comments Opened Dec 26, 2025 by yshyshyshyshysh Closed Dec 29, 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?

Claude Code crashes when processing UTF-8 multibyte input (e.g. Chinese).

Under certain conditions, the program slices strings using byte indices. When slicing lands inside a multibyte character, Rust panics with:
byte index is not a char boundary

This results in a runtime panic and aborts the entire process.

What Should Happen?

Claude Code should safely handle UTF-8 / non-ASCII input without crashing.

Error Messages/Logs

thread '<unnamed>' panicked at ...:
byte index is not a char boundary; it is inside '號' (bytes 21..24)
fatal runtime error: failed to initiate panic, aborting

Steps to Reproduce

  1. Run Claude Code
  2. Provide input or content that includes Chinese (non-ASCII) characters
  3. During processing, the program intermittently panics and exits

Note: The issue is not reproducible on every run. It occurs when string slicing lands inside a multibyte UTF-8 character.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.76 (Claude Code)

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

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