Glob tool silently fails when pattern contains ~
Resolved 💬 3 comments Opened Dec 12, 2025 by bukzor Closed Dec 16, 2025
Summary
The Glob tool returns empty results (no error) when the pattern contains ~, because ~ is not expanded in the pattern parameter. This is a UX bug - the silent failure makes debugging difficult.
Reproduction
# Fails silently - returns "No files found"
Glob(pattern="~/.claude/commands/**/tdd*")
# Works - ~ expanded in path parameter
Glob(pattern="**/tdd*", path="~/.claude/commands")
Expected Behavior
Either:
- Expand
~in the pattern parameter (match shell behavior) - Return an error/warning when
~detected in pattern: "pattern contains~, did you mean to use thepathparameter?"
Actual Behavior
Returns "No files found" with no indication that ~ wasn't expanded.
Impact
- Silent failure mode is confusing
- Even Claude Opus didn't catch this initially, suggesting other models/users will struggle
- Users may incorrectly conclude the file doesn't exist
Environment
- Claude Code CLI
- Glob tool
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗