Crash: UTF-8 string boundary error when slicing emoji characters in TodoWrite output
Resolved 💬 2 comments Opened Jan 20, 2026 by rob693 Closed Jan 22, 2026
Bug Description
Claude Code crashes with a Rust panic when attempting to slice a string containing emoji characters at an invalid UTF-8 byte boundary.
Error Message
thread '<unnamed>' (6109347) panicked at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/str/mod.rs:833:21:
byte index 3 is not a char boundary; it is inside '📋' (bytes 0..4) of `📋 | Not started |`
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
Reproduction Context
- Using TodoWrite tool with task statuses
- CLAUDE.md contains emoji status icons (📋, ✅, 🔧, ⏳, 🔴) for project phase tracking
- The string
📋 | Not started |appears to be from TodoWrite output formatting
Root Cause
The emoji 📋 is 4 bytes in UTF-8 (bytes 0-3). The code attempted to slice at byte index 3, which is inside the multi-byte character. This suggests the string truncation/formatting logic assumes ASCII (1 byte per char) rather than handling UTF-8 properly.
Environment
- OS: macOS Darwin 25.1.0
- Claude Code version: Latest as of 2026-01-20
Expected Behavior
String operations should use character boundaries, not byte indices, when truncating or formatting strings that may contain multi-byte UTF-8 characters (emojis, non-ASCII text).
Workaround
Restart Claude Code. No data loss occurs - git working directory remains intact.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗