claude-code - 💡(How to fix) Fix [BUG] Glob tool incorrectly inserts redundant spaces for filenames with Chinese, numbers, or hyphens (-) (macOS standalone) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#47764Fetched 2026-04-15 06:43:01
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

Error Message

Error Messages/Logs

Code Example

claude -p "Glob **/*.xlsx"

---

**Expected behavior**
File paths should be displayed **exactly as they are stored on disk**, without extra spaces.

**Actual behavior**
The output automatically adds wrong spaces:

1. `原始数据/2026 年 3 月指标.xlsx`
2. `原始数据/报表装维 - 202603.xlsx`
3. `数据 - 2025 - 测试.xlsx`
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Claude Code Information

  • Installation type: Standalone binary (non-npm, macOS)
  • Version: 2.1.104 (Claude Code)
  • OS: macOS

Describe the bug The built-in Glob tool incorrectly inserts unnecessary redundant spaces when displaying filenames that contain:

  • Chinese characters
  • Numbers
  • Hyphens (-) This only happens in the display output; file matching works correctly. The actual filenames on disk do NOT have these extra spaces.

What Should Happen?

To Reproduce

  1. Create files like these:
    • 原始数据/2026年3月指标.xlsx
    • 原始数据/报表装维-202603.xlsx
    • 数据-2025-测试.xlsx
  2. Run:
    claude -p "Glob **/*.xlsx"

Error Messages/Logs

**Expected behavior**
File paths should be displayed **exactly as they are stored on disk**, without extra spaces.

**Actual behavior**
The output automatically adds wrong spaces:

1. `原始数据/2026 年 3 月指标.xlsx`
2. `原始数据/报表装维 - 202603.xlsx`
3. `数据 - 2025 - 测试.xlsx`

Steps to Reproduce

Verification

  • Running ls shows real filenames do NOT contain these spaces.
  • Pure English filenames work correctly.
  • This is a text rendering / tokenization bug in CJK & symbol handling.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.104

Platform

Other

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

extent analysis

TL;DR

The issue can likely be fixed by adjusting the text rendering or tokenization logic in the Glob tool to correctly handle Chinese characters, numbers, and hyphens.

Guidance

  • Verify that the issue is indeed related to text rendering by testing with different filename characters and observing the output.
  • Check if there are any existing configuration options or flags in the Glob tool that can be used to customize the text rendering behavior.
  • Consider filing a bug report with the Claude Code developers to request a fix for this regression, providing the steps to reproduce and the expected behavior.
  • As a temporary workaround, consider using an alternative tool or method to display filenames, such as the ls command, which is reported to show the correct filenames.

Example

No code snippet is provided as the issue is related to the internal logic of the Glob tool.

Notes

The issue seems to be specific to the Glob tool in Claude Code and is a regression from a previous version. The exact cause and solution may require further investigation and debugging by the Claude Code developers.

Recommendation

Apply workaround: Use an alternative tool or method to display filenames, such as the ls command, until a fix is available from the Claude Code developers.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Glob tool incorrectly inserts redundant spaces for filenames with Chinese, numbers, or hyphens (-) (macOS standalone) [1 participants]