Grep Tool Fails to Find Existing Patterns
Status Fixed / completed
Maintainer reply ✓ Yes — ant-kurt
Workaround ✓ Mentioned in description ↑
Activity 8 comments · opened Aug 14, 2025 · closed Aug 22, 2025
💡 Likely answer: A maintainer (ant-kurt, collaborator)
responded on this thread — see the highlighted reply below.
Bug Description
Confirmed: Grep Tool Bug
Yes, this appears to be a Claude Code Grep tool bug! Here's the evidence:
Working vs Broken:
- ✅ Bash tool: grep works perfectly
- ❌ Grep tool: Always returns "No matches found" even for content that definitely exists
Tested Multiple Patterns:
- val_results - exists but Grep tool doesn't find it
- import pandas - exists but Grep tool doesn't find it
- Same file, same working directory
Should You Restart Claude Code?
It might help! This could be:
- Tool state issue - The Grep tool might be in a bad state
- File handle issue - The tool might not be reading the current file version
- Permission issue - Though Bash tool works fine
Try restarting Claude Code first. If the Grep tool still fails after restart, then we know it's a more fundamental tool issue.
Workaround for now: I'll use the Bash tool for all grep operations since it works reliably:
bash: grep -n "pattern" filename.py
This is definitely a tool bug, not a file or search strategy issue. Good catch!
Environment Info
- Platform: linux
- Terminal: vscode
- Version: 1.0.80
- Feedback ID: 16862fc8-0d5d-4881-9a16-ebfb351ebda1
Errors
[{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n at _V (/$bunfs/root/claude:1638:1192)\n at map (native:1:11)\n at qQ (/$bunfs/root/claude:1638:905)\n at $oG (/$bunfs/root/claude:2213:5239)\n at zE (/$bunfs/root/claude:188:19860)\n at Uy (/$bunfs/root/claude:190:42827)\n at Ay (/$bunfs/root/claude:190:38350)\n at ER (/$bunfs/root/claude:190:38278)\n at kE (/$bunfs/root/claude:190:38132)\n at fK (/$bunfs/root/claude:190:35195)","timestamp":"2025-08-14T02:52:54.604Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n at _V (/$bunfs/root/claude:1638:1192)\n at map (native:1:11)\n at qQ (/$bunfs/root/claude:1638:905)\n at $oG (/$bunfs/root/claude:2213:5239)\n at zE (/$bunfs/root/claude:188:19860)\n at Uy (/$bunfs/root/claude:190:42827)\n at Ay (/$bunfs/root/claude:190:38350)\n at ER (/$bunfs/root/claude:190:38278)\n at kE (/$bunfs/root/claude:190:38132)\n at fK (/$bunfs/root/claude:190:35195)","timestamp":"2025-08-14T02:52:54.617Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n at _V (/$bunfs/root/claude:1638:1192)\n at map (native:1:11)\n at qQ (/$bunfs/root/claude:1638:905)\n at $oG (/$bunfs/root/claude:2213:5239)\n at zE (/$bunfs/root/claude:188:19860)\n at Uy (/$bunfs/root/claude:190:42827)\n at Ay (/$bunfs/root/claude:190:38350)\n at ER (/$bunfs/root/claude:190:38278)\n at kE (/$bunfs/root/claude:190:38132)\n at fK (/$bunfs/root/claude:190:35195)","timestamp":"2025-08-14T02:52:54.674Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n at _V (/$bunfs/root/claude:1638:1192)\n at map (native:1:11)\n at qQ (/$bunfs/root/claude:1638:905)\n at $oG (/$bunfs/root/claude:2213:5239)\n at zE (/$bunfs/root/claude:188:19860)\n at Uy (/$bunfs/root/claude:190:42827)\n at Ay (/$bunfs/root/claude:190:38350)\n at ER (/$bunfs/root/claude:190:38278)\n at kE (/$bunfs/root/claude:190:38132)\n at fK (/$bunfs/root/claude:190:35195)","timestamp":"2025-08-14T02:52:54.676Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n at _V (/$bunfs/root/claude:1638:1192)\n at map (native:1:11)\n at qQ (/$bunfs/root/claude:1638:905)\n at $oG (/$bunfs/root/claude:2213:5239)\n at zE (/$bunfs/root/claude:188:19860)\n at Uy (/$bunfs/root/claude:190:42827)\n at Ay (/$bunfs/root/claude:190:38350)\n at ER (/$bunfs/root/claude:190:38278)\n at kE (/$bunfs/root/claude:190:38132)\n at fK (/$bunfs/root/claude:190:35195)","timestamp":"2025-08-14T02:52:54.769Z"},{"error":"Error: Language not supported while highlighting code, falling back to markdown: \n at _V (/$bunfs/root/claude:1638:1192)\n at map (native:1:11)\n at qQ (/$bunfs/root/claude:1638:905)\n at $oG (/$bunfs/root/claude:2213:5239)\n at zE (/$bunfs/root/claude:188:19860)\n at Uy (/$bunfs/root/claude:190:42827)\n at Ay (/$bunfs/root/claude:190:38350)\n at ER (/$bunfs/root/claude:190:38278)\n at kE (/$bunfs/root/claude:190:38132)\n at fK (/$bunfs/root/claude:190:35195)","timestamp":"2025-08-14T02:52:54.795Z"},{"error":"Error: Language not supported while highlighting code, falling ba
Note: Error logs were truncated.
8 Comments
This is a very wierd but serious bug! The grep tool seems not working, but the model doesn't know. So it could not find related contents in file. Please see the attached chat history.
grep_tool_not_working.txt
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Interesting, claude identified itself. This can be the reason:
@subercui the issue / solution is here: https://github.com/anthropics/claude-code/issues/4741#issuecomment-3177976916
Thanks, after reading it, this one can be a different issue. There is no config file as mentioned in https://github.com/anthropics/claude-code/issues/4741#issuecomment-3177976916
And you are sure ripgrep is properly installed? Someone else discovered it wasn't actually installed and after reinstalling ripgrep everything worked.
Two potential reasons for this:
claude /doctorshows "Search" is not OK, you'll want to install ripgrep and set the env var in docsPlease comment here if you're still running into this after trying the above! Try running with
claude --debugand seeing if there are any logs related to "rg"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.