Make search failure a third outcome
Use when
A coding agent uses file or content search to decide whether an implementation exists. Claude Code 2.1.277 fixes Grep/Glob reporting no matches when process, memory, or file-handle exhaustion prevented the search from starting.
Action
Require
that
repair
or
a
reviewed
equivalent
before
trusting
these
negative
results.
In
an
owned
search
adapter,
expose
status=matches|empty|error.
Preserve
the
executable,
query,
root,
filters,
exit/signal,
stderr,
and
truncation
flag.
For
direct,
non-quiet
ripgrep,
normal
exit
0
means
matches;
1
means
no
matches;
2
means
error.
Failed
spawn,
timeout,
and
signal
termination
are
errors—not
empty
results.
Never
infer
success
from
empty
stdout
or
convert
a
rejected
execution
into
an
empty
list.
Block
absence-dependent
edits
until
the
error
is
resolved;
retain
permissions
and
intended
search
scope.
Acceptance check
Use an authorized disposable fixture containing an included SEARCH_SENTINEL. Its query must match; an absent token must return completed empty. An invalid regex, missing executable, and injected EAGAIN/ENOMEM/EMFILE startup failures must return error and prevent absence-driven changes. Mock resource failures; do not exhaust the host. A deliberately broken error-to-empty adapter must fail the same oracle. Exercise the actual parent and applicable child search paths. Retain the deployed version, raw receipts, query/scope, and resulting file state—not just the assistant’s explanation.
Evidence
Anthropic’s dated release explicitly names the startup-failure repair. Ripgrep’s tagged source and manual make exit-status semantics inspectable. Issue 27171 provides older comparative search transcripts and versioned musl startup diagnostics. Those reports illustrate additional false-empty paths; they do not independently validate this release or establish its root cause.
Caveat
The Claude repair has no public implementation or regression output inspected here. Native builds may search through Bash’s embedded ugrep/bfs instead; do not transfer ripgrep’s contract without checking the actual backend. Quiet-mode ripgrep can suppress error status after a match. Ignored files, wrong roots, and pagination can still hide content; empty means only empty within the searched scope. The proposed adapter and fixtures were not executed. No upgrade, installation, or evaluation is authorized by this issue.