File Search Returns No Results Despite Matching Content
Status Closed — not planned
Maintainer reply ✓ Yes — dicksontsai
Workaround ✓ Mentioned in thread ↓
Activity 12 comments · opened Sep 9, 2025 · closed Mar 23, 2026
💡 Likely answer: A maintainer (dicksontsai, collaborator)
responded on this thread — see the highlighted reply below.
Bug: Search function fails to find text that exists in file
Environment
- Claude Code version: v1.0.69
- OS: Windows
Impact
This bug makes the Search function unreliable for finding text in files, forcing users to fall back to external tools like grep.
Description
The built-in Search function is not finding text that clearly exists in files. When searching for the word "morbi" in a test file, the Search function returns 0 results, but using grep on the same file successfully finds the text.
Steps to Reproduce
- Create a file
test.txtwith the following content:
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo magna eros quis urna.
Nunc viverra imperdiet enim. Fusce est. Vivamus a tellus.
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin pharetra nonummy pede. Mauris et orci.
Aenean nec lorem. In porttitor. Donec laoreet nonummy augue.
Suspendisse dui purus, scelerisque at, vulputate vitae, pretium mattis, nunc. Mauris eget neque at sem venenatis eleifend. Ut nonummy.
- Use the Search function:
Search(pattern: "morbi", path: "test.txt", output_mode: "content") - Observe that it returns "Found 0 lines"
- Use grep on the same file:
grep "morbi" test.txt - Observe that grep successfully finds the text on line 3
Expected Behavior
The Search function should find and return line 3 containing "morbi" just like grep does.
Actual Behavior
The Search function returns 0 results despite the text being present in the file.
Evidence
● I've created a CLAUDE.md file for your repository. Since this is a minimal test repository with only a single
text file containing Lorem ipsum content, the documentation is correspondingly brief. The file provides context
about the repository's purpose and structure for future Claude Code instances.
> does the word morbi occur in test.txt ?
● Search(pattern: "morbi", path: "test.txt", output_mode: "content")
⎿ Found 0 lines
● Search(pattern: "morbi", path: "test.txt", output_mode: "content")
⎿ Found 0 lines
● No, the word "morbi" does not occur in test.txt.
> now try with grep
● Bash(grep "morbi" "C:\Users\me\source\repos\scripts\search-test\test.txt")
⎿ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin pharetra no
nummy pede. Mauris et orci.
● Yes, the word "morbi" does occur in test.txt. It appears in line 3: "Pellentesque habitant morbi tristique
senectus et netus et malesuada fames ac turpis egestas."
12 Comments
Found 1 possible duplicate issue:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
This is a different issue
Is there a reason you're on a very old version of Claude Code (v1.0.69)? Maybe try upgrading first to the latest version?
Otherwise, there may be an issue with ripgrep. Try setting the env var
USE_BUILTIN_RIPGREP=0in your settings if you have already installed ripgrep separately.I see I have another issue as well... let me check if resolving that fixes this as wsell
Your best bet might be to uninstall all existing versions of Claude Code and reinstall the latest Claude Code.
I'm also experiencing this in claude 2.0.50 - I will have searches done like this:
But then a specific search like this works
_Note: Privacy.vue, Terms.vue and Cookies.vue all exist in
~/git/app/resources/js/pages/Legal_This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
Experiencing the same issue on version 2.1.15 on Arch Linux.
Most recent occurrence today: Search returned 0 results when looking for a skill folder that exists in
~/.claude/skills/. The skill directory is clearly present on the filesystem.This has happened multiple times when Claude attempts to search for directories or files - the Search tool reports no results despite the content/paths existing.
Haven't tried the
USE_BUILTIN_RIPGREP=0workaround yet, but that's masking the underlying bug rather than fixing it.This issue affects multiple platforms (Windows, macOS per #16936, now Linux) and multiple versions (1.0.69, 2.0.50, now 2.1.15). It shouldn't be auto-closed without proper investigation - the Search tool failing silently is a significant reliability issue.
Hello. Just wanted to add that I filed one of the recent issues that the github-actions mentioned as being duplicates of this one. I'm absolutely using the most recent version after updating from 2.1.20.
@Isoceth Check https://github.com/anthropics/claude-code/issues/27171#issuecomment-3947423951. Try to run
claude --ripgrep --versionand see if it fails.Closing for now — inactive for too long. Please open a new issue if this is still relevant.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.