[BUG] Windows: Glob returns "No files found" for existing files when path arg contains non-ASCII (Korean) chars and pattern has a directory segment — deterministic per executor process from spawn
Environment
- Claude Desktop 1.26832.0.0 (Windows 10 Pro 10.0.19045)
- claude-code runtime 2.1.222 (
%APPDATA%\Claude\claude-code\2.1.222\claude.exe, spawned per session by the desktop app) - System locale: Korean (legacy ANSI codepage cp949); working directories contain Hangul segments
Summary
The Glob tool silently returns "No files found" for files that exist, whenever both conditions hold:
- the
pathargument contains non-ASCII (Hangul) characters, and - the pattern contains an explicit directory segment (literal or
*— anything except a leading**).
Either condition alone is fine. The failure is indistinguishable from a genuinely empty result (no error), so the agent concludes the files do not exist.
Additionally, the defect is decided at executor-process spawn: some claude-code executor processes exhibit it consistently for their whole lifetime while others (same binary, same machine, same minute) are consistently unaffected.
Reproduction
Real directory layout (all files exist, git-tracked; 업무저장소, 인프라, 사람 are Hangul names):
C:\00\업무저장소\log\
2021-W01.md ... 2026-W32.md (292 top-level .md files)
인프라\ (6 .md files)
사람\ (2 .md files)
Measured matrix (12 combos, re-run 6 times over 12h in the affected process — fully deterministic):
| path argument | pattern | result |
|---|---|---|
| C:\00\업무저장소\log (Hangul) | 인프라/*.md | ❌ "No files found" |
| C:\00\업무저장소\log (Hangul) | 사람/*.md | ❌ |
| C:\00\업무저장소\log (Hangul) | */*.md (pure-ASCII pattern!) | ❌ |
| C:\00\업무저장소\log (Hangul) | */2026-08-07.md | ❌ |
| C:\00\업무저장소\log (Hangul) | 인프라/2026-08-07.md (literal) | ❌ |
| C:\00\업무저장소\log (Hangul) | 인프라/**/*.md | ❌ |
| C:\00\업무저장소 (Hangul) | log/인프라/*.md | ❌ |
| C:/00/업무저장소/log (forward slashes) | 인프라/*.md | ❌ |
| C:\00\업무저장소\log (Hangul) | * (single segment) | ✅ 292 files |
| C:\00\업무저장소\log (Hangul) | **/*.md (recursive) | ✅ 300 files incl. both subdirs |
| C:\00 (ASCII) | 업무저장소/log/인프라/*.md (Hangul in pattern) | ✅ 6 files |
| C:\Users\<user>\.claude\skills (ASCII) | 조각/*.md (Hangul in pattern) | ✅ 1 file |
Key observations:
- Determinant = non-ASCII in the
pathargument × explicit directory segment in the pattern. Hangul inside the pattern is harmless;**-recursive traversal is harmless even with a Hangulpath. - Slash direction in
pathmakes no difference.
Per-process determinism (most diagnostic finding)
Same installed binary (2.1.222 is the only version present, unchanged during the whole period), same machine, measurements within the same minute:
- Executor A (fresh session spawn, previous evening): all directory-segment combos fail, first observed +27 min after spawn, consistent across 6 rounds over 12+ hours.
- Executor B (spawned next morning with
--resume=<session-id>): all 5 previously-failing combos pass, +25 min after spawn — reported counts (6 / 2 / 8 / 1) exactly match the real directory contents.
So the defect is fixed at process birth and stable for the process lifetime — not correlated with version, machine, or process age. This smells like an encoding/codepage initialization race at spawn (which would explain the non-ASCII specificity, the per-spawn variance, and the lifetime consistency). Sample size caveat: 1 failing spawn (fresh) vs 2 passing spawns (both --resume); the spawn-mode correlation is noted but unconfirmed.
Impact
The failure mode is a silent false negative. In our case the agent Glob-checked a directory for today's append-only log file, got "No files found", concluded it didn't exist, and attempted to create a "new" file over the existing one — only the Write tool's read-before-write guard prevented data loss. Any "create-if-missing" or "verify-absence" branch driven by Glob is unsafe under this bug. Same hazard class as #68343 (silent empty output on CJK paths misjudged as negative confirmation), but in the Glob tool itself rather than shell output.
Workarounds (verified)
- Root
pathat the nearest ASCII ancestor and move the non-ASCII segments into the pattern:path=C:\00,pattern=업무저장소/log/인프라/*.md→ works. - Use
**-recursive patterns and filter the results. - Treat Glob's "No files found" as non-evidence of absence before any create-if-missing branch; cross-check with
lsor an external search tool.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗