Bash glob expansion fails for *.jsonl files in ~/.claude/projects subdirectories
Open 💬 3 comments Opened Aug 13, 2025 by VibeCodingWW
Description
Glob expansion (*.jsonl) completely fails when used in Claude Code's conversation storage directories, returning the error "ls: cannot access 'glob': No such file or directory". This affects any commands or scripts trying to list or process conversation files.
Steps to Reproduce
# 1. Navigate to any conversation directory
cd ~/.claude/projects/-home-any-convo-directory
# 2. Try to list jsonl files with glob
ls *.jsonl
# Result: ls: cannot access 'glob': No such file or directory
# 3. Verify files actually exist
find . -name "*.jsonl" | wc -l
# Result: 23 (or however many files exist)
# 4. Test that glob works for other patterns in same directory
touch test1.txt test2.txt
ls *.txt
# Result: test1.txt test2.txt (works fine\!)
Expected Behavior
ls *.jsonl should list all .jsonl files in the directory
Actual Behavior
Returns error: "ls: cannot access 'glob': No such file or directory"
Impact
- Custom commands using glob patterns fail
- /conversations command had to be rewritten to avoid globs
- Any user scripts relying on *.jsonl patterns break
- For loops like
for file in *.jsonlsilently fail
Environment
- Claude Code CLI
- Linux environment via SSH
- Bash version: GNU bash, version 5.2.21(1)-release
Workaround
Use find instead of glob expansion:
# Instead of: ls *.jsonl
find . -name "*.jsonl"
Additional Notes
The error message "cannot access 'glob'" suggests Claude Code is incorrectly interpreting the glob pattern as a literal filename.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗