# tgrep

A trigram-indexed grep tool with a client/server architecture for fast regular-expression search across large codebases, integrated into GitHub Copilot CLI.

tgrep builds a trigram index of a codebase so that regex searches only need to be verified against files that could plausibly match, rather than scanning everything. A background server keeps the index available and updates it asynchronously as files change; without a server running, searches fall back to an on-disk index or a full filesystem scan.

It is used inside GitHub Copilot CLI to power fast searches across large repositories, and can also be installed with startup hooks and MCP search tools for Codex or other agents. In a benchmark sweep across repositories and platforms, the project reports it was faster than ripgrep in the large majority of combinations tested, with results depending on the query, repository, and storage involved.

Website: https://github.com/microsoft/tgrep
