HYPERDRIVE

CLI & AGENTS / UPDATED 3 DECEMBER 2026

The hd command.

Find files by name in under a millisecond, from the terminal or from an agent. Search contents with hd grep.

hd is a small client on macOS. A local background index service keeps your home folder indexed and up to date; hd sends it one JSON line over a Unix socket and prints the reply.

Start

hd invoice     # search names; the first run starts the index service
hd doctor      # check the setup at any time
hd status      # root, coverage, entry count, memory

The engine behind it: 50 results in 0.48 ms at p95 for one file-filtered query, in a test index of 6,508,588 files on an Apple M2 Max. Read the method.

Commands

#CommandWhat it does
1hd [FLAGS] <WORDS...> [DIR]Search file and folder names.
2hd grep [FLAGS] <PATTERN> [DIR]Search file contents. hd g is the same.
3hd recent [--since 5m] [DIR]Files changed or deleted recently. Default: the last 5 minutes.
4hd sizes [DIR...]Total size, file count and folder count of each folder. Default: the current folder.
5hd statusService pid, root, coverage, entry count and memory. hd info is the same.
6hd doctorChecks the socket, the published endpoint, the service binary and the live index. Never starts anything. Exits 1 when hd cannot work.
7hd root [list|add DIR|rm DIR]List, add or remove indexed roots.

Flags

Filters

#FlagMeaning
1-e, --ext EXTExtension. Repeat for several: -e rs -e toml. A leading dot is fine.
2-t, --type f|d|lFiles, folders or symlinks only.
3-g, --glob GLOBFile name glob, for example '*.config.*'. Repeatable.
4--not-glob GLOBExclude a file name glob.
5--name-is NAMEExact file name, case-folded.
6-E, --exclude WORDExclude results with WORD in any path component or the name.
7--not-word WORDExclude results with WORD in the name only.
8-p, --words-in-pathLet all words match parent folders too.
9--prefix TEXT, --suffix TEXTName starts or ends with TEXT.
10--size-min SIZE, --size-max SIZESize bounds: 512, 10k, 5m, 1g. Binary units; kb, mb, gb are decimal.
11--since TModified within T: 60s, 10m, 2h, 7d, 1w.
12-H, --hiddenInclude dotfiles and dot folders.

Scope and paging

#FlagMeaning
1-c, --cwdSearch only under the current folder.
2-d, --dir DIRSearch only under DIR.
3-l, -n, --limit NMaximum results. Default 50, max 2000. -l20 works too.
4--offset NSkip N results. The JSON reply gives the next offset.
5--recentSame as hd recent.

Output

#FlagMeaning
1(none)One absolute path per line.
2-L, --longKind (f, d, l), size, age, path.
3--dmenuPlain paths for pickers such as fzf and Neovim.
4-0, --print0NUL-separated paths, for xargs -0.
5-j, --jsonFull JSON with size, age and mtime per hit.
6-a, --agentCompact JSON for agents. See agent mode.
7--include-artifactsIn agent mode, keep target, dist, .venv and __pycache__.
8--no-waitDo not wait for the first index build after the service starts.

Recipes

hd -e pdf tax 2024                    # PDFs with 'tax' and '2024' in the name
hd -c -e rs -e toml config            # .rs and .toml files under the current folder
hd -t d node_modules -l 200 -L        # node_modules folders, with size and age
hd --size-min 1g -t f -L              # files of 1 GiB or more
hd --since 1h -e md -d ~/notes        # Markdown edited in the last hour
hd recent --since 10m -c              # what changed here in the last 10 minutes
hd sizes ~/Downloads ~/Movies         # folder totals
hd -0 -e log --since 7d | xargs -0 ls -lh

Pipe --dmenu output into a picker. Two shell functions:

cdh() { cd "$(hd --dmenu -t d "$@" | fzf)"; }   # jump to a folder
vh()  { nvim "$(hd --dmenu "$@" | fzf)"; }      # edit a file

Content search: hd grep

The index first picks candidate files by name, extension, size, age and folder. Only those files are opened.

Binary files, cloud-only placeholders (iCloud, OneDrive) and files over 4 MiB are skipped unless you ask for them. Dotfiles and build folders are skipped by default.

hd g TODO                             # literal text under the current folder
hd g -e rs 'fn main' ~/proj           # only .rs files under ~/proj
hd g -E 'todo|fixme' -i               # regex, ignore case
hd g -C 2 -m 3 'panic!'               # 2 lines of context, 3 matches per file
hd g --files -0 TODO | xargs -0 nvim  # open every file that matches
hd g --count -g '*.md' draft          # match count per file
#FlagMeaning
1-F, -E, -w (--sym)Literal (default), regex, or whole word.
2-P, --pattern PATExtra literal pattern; any may match. Repeatable, up to 16.
3-S, -i, -sSmart case (default), ignore case, match case.
4-e, -g, --not-glob, --name-is, --exclude WORDThe same file filters as a name search.
5--since T, --max-filesize SIZEOnly files changed within T; skip files over SIZE (max 64m).
6-H, --include-artifacts, --binaryAlso search dotfiles, build folders, binary files.
7-l, -n, --limit N, -m, --max-count N, --offset NMax files (default 50), matches per file (default 10), paging.
8-C, --context N, --max-columns NContext lines (0 to 10); clip lines to N characters.
9--files, --count, -0Paths only, path:count, or NUL-separated paths.
10-j, -a, --token-budget NFull JSON; compact agent JSON; agent reply cap in tokens.

Agent mode: hd -a

-a prints one compact JSON object, built to spend as few tokens as possible without losing information.

$ hd -a -c parser
{"b":"/Users/me/proj/src","us":212,"h":["parser.rs\t18K\t2h","parser/\t\t2h","parser/tests.rs\t6.1K\t3d"]}
#CommandKeys
1hd -a ...b, h, trunc, cov, us (service time in microseconds), hm, next (offset for the next page)
2hd recent -ab, m (modified: rel\tsize\tage), d (deleted: rel\tage), trunc, cov, us
3hd sizes -af ([path, size, files, folders] or [path, "err", message]), b when there are several folders, cov, us
4hd status -aroot, entries, cov, why, be (backend)
5hd grep -ab, m (total matches), us, f, hm, trunc, cov

hd grep -a defaults to 25 files, 3 matches per file, 160-character lines and a 1500-token reply. Matches in secret files such as .env, *.pem and id_rsa are replaced with <redacted-secret-file>.

$ hd g -a -e rs unwrap
{"b":"/Users/me/proj/src","m":3,"us":1840,"f":[["main.rs",2,["12:let cfg = load().unwrap();","40:x.unwrap()"]],["lib.rs",1,["7:v.unwrap()"]]]}

MCP server IN DESIGN

An MCP server is in design: tools for name search, scoped search and recent changes, with strict folder limits, read-only by default. No dates yet.

Today, agents call hd -a directly. We publish the MCP API when it is stable, not before.

Platforms

hd runs on macOS. On Windows, Hyperdrive runs inside FastFinder. The private beta list hears first about new builds.

Apply for Private Beta