Fast File Search README

The full upstream README, mirrored for reference. Install config, tool schemas, adoption signals and our own overview live on the Fast File Search listing page.

ffs β€” Fast File Search

ffs β€” code-aware file search CLI for humans and AI agents

Release CI License Rust

A code-aware file search CLI for humans and AI agents. Really fast.
Replaces find + grep + glob + cat + tree-sitter with one binary. Typo-tolerant fuzzy matching, frecency ranking, token-budget reader, MCP server.

Terminal
curl -fsSL "https://raw.githubusercontent.com/quangdang46/fast_file_search/main/install.sh?$(date +%s)" | bash

πŸ€– Agent Quickstart (MCP / Robot Mode)

ffs ships a 15-tool MCP server over stdio. The installer auto-configures it for Claude Code, Codex, Cursor, Windsurf, Gemini, OpenCode, and more.

bash
# Run as MCP server
ffs mcp

# Agent-friendly JSON queries
ffs grep 'fn main' --format json
ffs symbol FilePicker --format json
ffs read crates/ffs-engine/src/lib.rs --budget 5000 --format json
ffs map --depth 3 --format json
ffs overview --format json
ffs deps path/to/file.rs --format json

Output conventions

  • stdout = structured data (JSON or text)
  • stderr = diagnostics, warnings
  • exit 0 = success

MCP tools exposed: ffs_find, ffs_grep, ffs_multi_grep, ffs_symbol, ffs_callers, ffs_callees, ffs_refs, ffs_flow, ffs_impact, ffs_outline, ffs_siblings, ffs_deps, ffs_map, ffs_overview, ffs_read


TL;DR

The Problem

File search and code navigation require a menagerie of tools: find, fd, grep, rg, glob, cat, plus a tree-sitter plugin for symbol queries. Each has different syntax, different startup cost, different output formats. AI agents struggle with this combinatorial explosion of invocation patterns β€” and every pipeline hop loses milliseconds that add up across hundreds of queries.

The Solution

ffs replaces all of them with a single binary that understands code. Typo-resistant fuzzy matching, frecency-ranked results, tree-sitter-powered symbol/callers/callees/refs queries, and a token-budget aware file reader β€” all from one executable that starts in milliseconds and keeps a warm cache for sub-10 ms subsequent calls.

Why ffs?

FeatureWhat it does
One binary to rule them allfind + grep + glob + cat + symbol + callers + refs in a single executable
Typo-tolerant by defaultQuery *.rs !test/ shcema works even with the typo
Frecency rankingFiles you open more often rank higher. Warm-up uses git touch history
Tree-sitter symbol indexAnswers code questions across 16 languages
Token-budget readerffs read path --budget 5000 clips body, preserves header and truncated footer
One warm processAfter first call, every subsequent query hits warm memory β€” no per-call subprocess spawn
MCP server15-tool stdio JSON-RPC server for AI coding agents
C ABI (.so/.dylib/.dll)Stable foreign bindings for Python, Node.js, and more
zlob (fast glob)Zig-compiled C glob matching, enabled by default

How ffs Compares

Capabilityffsfind/fdgrep/rgglobcat
File-name search (fuzzy, frecency)βœ…βœ…/βœ…β€”β€”β€”
Content grep (SIMD, typo-tolerant)βœ…β€”βœ…/βœ…β€”β€”
Symbol lookup (tree-sitter)βœ…β€”β€”β€”β€”
Callers / callees / refsβœ…β€”β€”β€”β€”
Token-budget file readerβœ…β€”β€”β€”βœ…
MCP serverβœ… 15 toolsβ€”β€”β€”β€”
Single process, warm cacheβœ…β€”β€”β€”β€”
Globbingβœ…β€”β€”βœ…β€”

Quick Example

bash
# Index once, query forever
ffs index                                     # ~200 ms on 10k-file repo
ffs find UnifiedScanner                       # fuzzy file-name search
ffs find grep --scored                        # role-aware ranking
ffs grep '\bTODO\b' --root crates/            # content grep
ffs grep 'fn main' --group                    # symbol-grouped grep
ffs multi-grep TODO FIXME HACK                # multi-literal OR (Aho-Corasick)
ffs symbol FilePicker                         # tree-sitter symbol lookup
ffs callers UnifiedScanner                    # who calls a symbol
ffs read crates/ffs-engine/src/lib.rs --budget 5000  # token-budget reader
ffs map --depth 3                             # workspace tree
ffs mcp                                       # run as MCP server over stdio
ffs mcp /path/to/workspace                    # pin MCP index root explicitly

MCP workspace root. When launched without a path (as installers do for Cursor/VS Code), ffs mcp resolves the root from, in order: WORKSPACE_FOLDER_PATHS (injected by Cursor/VS Code), VSCODE_CWD, then cwd. User-level ~/.cursor/mcp.json with args: ["mcp"] therefore indexes the open workspace, not the home directory. Prefer an explicit path (args: ["mcp", "${workspaceFolder}"]) in project-level configs when available.


Design Philosophy

PrincipleRationale
One binary to rule them allfind + grep + glob + cat + symbol + callers β€” no pipelining, no format wars
Typo-tolerant by defaultFuzzy auto-detect query mode; shcema still finds the right file
Frecency rankingFiles you open more often rank higher; warm-up uses git touch history
Tree-sitter symbol indexAnswers code questions, not just file-name questions β€” across 16 languages
Token-budget readerClips body but always preserves header + [truncated to budget] footer
One warm processAfter first call, every subsequent query hits warm memory β€” no per-call subprocess spawn

Installation

bash
# macOS / Linux β€” curl pipe
curl -fsSL "https://raw.githubusercontent.com/quangdang46/fast_file_search/main/install.sh?$(date +%s)" | bash

# Windows PowerShell
irm https://raw.githubusercontent.com/quangdang46/fast_file_search/main/install.ps1 | iex

# From source
cargo build --release -p ffs-cli
./target/release/ffs --version

The installers detect platform, fetch the matching release binary, verify SHA-256 sidecar, and atomically install to ~/.local/bin/ffs. MCP server configs are auto-detected for Claude Code, Codex, Cursor, Windsurf, VS Code, Gemini, OpenCode, and more.

Supported platforms

Linux x86_64/aarch64, macOS x86_64/aarch64, Windows x86_64/aarch64


Commands

CommandWhat it does
findFuzzy file-name search. Frecency-ranked, glob constraints, git-aware
globMatch files by glob pattern (replaces shell **)
grepContent search β€” plain / regex / fuzzy auto-detect
multi-grepOR-logic multi-pattern literal search (Aho-Corasick; alias multigrep)
readToken-budget aware file read (replaces cat)
outlineStructural outline of a file (functions, classes, top-level decls)
symbolExact + prefix lookup over the tree-sitter symbol index
callersFind call sites of a symbol. Bloom-filter narrowed candidates
calleesSymbols referenced inside a symbol body
refsDefinitions + single-hop usages in one shot
flowDrill-down envelope per definition (def + body + callees + callers)
siblingsPeers of a symbol in its parent scope
depsA file's imports + files that depend on it
impactRank workspace files by change impact for a symbol
indexBuild / refresh on-disk indexes (Bigram, Bloom, Symbol, Outline)
mapWorkspace tree annotated with file count and per-directory tokens
overviewHigh-signal repo summary (languages, top symbols, entry-points)
mcpJSON-RPC MCP server over stdio (replaces agent built-in tools)
guideEmbedded agent guide

Performance

Engine dispatch (256-file fixture)

Single-threaded medians on Linux x86-64 (Criterion.rs, CI runner).

Query typeMedian
Symbol lookup (worker_05_3)143 ns
Concept / NL query185 ns
File path (mod_03/file_2.rs)1.7 Β΅s
Glob (**/*.rs)1.1 Β΅s

Bigram index

Index size2-char query6-char query14-char query
10 K files37 ns104 ns120 ns
500 K files587 ns1.2 Β΅s1.2 Β΅s

Symbol index (1 K files)

OperationMedian
Index one Rust file (50 lines)105 Β΅s
Exact symbol lookup142 Β΅s

ffs vs rg (grep -l spawn benchmark)

Full-process wall-clock (startup + walk + search + output to /dev/null), 3 rounds Γ— 30 runs each, hyperfine median, --shell=none. Only counted as "ffs wins" when ffs won ALL 3 rounds.

RepoFilesNeedleffs (ms)rg (ms)Ratio3-round
tokio852poll8.713.00.67βœ… ffs 3/3
tokio852async8.313.40.62βœ… ffs 3/3
tokio852spawn8.912.80.69βœ… ffs 3/3
rust-lang706Option10.916.10.68βœ… ffs 3/3
rust-lang706Result11.515.20.76βœ… ffs 3/3
rust-lang706unwrap10.814.60.74βœ… ffs 3/3
serde208serde7.59.90.76βœ… ffs 3/3
serde208derive8.29.30.89βœ… ffs 3/3
serde208Serialize9.49.01.04❌ rg 3/3

ffs wins 8/9 needles consistently (all 3 rounds each), 1.1-1.6x faster. ffs's bigram prefilter skips non-candidate files, giving a clear advantage on repos with 200+ files and selective needles. rg wins when the needle appears in nearly every file (e.g. Serialize in serde).

Methodology. Criterion numbers from bench-track CI (ubuntu-latest). Spawn benchmark on macOS ARM64 (Apple Silicon, ffs 0.1.24, rg 15.2.0), hyperfine --shell=none --warmup 3 --runs 30, repeated 3 rounds.


Architecture

Code
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Frontends                               β”‚
β”‚ ffs-cli / ffs-mcp (MCP) / ffs-c (C ABI) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚ all surfaces share one core
                     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Engine                                  β”‚
β”‚ ffs-engine - dispatch / ranking /       β”‚
β”‚              budget enforcement         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Capability layer                        β”‚
β”‚ ffs-symbol - tree-sitter / bloom        β”‚
β”‚ ffs-grep - SIMD literal / regex         β”‚
β”‚ ffs-budget - token-aware reader         β”‚
β”‚ ffs-query-parser - query DSL            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Core SDK - ffs-search (crates/ffs-core) β”‚
β”‚ fuzzy search / scan / file_picker       β”‚
β”‚ score / git / frecency / watcher        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Troubleshooting

SymptomCauseFix
ffs index is slowFirst build β€” expectedOne-time cost. Subsequent calls skip re-parse
Symbol queries return emptyIndex stale (git HEAD changed)Re-run ffs index
Fuzzy search unexpected resultsQuery too short (1 char)Add more characters or path qualifiers (src/)
MCP server not respondingServer process exitedKeep ffs mcp running as background service

Limitations

Edge caseReality
Pre-built index requiredRun ffs index once per repo. Index auto-invalidates on HEAD changes
16 languagesTree-sitter supports 16; non-listed languages fall back to text-only queries
Frecency needs gitWarm-up uses git touch history; without git, frecency starts cold
MCP stdio onlyffs mcp speaks JSON-RPC over stdio β€” no HTTP/WebSocket transport (yet)

FAQ

Does ffs need a pre-built index?

Yes β€” run ffs index once per repo. The index is cached in <repo>/.ffs/ and auto-invalidates on schema bumps, git HEAD changes, or significant file-count drift.

Can I use ffs as a library from Rust?

Yes β€” all crates publish via ffs-*. The C ABI (ffs-c) is stable for foreign bindings (Python, Node.js, etc.).

What's the difference between ffs callers and ffs refs?

callers lists call sites (who invokes a symbol). refs combines definitions and usages in one shot β€” both call sites and other references.

Does ffs work on non-git directories?

Yes β€” it falls back to a full filesystem scan. Some features (frecency warm-up, cache invalidation) require git.

MCP vs CLI β€” which should agents use?

Prefer ffs mcp for agent contexts β€” 15 tools via stdio JSON-RPC, no parsing required. Use CLI with --format json for one-shot queries.


One binary. All your code-search tools. <10ms warm.