[BUG] Panic on UTF-8 character boundary with Arabic text
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?
Describe the bug
Claude Code panics when processing strings containing Arabic characters. The panic occurs when the code attempts to slice a UTF-8 string at a byte index that falls in the middle of a multi-byte character.
Context
Working with content containing Arabic text ("أولوية السلامة" - "Safety Priority") as part of a skill that includes multilingual quotes. The crash occurred during string processing/truncation.
Expected behavior
Claude Code should handle UTF-8 strings with multi-byte characters (Arabic, Chinese, emoji, etc.) without panicking. String slicing should use character boundaries, not raw byte indices.
Additional context
The panic handler itself failed (error 5), causing an abort rather than a graceful error message. This suggests the panic recovery mechanism also has issues.
What Should Happen?
Expected behavior
Claude Code should handle UTF-8 strings with multi-byte characters (Arabic, Chinese, emoji, etc.) without panicking. String slicing should use character boundaries, not raw byte indices.
Additional context
The panic handler itself failed (error 5), causing an abort rather than a graceful error message. This suggests the panic recovery mechanism also has issues.
Error Messages/Logs
Error message
thread '' (1652572) panicked at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/str/mod.rs:833:21:
byte index 46 is not a char boundary; it is inside 'ة' (bytes 45..47) of "Arabic Proverb", "أولوية السلامة", "Nothing
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
Environment
OS: macOS (Darwin 25.2.0)
Claude Code version: (please add your version from claude --version)
Shell: zsh
Steps to Reproduce
Claude Code
Error message
thread '' (1652572) panicked at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/str/mod.rs:833:21:
byte index 46 is not a char boundary; it is inside 'ة' (bytes 45..47) of "Arabic Proverb", "أولوية السلامة", "Nothing
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
Environment
OS: macOS (Darwin 25.2.0)
Claude Code version: (please add your version from claude --version)
Shell: zsh
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.76
Platform
Other
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗