hay Website · site-v0.4.0

Same matches.
Better order.

Meet hay, a ranked grep for coding agents. Ripgrep’s matching engine, with likely definitions first—and one result per file before a file’s second line.

Complete searches preserve the normalized ripgrep match set. Candidate caps or read errors return exit 2, so an incomplete answer stays explicit.

One query.
Two reading orders.

In this fixture, the declaration moves from fourth to first. The matches stay the same.

hay validateSession .Illustrative fixture · 6 matches · 4 files

rg --sort pathPath order

  1. ./docs/migration.md:1The migration notes mention validateSession; the implementation lives in src/auth/session.ts.
  2. ./src/auth/session.test.ts:1import { validateSession } from "./session";
  3. ./src/auth/session.test.ts:2console.assert(validateSession("token"));
  4. ./src/auth/session.ts:1export function validateSession(token: string): boolean {
  5. ./src/routes/login.ts:1import { validateSession } from "../auth/session";
  6. ./src/routes/login.ts:3 return validateSession(token);

hayRanked reading order

  1. ./src/auth/session.ts:1export function validateSession(token: string): boolean {
  2. ./src/routes/login.ts:1import { validateSession } from "../auth/session";
  3. ./src/auth/session.test.ts:1import { validateSession } from "./session";
  4. ./docs/migration.md:1The migration notes mention validateSession; the implementation lives in src/auth/session.ts.
  5. ./src/routes/login.ts:3 return validateSession(token);
  6. ./src/auth/session.test.ts:2console.assert(validateSession("token"));

Real output from a small, synthetic fixture. This shows the mechanism, not general retrieval quality. Inspect the fixture and commands

Find the file.
Keep the conversation.

Two deliberate additions to a focused tool. Neither changes ordinary content ranking.

Start with a name.

Exact names, substrings, or an adjacent typo. Search live filenames, then refine by glob, type, size, age or Git status.

Available in source 0.4.0.

hay --find sesison .
Explore filename search

Give your agent a session.

Use grep, find_files and multi_grep through stdio MCP. You choose the Git repositories; every query reads live files.

Available in source 0.4.0.

hay --mcp --root .
Set up MCP

Evidence.
Including the limits.

The public test asks for a declaring file. That is hay’s home turf; it does not measure an agent completing a task.

Published definition-finding benchmark

Mean reciprocal rank: 1.0 means the declaring file is first on every query. Historical results from 2026-08-28, using hay 0.3.0.

Historical public mean reciprocal rank, deterministic ripgrep comparison, and absolute difference with a 95% confidence interval.
Corpushayrg path orderDifference 95% interval
Linux kernel30 queries0.9330.541+0.392[0.247, 0.544]
openclaw30 queries0.9280.819+0.109[0.035, 0.200]
ripgrep23 queries0.8770.419+0.458[0.304, 0.613]
Alamofire29 queries0.7760.433+0.343[0.235, 0.459]

The separate documentation track has no detected wins and four regressions. Read the complete report for methods, exclusions and both statistical tests.

The private behavioral gate still fails.

Median-repository MRR 0.4328 / 0.50; answer in the top ten 77.21% / 80%. Historical corpus: 2026-09-23. These results were not rerun for this release, and the gate was not moved.

Read the research record

Same matches.
See them move.

A silent overview of the search order, source-only filename and MCP modes, dated evidence and installation choices.

Read the film’s text alternative

Same matches. Better order. hay is a ranked grep for coding agents. Likely definitions come first, then one result from each file. Complete searches preserve the normalized ripgrep match set; caps or read errors mean incomplete results.

The search order moves. The illustrative hay validateSession . fixture has six matches in four files. The declaration moves from fourth to first, with all six matches retained. Four different files appear before any file’s second result. Read both complete result lists above.

Source 0.4.0 features. hay --find sesison . finds exact names, substrings and an adjacent typo. hay --mcp --root . manually starts stdio MCP with grep, find_files and multi_grep. Both use live files. MCP searches stay within explicit Git repository scopes; there is no persistent index or search history.

Evidence and limits. The historical hay 0.3.0 definition-finding benchmark is dated 2026-08-28. The table above gives all four corpora, query counts, MRR values, absolute differences and 95% intervals shown in the film. Definition finding is hay’s home turf, not agent-task success. The documentation track has zero detected wins and four detected regressions. The private behavioral gate still fails and was not rerun for these source-only features.

Choose an installation. brew install mneves75/tap/hay installs supported binary 0.3.2. Filename discovery and MCP require source 0.4.0. Use the pinned --locked source instructions below. The film ends at mneves75.github.io/hay/ for the methods and complete installation instructions.

Start with the method
hay overview · 36 seconds · silent · text alternative alongside

Your terminal.
Your choice.

Use the supported release, or build the pinned source for the new filename and MCP modes.

Homebrew

Supported binary 0.3.2.
macOS and Linux; prebuilt and attested.

brew install mneves75/tap/hay

Build from source

Source 0.4.0.
Includes --find and --mcp.
Requires Rust 1.88 or later.

git clone https://github.com/mneves75/hay.git
cd hay
git checkout --detach 268e41834a0a66d922102edc70a97f5ca82aca8e
cargo install --locked --path hay

Make your first search, then keep the manual close. Flags, JSON, exit codes and MCP configuration are all there.