Meet Moderne Trigrep

Sub-second code search for agents and large codebases

Schedule Demo
trigrep indexed code search
$ mod search
searching the trigram index…
2 matches, resolved from the LST · 0.3s
…/owner/Owner.java:21 class Owner extends Person
…/vet/Vet.java:18 class Vet extends Person
# the classes that extend Person, not text matches
Next ▸ mod run --last-search
run a recipe on only the repositories that matched

Fast discovery. Precise results. Search scoped to how you organize code.

Moderne Trigrep gives engineers and coding agents an indexed view of the whole codebase, so discovery stays instant and accurate instead of slowing down repo by repo.

Sub-second discovery at scale

Indexed trigram search returns results in under a second across thousands of repositories, holding near-constant speed even across billions of lines.

Symbol-aware, no follow-up reads

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.

Scoped to your organization

Searches run inside a business unit, team, or application portfolio as defined in the Moderne Platform, not across every repository indiscriminately.

What is Moderne Trigrep?

The name combines two ideas. The tri is trigram indexing, a decades-old technique that replaces repeated file scanning with indexed lookup. The grep is the search workflow engineers and coding agents reach for to orient themselves before they act. Together they describe a search tool built for the way modern codebases are actually explored.

Instead of scanning every file on every query, Trigrep uses a persistent index, so searching a billion lines of code takes roughly the time it takes to search thousands. Moderne builds those indexes from the Lossless Semantic Tree, the compiler-accurate code model that also powers Moderne recipes. When the index carries LST data, a search can combine plain text discovery with structural filters and symbol-aware searches that would be fragile or impractical with text-only tools.

grep was built to scan a few files on your filesystem. Trigrep was built for the whole estate.

Different search approaches serve different jobs. The question is which one keeps up when an agent runs dozens of searches across thousands of repositories in a single workflow.

Approach What it gives you Where it falls short at scale
grep, ripgrep, ag Simple, local, immediate raw-text scanning Re-scans files on every query and needs follow-up reads to confirm matches, so it slows down sharply across large, multi-repo codebases
Vector / embedding search Fuzzy, similarity-based retrieval across files Approximate by design, returns broad candidate sets that still need reading and reasoning, adding tokens and latency
Semantic search and transformation (Moderne recipes) Full type resolution and precise transformation on the LST More than discovery needs as a first step (better run after Trigrep narrows scope, to transform or fully resolve the matches)
Moderne Trigrep Trigram indexing with LST data and organizational scoping, fast and contextual discovery that is ready to feed automation By design, stops at discovery. Hands the matched set to recipes when full semantic resolution or transformation is needed

How Moderne Trigrep works

Trigrep turns code search into an indexed lookup that is fast, structurally aware, scoped to your org, and wired directly into automation.

Builds a compact trigram index from your code

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.

  • Indexes built at build time, not rebuilt on every query
  • Index typically occupies about 10 to 20% of the original source size
  • Near-constant search speed even across very large application portfolios

Infuses the index with Lossless Semantic Tree data

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.

  • Filter by symbol, type, visibility, and inheritance, not just text
  • Supports Sourcegraph and Zoekt query syntax plus Comby structural patterns, so models already trained on those tools use Trigrep without learning a new language
  • The first search is the answer, with no follow-up reads to confirm a type

Scopes search to your organizational structure

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.

  • Scope to organizations, teams, business units, or portfolios
  • Aligned to the same org structure Moderne already uses
  • Focused results instead of noise across the entire estate

Feeds discovery straight into automation

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.

  • Pass a search straight to a recipe run as a prefilter
  • Skip the repositories that cannot match, cutting compute and time
  • Search results double as a before-and-after checklist for the change

What you can do with Moderne Trigrep

Scope a migration before you run it

Search for a framework, version string, or deprecated construct to size the work before any recipe runs.

Surface security and compliance signals

Find vulnerable version strings, weak crypto calls, disabled protections, or credential-like patterns that warrant a closer look.

Trace dependencies and usage

Locate imports, annotations, configuration keys, and API names to see where a technology or pattern actually appears.

Investigate incidents faster

Search error messages, log fragments, and stack-trace text to land on the relevant code in seconds.

Prefilter large-scale automation

Narrow thousands of repositories to the ones that match, then run recipes only where they apply.

Validate change after the fact

Use search results as a checklist to confirm a transformation reached every occurrence.

Make discovery the fast part of change.

Orient in sub-second time

Engineers and agents locate what matters across the whole org without scanning repository by repository.

Stop wasting tokens on reads

Symbol-aware results remove the grep-then-read loop that burns context window space and tokens before any work begins.

Turn discovery into action

Fast search becomes the first step of a governed change, feeding the matched set directly into recipes.

Bring fast, precise discovery to your software estate.

Dive Deeper

Blog

From grep to Moderne Trigrep

The full technical story: trigram indexing, LST-infused search, organizational scoping, and the 13.5x-faster-than-ripgrep benchmark.

agent tools

Moderne agent tools at scale

How search, context, and execution work together to make every coding agent faster, more accurate, and more token-efficient.

product

Moderne Prethink

Precomputed, compiler-accurate context for coding agents. Where Trigrep handles Discover, Prethink handles Understand.

Frequently Asked Questions

What is Moderne Trigrep?
How is Trigrep different from grep or ripgrep?
How much faster is Trigrep than ripgrep?
What query syntax does Trigrep use?
Does Trigrep understand code structure, or just text?
How do coding agents use Trigrep?
Can search results drive automation?
What languages does Trigrep support?
How is Trigrep delivered?