[BUG] Crash when editing Markdown files containing Japanese text with box-drawing characters
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?
Description
Claude Code crashes with a panic error when editing Markdown files that contain Japanese text combined with box-drawing characters (│, ─, etc.).
Environment
- OS: macOS (Apple Silicon)
- Claude Code version: [run
claude --versionto check] - Node.js version: [run
node --versionto check]
Steps to Reproduce
- Open a Markdown file containing Japanese text with box-drawing characters (e.g., tables with │ or UI wireframes)
- Start editing the file
- Claude Code crashes
Error Message
thread '<unnamed>' panicked at /rustc/.../library/core/src/str/mod.rs:833:21:
byte index 5 is not a char boundary; it is inside '発' (bytes 3..6) of `単発) ← 新規│`
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
Expected Behavior
Claude Code should handle multi-byte UTF-8 characters correctly without crashing.
Additional Context
The crash occurs during text rendering/display when the terminal tries to split Japanese characters at incorrect byte boundaries.
What Should Happen?
Claude Code should handle multi-byte UTF-8 characters (including Japanese text and box-drawing characters like │, ─, ┌, └) correctly without crashing. The editor should be able to display and edit Markdown files containing these characters normally.
Error Messages/Logs
Steps to Reproduce
- Create or open a Markdown file containing Japanese text with box-drawing characters (│, ─, ┌, └)
- Example content: UI wireframes or tables using characters like
│ 単発イベント │or├─ id
- Run
claudecommand to start Claude Code - Ask Claude to edit the file (e.g., "Update this requirements document")
- Claude Code crashes during the editing/rendering process
Example text that triggers the crash:
単発) ← 新規│済み(またはシリーズ登録者)のユー
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.0.70 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
13 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
I'm also experiencing the same issue after upgrading to v2.0.70.
Environment:
Error Message:
Experiencing the same issue with Traditional Chinese text:
thread '<unnamed>' (2304444) panicked at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/str/mod.rs:833:21:
byte index 26 is not a char boundary; it is inside '」' (bytes 24..27) of
響多大、因果強度」(p. 10, Section 5.4) | 採混合方法設計——質性Experiencing the same issue with Japanese text.
Environment
Error Message (with full backtrace)
Technical Analysis
Byte Structure Analysis
The string
る(環境パラメータに連動)has the following bytelayout:
| Character | Bytes | Range |
|-----------|-------|-------|
| る | 3 bytes | 0-2 |
| ( | 3 bytes | 3-5 |
| 環 | 3 bytes | 6-8 |
| ... | ... | ... |
The code attempted to slice at byte index 5, which is in the middle of the full-width parenthesis
((bytes 3-5).Double Panic Issue
The error shows a double panic condition: fatal runtime error: failed to initiate panic, error 5, aborting
This indicates:
This suggests the panic handler may also be triggering UTF-8 boundary issues when trying to format/display the error message.
Missing Debug Symbols
The backtrace shows
<unknown>for all frames because debug symbols are stripped in the release build. A debug build would be needed to identify the exact source location.Experiencing the same issue.
Environment
claude --resume --dangerously-skip-permissionsError Message
Reproduction Steps
claude --resumeto resume the conversationAnalysis
The Japanese character 'し' (U+3057) is a 3-byte UTF-8 sequence (E3 81 97), but the code attempts to slice at byte index 2, which falls in the middle of the character.
This is clearly a regression introduced in v2.0.70. The
--resumeflag seems to trigger string slicing in the session history or status line rendering that doesn't respect UTF-8 character boundaries.Impact
This bug makes Claude Code essentially unusable for Japanese (and other CJK language) users when resuming sessions. A critical issue for non-ASCII users.
~~[INFO] Latest version
2.0.75might fix the bug. https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md~~~~In my environment,
claude --resumeis working well.~~https://github.com/anthropics/claude-code/issues/14104#issuecomment-3672946497
updated: the problems happened again while just working normally at claude code neovim plugin.
Hmm, I’m still getting errors in my environment (2.0.75).
It’s not during the resume; I’m getting errors while Claude Code is just working normally.
<img width="1360" height="712" alt="Image" src="https://github.com/user-attachments/assets/b0720f26-29ac-4421-b386-20b0f7abf523" />
I can confirm this issue also occurs with Traditional Chinese text when using the Edit tool.
Reproduction
.texfile containing Chinese textError
Root Cause Analysis
The Edit tool's string matching/replacement logic uses byte offsets instead of character offsets. When
old_stringcontains multi-byte UTF-8 characters (Chinese = 3 bytes each), the slice operation lands in the middle of a character, causing the Rust panic.Workaround
Use the Write tool to overwrite the entire file instead of using Edit for partial replacements.
Suggested Fix
Use character-aware string operations in Rust:
the problems occured again
OS: macOS (Darwin 25.2.0)
Claude Code Version: 2.0.76
Terminal: Neovim integrated terminal via claudecode.nvim plugin
Locale: Japanese (ja_JP.UTF-8)
thread '<unnamed>' (238235973) 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
組",note: run with
RUST_BACKTRACE=1environment variable to display a backtracefatal runtime error: failed to initiate panic, error 5, aborting
zsh: abort claude --dangerously-skip-permissions
again
Hi, I am also experiencing the same issue with Japanese text.
Just wanted to share that there's a workaround and investigation is ongoing.
---
This issue is being investigated in #14133 and #16543.
Workaround (from #14133 comment):
This disables syntax highlighting and avoids the crashing codepath. I verified it works.
cc @shawnm-anthropic - this is also the UTF-8 char boundary crash 🙏
Hi folks, thanks for your patience. The fix should land in today's release.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.