Glob: wildcard in a literal path segment fails to match emoji directory names (`30.*BD-X*` → No files found; `**/*.md` works)
Summary
The Glob tool fails to match a directory whose name contains emoji when the pattern uses a wildcard inside a literal path segment (e.g. 30.*BD-X*). It returns No files found even though the path exists — while a pure-recursive **/*.md against the same tree finds the file, and Bash find/ls handle it fine. So this is not "Glob can't traverse emoji dirs" (it can) — it's specifically the * wildcard not matching across emoji characters within a literal segment.
Minimal reproduction
mkdir -p "ge2/30. 🏗️🧙♂️🔮 BD-TEST/05. ☎️🧙♂️🔮 RP-TEST"
echo x > "ge2/30. 🏗️🧙♂️🔮 BD-TEST/05. ☎️🧙♂️🔮 RP-TEST/file.md"
Then, with path = the ge2 dir:
| Glob pattern | Result |
|---|---|
| **/*.md | ✅ finds …/30. 🏗️🧙♂️🔮 BD-TEST/05. ☎️🧙♂️🔮 RP-TEST/file.md |
| 30.*BD-TEST*/**/*.md | ❌ No files found |
| (Bash) find ge2 -name '*.md' | ✅ finds it |
The only difference is whether a literal segment with a wildcard (30.*BD-TEST*) has to span the emoji. Pure ** recursion bypasses per-segment pattern matching, so it works; the literal-segment pattern does not.
The emoji here include a ZWJ sequence (🧙♂️ = U+1F9D9 U+200D U+2642 U+FE0F) and variation selectors (☎️, 🏗️), which is what real-world note/PKM/Obsidian-style repos (and ours) use in folder names.
Expected
30.*BD-TEST*/**/*.md should match the directory — * should span emoji characters in a path segment the same way it spans any other characters (as the underlying shell glob / find do).
Impact
Repos with emoji-named folders can't be targeted by partial-path glob patterns. The failure is silent — No files found reads as "the path is absent," leading to wrong conclusions (e.g. an agent concludes a folder doesn't exist and writes to the wrong fallback path). Hit fleet-wide for us where every project/notes folder is emoji-named.
Workaround
Use a pure-recursive ** pattern (no emoji-spanning literal segment), or fall back to Bash find/ls -d to resolve emoji folder paths. Never treat a Glob "miss" as proof of absence on an emoji tree.
Environment
- OS: Windows 11 (Git Bash shell)
- Tool: Claude Code v2.1.187 —
Globtool - Path matching appears to mishandle multi-byte / grapheme-cluster (emoji, ZWJ) content inside a literal pattern segment.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗