[BUG] Rust panic on multibyte character (Japanese) during diff rendering

Resolved 💬 3 comments Opened Dec 22, 2025 by ysawayama Closed Dec 26, 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 with a Rust panic when performing multiple Edit operations on files containing Japanese (multibyte) characters. The crash occurs during diff rendering.

What Should Happen?

Claude Code should handle multibyte characters (Japanese, Chinese, etc.) correctly without crashing during diff rendering.

Error Messages/Logs

thread '<unnamed>' panicked at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/str/mod.rs:833:21: byte index 2 is not a char boundary; it is inside '点' (bytes 0..3) of `点</span>` note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace fatal runtime error: failed to initiate panic, error 5, aborting

Steps to Reproduce

  1. Open a Next.js/React project containing files with Japanese text
  2. Use Claude Code to perform multiple Edit operations replacing Japanese strings with i18n translation calls (e.g., replacing 総候補数 with {t('key')})
  3. After approximately 10-15 consecutive edits, the diff rendering causes a panic
  4. Claude Code crashes and terminates

Note: The crash appears to be related to how the diff display handles UTF-8 multibyte character boundaries when rendering </span> tags around Japanese characters.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.74 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

The crash occurred while using --dangerously-skip-permissions flag during i18n translation work. The project is a Next.js application with Japanese UI strings being replaced with translation function calls.
This appears to be a UTF-8 byte boundary handling issue in the Rust diff rendering code.

View original on GitHub ↗

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