Indexed trigram search returns results in under a second across thousands of repositories, holding near-constant speed even across billions of lines.
Indexes built from the Lossless Semantic Tree carry type and symbol data, so the first search is the answer instead of a grep followed by expensive confirmation reads.
Searches run inside a business unit, team, or application portfolio as defined in the Moderne Platform, not across every repository indiscriminately.
Trigrep turns code search into an indexed lookup that is fast, structurally aware, scoped to your org, and wired directly into automation.
During the repository build, Trigrep builds a trigram index in a Zoekt-compatible format. Queries intersect posting lists in that persistent index instead of scanning raw files, which is why searching billions of lines runs in roughly the time it takes to search thousands.
When the index is built from the LST, it carries symbol and type information that raw text lacks. A search combines literal text with structural filters, so results are precise enough to act on directly. The grep-then-read loop that confirms a match disappears.
Indexes align with the org structure defined in the Moderne Platform. A search can start within a business unit, team, application portfolio, or modernization initiative instead of spanning every repository, so results stay focused and immediately actionable.
Search results feed directly into recipe runs as a prefilter. Identify the repositories that contain a pattern in seconds, then run the transformation only where it applies. If a search matches 47 repositories out of 10,000, the recipe run processes 47 instead of 10,000.
Search for a framework, version string, or deprecated construct to size the work before any recipe runs.
Find vulnerable version strings, weak crypto calls, disabled protections, or credential-like patterns that warrant a closer look.
Locate imports, annotations, configuration keys, and API names to see where a technology or pattern actually appears.
Search error messages, log fragments, and stack-trace text to land on the relevant code in seconds.
Narrow thousands of repositories to the ones that match, then run recipes only where they apply.
Use search results as a checklist to confirm a transformation reached every occurrence.
Engineers and agents locate what matters across the whole org without scanning repository by repository.
Symbol-aware results remove the grep-then-read loop that burns context window space and tokens before any work begins.
Fast search becomes the first step of a governed change, feeding the matched set directly into recipes.

The full technical story: trigram indexing, LST-infused search, organizational scoping, and the 13.5x-faster-than-ripgrep benchmark.
How search, context, and execution work together to make every coding agent faster, more accurate, and more token-efficient.
Precomputed, compiler-accurate context for coding agents. Where Trigrep handles Discover, Prethink handles Understand.
Moderne Trigrep is a high-speed, symbol-aware code search engine built for coding agents and engineers working across large, multi-repository codebases. It builds trigram indexes from your code and returns results in sub-second time, scoped to a business unit, team, or application portfolio as defined in the Moderne Platform.
grep and ripgrep scan raw files on every query, which slows down across large codebases and often forces follow-up reads to confirm a match has the right type. Trigrep queries a prebuilt trigram index instead of scanning, and because that index is built from the Lossless Semantic Tree, results carry symbol and type data. A search returns semantically precise results in under a second, with no follow-up reads needed.
In Moderne's testing, Trigrep is 13.5x faster than ripgrep on average. The gain comes from two places: indexed lookup instead of repeated file scanning, and symbol-aware results that remove the expensive confirmation reads a text-only search usually triggers.
Trigrep supports Sourcegraph query syntax (the default) and the original Zoekt syntax, plus Comby-style structural patterns. Because these are the same query languages widely documented online, AI models already trained on those tools can use Trigrep without learning a new language. Searches support literal text, regular expressions, boolean operators, and structural matching.
Both. Trigrep matches text quickly, and since its index is built from the Lossless Semantic Tree it adds structural awareness on top, so you can filter by symbol, return type, visibility, and inheritance. For questions that require full type resolution across a hierarchy, Trigrep hands off to OpenRewrite recipes, which resolve types at every call site.
Agents call Trigrep the same way they reach for grep today, through the Moderne CLI and MCP. A plain output mode returns one match per line (file, line number, and a short snippet) optimized for agents like Claude Code and Cursor. Because the first search is precise, agents orient faster and spend fewer tokens before the first line of automation runs.
Yes. A search can act as a prefilter for a recipe run, so a transformation processes only the repositories that contain a relevant pattern. If a search matches 47 of 10,000 repositories, the recipe run handles 47 instead of all 10,000. The same results also serve as a checklist to confirm the change reached every occurrence.
Trigrep performs text, regex, and structural search across the languages Moderne indexes. For the current language coverage of semantic filters, see the Moderne documentation.
Trigrep is available through the Moderne CLI and through Moderne's MCP server, and it operates within the context of a Moderne organization. Indexes are built during the LST build process and stored alongside, so search is ready whenever an engineer or agent needs it.