Omniscio

OmniscioGuidesThe search failed

Claude Code: The search failed

The important word is "failed". A search that fails is not a search that found nothing, and treating the two as the same can hide a file that is right there.

Last checked against Anthropic's documentation on November 26, 2026. By the Omniscio team. Updated .

What is the exact message?

The search failed, so this is not a "no matches" result: matches may exist. What happened to the search program (ripgrep) is not known, and no results were read. Run the search once more. If it fails again, tell the user that searches are failing.

Anthropic gives this wording and says it is what Claude receives in place of results when a Grep or Glob search fails before returning anything.

It is addressed to Claude, not to you. The last sentence is the instruction Claude follows when the retry fails.

What does it mean?

The search program, ripgrep, failed before it returned anything. What happened to it is not known, and no results were read, so the question "does this text exist in the project" is still open.

That is why the message leads with the distinction. A completed search with no hits is a negative answer; this is no answer at all.

The two tools it covers do different jobs: Grep searches file contents and Glob matches file names, and both are built on ripgrep. Either can fail this way.

What to do the first time

Nothing. The message asks Claude to search again first, so the first appearance may clear on its own and needs no action from you.

Act when Claude tells you that searches are failing. That sentence means the retry also failed, and the message says so explicitly.

Capture the error for a report

This step starts Claude Code from a terminal. If you started it from an app, report the problem with /feedback instead.

  1. Start a session with a debug file. From your shell, start a session with the same flags as the one where searches failed, plus --debug-file claude-debug.log.
  2. Repeat the search. Send Claude the request that led to the failed search.
  3. Find ripgrep's line. If the search fails again, look in claude-debug.log for the line containing rg error (signal=.
  4. Report it with that line. Include the line when you report the problem, so the report carries the error instead of only the symptom. Use /feedback inside Claude Code, Anthropic's route for reporting a problem.

How do I know it is fixed?

  • Claude runs the same search again and gets results, or a completed search with no hits.
  • Claude stops saying that searches are failing.
  • A search you can repeat by hand in the same project also succeeds.

Where these answers come from

Common questions

What does "The search failed" mean in Claude Code?

A Grep or Glob search that Claude ran failed before it returned any result, so whether matches exist is unknown. The message Claude receives in place of results starts by saying exactly that, and asks Claude to run the search once more.

Does it mean there are no matches?

No, and the message says so in its first words: this is not a no-matches result. Nothing was read, so a file you expect can still contain the text. Only a search that completes and returns nothing is a real no-match answer.

What should I do the first time it appears?

Nothing. The message asks Claude to run the search again first, and a single failure may clear on that retry. Step in when Claude tells you searches are failing, because then the retry did not work.

How do I capture ripgrep's error for a report?

Start a session from your shell with the same flags plus --debug-file claude-debug.log, send the request that led to the failed search, and look in that log for the line containing rg error (signal=. Include that line when you report the problem.