Fast regex search using trigram indexes. Based on Cursor's research.
Builds a trigram inverted index over your codebase and uses it to skip files that can't possibly match — 14x–80x faster than grep/ripgrep on indexed repos.
brew tap GrowlyX/instantgrep
brew install instantgrepOr build from source:
mix deps.get && mix escript.buildAlso available as igrep and instantgrep.
ig "pattern" path/ # search (builds index on first run)
ig --build . # build/rebuild index
ig -i "todo|fixme" src/ # case-insensitive
instantgrep --no-index "pattern" . # brute-force mode (no index)./instantgrep-bench lib/
./instantgrep-bench --patterns patterns.txt --iterations 10 /path/to/project- Index — Extracts all overlapping 3-byte trigrams from every file, stores in an inverted index with bloom-filter masks
- Query — Decomposes your regex into required trigrams
- Filter — Looks up trigrams in the index to find candidate files
- Verify — Runs full regex only on candidates
MIT