tgrep-skill

Searches text and code in Windows repositories using Microsoft's trigram-indexed tgrep tool.

Updated Aug 10, 2026
One-click install
npx skills add https://github.com/narr07/permadi --skill tgrep-skill-narr07
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tgrep-skill
Source: https://github.com/narr07/permadi/tree/main/.roo/skills/tgrep-skill
Command: npx skills add https://github.com/narr07/permadi --skill tgrep-skill-narr07

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Searching large Windows repositories with grep, ripgrep, findstr, or Select-String rescans every file on each query, wasting minutes on repos with hundreds of thousands of files. This Skill enforces the use of tgrep, Microsoft's trigram-index search tool, and wraps it in scripts that automatically handle indexing and server lifecycle so every search runs against a warm index. ## Core Features & Use Cases - Mandatory tgrep enforcement: Explicit rules forbid falling back to grep, ripgrep, findstr, or Select-String when tgrep is available, with a documented emergency-fallback exception. - Automatic server and index management: The tsearch.ps1 wrapper checks for tgrep in PATH, starts a background tgrep server if none is running, adds .tgrep/ to .gitignore, and runs the search in one command. - Installation and server scripts: install-tgrep.ps1 downloads the official x86_64 Windows release via GitHub CLI or builds from source with cargo, and start-tgrep-server.ps1 manually starts a server for a target folder. - Complete flag reference: references/full-flags.md documents every ripgrep-compatible flag, including flags that force full scans and flags silently ignored when an index is active. - Use Case: An AI agent asked to find where a function is used across a 500K-file monorepo calls tsearch.ps1 with -Literal, gets results in milliseconds through the running server, and never touches slower scanning tools. ## Quick Start Ask the AI to search for where a specific function or string is used in this project, and it will run the tsearch.ps1 wrapper with your pattern and path.

Frequently Asked Questions about tgrep-skill

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I search code faster than ripgrep on Windows?▼

Use tgrep, Microsoft's trigram-index search tool, which builds an index once and answers queries through a background server. Official benchmarks show 7x to 38x speedups over ripgrep on repos from 16K to 504K files.

What is tgrep and how does it differ from ripgrep?▼

tgrep is a ripgrep-compatible CLI from Microsoft that searches via a persistent trigram index and server instead of rescanning files. It accepts most ripgrep flags but can be slower for extremely common patterns matching most files.

How do I install tgrep on Windows without Rust?▼

Run the install-tgrep.ps1 script, which downloads the official x86_64 Windows release binary using the GitHub CLI. If gh is unavailable, it falls back to cargo install from source, which requires git and a Rust toolchain.

Why is tgrep slower than ripgrep for some queries?▼

tgrep is slower when a pattern matches most files, because the trigram index cannot filter candidates and IPC delivery of millions of matches costs more than direct scanning. It excels at specific, rare patterns like function names.

Why does tgrep not find newly created files?▼

Without a running server, results are only as fresh as the last tgrep index run. With a server, watcher events process asynchronously, so add the --no-index flag for a search that must see the latest edits.

Which tgrep flags are silently ignored when an index is active?▼

The --follow, --one-file-system, and --ignore-file flags are silently ignored on indexed searches without any warning. Pair them with --no-index when their behavior is actually required for correct results.