[BUG] Crash when editing Markdown files containing Japanese text with box-drawing characters

Status Fixed / completed
Maintainer reply None cached
Activity 13 comments · opened Dec 16, 2025 · closed Jan 12, 2026

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 --version to check]
  • Node.js version: [run node --version to check]

Steps to Reproduce

  1. Open a Markdown file containing Japanese text with box-drawing characters (e.g., tables with │ or UI wireframes)
  2. Start editing the file
  3. 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

  1. Create or open a Markdown file containing Japanese text with box-drawing characters (│, ─, ┌, └)
  • Example content: UI wireframes or tables using characters like │ 単発イベント │ or ├─ id
  1. Run claude command to start Claude Code
  2. Ask Claude to edit the file (e.g., "Update this requirements document")
  3. 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_

View original on GitHub ↗

13 Comments

github-actions[bot] · 8 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/13080
  2. https://github.com/anthropics/claude-code/issues/6246
  3. https://github.com/anthropics/claude-code/issues/1716

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

convcha · 8 months ago

I'm also experiencing the same issue after upgrading to v2.0.70.

Environment:

  • OS: Linux (Docker container)
  • Claude Code version: 2.0.70

Error Message:

thread '<unnamed>' (2638) 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=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5, aborting
中止
leepoweii · 8 months ago

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) | 採混合方法設計——質性

  • OS: macOS Darwin 25.0.0
  • Version: 2.0.70
  • Command: claude --resume
  • Context: Obsidian vault with Traditional Chinese markdown files
takeaki-m · 8 months ago

Experiencing the same issue with Japanese text.

Environment

  • OS: macOS (Darwin 25.2.0)
  • Claude Code Version: 2.0.72
  • Terminal: Neovim integrated terminal via claudecode.nvim plugin
  • Locale: Japanese (ja_JP.UTF-8)

Error Message (with full backtrace)

$ RUST_BACKTRACE=full claude --resume

thread '' (2852172) panicked at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/str/mod.rs:833:21:
byte index 5 is not a char boundary; it is inside '(' (bytes 3..6) of る(環境パラメータに連動)
stack backtrace:
   0:        0x12e1d3018 -
   1:        0x12e141428 -
   2:        0x12e1d2794 -
   3:        0x12e1d2e30 -
   4:        0x12e1d243c -
   5:        0x12e1f4bf0 -
   6:        0x12e1f4b60 -
   7:        0x12e1f4b54 -
   8:        0x12e13f278 -
   9:        0x12e13f1d8 -
  10:        0x12e13eff8 -
  11:        0x12e108714 -
  12:        0x12e1032bc -
fatal runtime error: failed to initiate panic, error 5, aborting zsh: abort RUST_BACKTRACE=full claude --resume

Technical Analysis

Byte Structure Analysis

The string る(環境パラメータに連動) has the following byte
layout:

| 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:

  1. The initial panic occurred (UTF-8 boundary error)
  2. The panic handler was invoked
  3. The panic handler itself failed (error 5 = EIO)
  4. Process was forcefully aborted

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.

Katsushige-Onishi · 8 months ago

Experiencing the same issue.

Environment

  • OS: macOS Tahoe 26.2 (Darwin 25.2.0)
  • Hardware: Apple M4 Pro, 24GB RAM
  • Claude Code Version: Latest
  • Command: claude --resume --dangerously-skip-permissions

Error Message

thread '<unnamed>' (4464672) 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=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5, aborting
zsh: abort      claude --resume --dangerously-skip-permissions

Reproduction Steps

  1. Have a conversation with Japanese text content
  2. Exit the session
  3. Run claude --resume to resume the conversation
  4. Crash occurs immediately

Analysis

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 --resume flag 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.

takeaki-m · 8 months ago

~~[INFO] Latest version 2.0.75 might fix the bug. https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md~~

~~In my environment, claude --resume is 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.

thread '<unnamed>' (9232861) 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=1` environment variable to display a backtrace

ClaudeCode] [terminal] [ERROR] Claude exited with code 134.
Check for any errors.
convcha · 8 months ago

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.

thread '<unnamed>' (2503192) panicked at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library/core/src/str/mod.rs:833:21:
byte index 14 is not a char boundary; it is inside '除' (bytes 12..15) 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 --dangerously-skip-permissions

<img width="1360" height="712" alt="Image" src="https://github.com/user-attachments/assets/b0720f26-29ac-4421-b386-20b0f7abf523" />

kiki830621 · 8 months ago

I can confirm this issue also occurs with Traditional Chinese text when using the Edit tool.

Reproduction

  1. Use a skill that triggers the Edit tool to modify a .tex file containing Chinese text
  2. The Edit tool attempts string replacement on Chinese content

Error

it is inside '驗' (bytes 6..9) of `的測驗 SEM 較小,呈現了信度越高、測量誤差越小的反向關係。`
fatal runtime error: failed to initiate panic, error 5, aborting

Root Cause Analysis

The Edit tool's string matching/replacement logic uses byte offsets instead of character offsets. When old_string contains 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:

// Use floor_char_boundary (Rust 1.73+)
&text[..text.floor_char_boundary(max_len)]
takeaki-m · 7 months ago

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>' (23824723) 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=1` environment variable to display a backtrace
[ClaudeCode] [terminal] [ERROR] Claude exited with code 134.
Check for any errors.
gn00295120 · 7 months ago

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=1 environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5, aborting
zsh: abort claude --dangerously-skip-permissions

again

takatea · 7 months ago

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):

export CLAUDE_CODE_SYNTAX_HIGHLIGHT=off

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 🙏

shawnm-anthropic · 7 months ago

Hi folks, thanks for your patience. The fix should land in today's release.

github-actions[bot] · 7 months ago

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.