tgrep
What is tgrep?
tgrep is a high-performance, trigram-indexed grep tool designed for rapid regex searching within massive codebases. By utilizing a client/server architecture with persistent indexing, it significantly reduces search latency compared to traditional tools like grep or ripgrep.
tgrep is an advanced command-line utility engineered to solve the performance bottlenecks of searching through large-scale monorepos. Unlike standard tools that scan every file per query, tgrep pre-builds a trigram index, allowing it to instantly identify and search only the relevant files. This architecture enables near-instantaneous results, with benchmarks showing up to 52x faster performance than ripgrep on large repositories.
The tool features a robust client/server model where a background server maintains a hybrid index of on-disk data and in-memory overlays for real-time file changes. It is highly optimized for memory efficiency, using external merge sort strategies to keep peak memory usage flat regardless of repository size. Integrated into the GitHub Copilot CLI, tgrep is a powerful solution for developers working in environments where traditional search tools are too slow.
tgrep is built by Microsoft and fits into the AI Coding category. It was released on Sep 7, 2026.
tgrep is free to use and open source, with the source code on GitHub. Teams typically use it for refactoring, code review, test generation and legacy migration, with domain-specific use in Fintech, E-commerce and Embedded / IoT.
Who tgrep is for
Teams and individual developers working in AI Coding.