[BUG] Glob tool doesn't expand tilde (~) in path parameter
Resolved 💬 1 comment Opened Aug 15, 2025 by pnkfelix Closed Aug 16, 2025
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: 1.0.82-dev.20250815.t213816.shaa300aae (Claude Code)
- Operating System: Linux Amazon Linux 2023 (kernel 6.1.119-129.201.amzn2023.x86_64)
- Terminal: SSH terminal session
Bug Description
The Glob tool fails to expand tilde (~) in the path parameter, causing file searches to fail when using home directory shortcuts that work correctly in shell commands.
Steps to Reproduce
- Create a test file in home directory: touch ~/test.txt
- Use Glob tool with tilde path: Glob(pattern="test", path="~")
- Observe "No files found" result
- Use same pattern with absolute path: Glob(pattern="test", path="/root")
- Observe that the file is found successfully
Expected Behavior
Tilde should expand to the user's home directory (e.g., ~/AssistMe → /root/AssistMe), consistent with shell behavior and other Claude Code tools like Bash.
Actual Behavior
Tilde is treated as a literal character, causing the tool to search in a non-existent directory path and return "No files found" even when matching files exist.
Additional Context
- This affects all file types (regular files and symlinks)
- Other Claude Code tools like Bash properly handle tilde expansion
- Workaround is to use absolute paths instead of tilde notation
- Impact: breaks common workflow patterns and user expectations
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗