Skip to content

[Bug] skill-creator crashes with UTF-8 boundary panic when processing Chinese text #263

@2743981237

Description

@2743981237

Bug Report: Panic on UTF-8 character boundary when using skill-creator with Chinese text

Version: Claude Code 2.0.76

OS: macOS (Darwin 25.2.0)

Description:

Claude Code crashes with a Rust panic when using the skill-creator skill with Chinese text input.

Error Message:

thread '' (1992924) 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

Steps to Reproduce:

  1. Run Claude Code CLI (claude)
  2. Invoke the skill-creator skill (e.g., /skill-creator)
  3. Provide input containing Chinese characters (中文) during the skill creation process
  4. The application crashes with the above panic message

Analysis:

The error indicates an invalid UTF-8 string slicing operation. The Chinese full-stop character 。 (U+3002) is a 3-byte UTF-8 character (bytes 0-2), but the code attempts to slice at byte index 2, which is in the middle of this character. This violates Rust's string safety guarantees and causes a panic.

This likely occurs during string truncation, display formatting, or text processing within the skill-creator workflow.

Expected Behavior:

Claude Code should correctly handle multi-byte UTF-8 characters (including CJK characters and punctuation) when creating skills with non-ASCII content.

Suggested Fix:

Use character-aware string operations (e.g., char_indices(), chars().take(n)) instead of byte-based indexing when processing user input or model output containing non-ASCII characters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions