The Moderne Technology Stack

The foundation for enterprise code modernization and coding agents.

Four primitives do the heavy lifting: a compiler-accurate code model, deterministic recipes, precomputed semantic context, and sub-second search. Built for the largest enterprise codebases and the coding agents working in them.

01 - DATA

Lossless Semantic Tree: the data layer

The LST is a compiler-accurate representation of your codebase. It captures full type attribution, symbol resolution, dependencies, and generics, while preserving every comment, whitespace, and formatting detail so diffs read like hand-written code.

  • Deep code understanding. Everything the compiler knows: types, symbols, generics, inheritance, transitive dependencies, all resolved and queryable.

  • Format fidelity. Indentation, comments, and style preserved so automated diffs are clean, reviewable, and trusted.

  • Multi-repo scale. LSTs are generated once, serialized to disk, and reused, so the same recipe runs across thousands of repositories in parallel.

$ mod run . --recipe UpgradeToJava21
Scanning 312 repositories across Java, Python, C# portfolios...
Found 312 repositories | 4.2M lines of code | 7 languages
Running recipes across language boundaries...
✔ Java 21 migration: 247 repos, 18,420 files changed
✔ JavaScript ESLint cleanup: 54 repos, 1,247 files refactored
✔ Python type annotations: 38 repos, 2,811 files updated
MOD SUCCEEDED · 285 repos updated · 312 PRs open for review
02 - PROGRAMS

Recipes: deterministic programs that run the same way every time

Recipes are programs that traverse the LST to search, analyze, and transform code. They are deterministic: the same recipe run against the same code produces the same result every time. That property is what makes safe, portfolio-wide automation possible.

  • Thousands of open-source recipes, plus Moderne's proprietary catalog. OpenRewrite community recipes cover migrations, security fixes, code quality, framework upgrades, and dependency management. Moderne adds proprietary recipes for enterprise-grade migrations, security remediation, and Prethink context generation.

  • Composable and extensible. Recipes chain together into larger workflows. Teams write their own for internal conventions, custom migrations, and org-specific standards.

  • Safe by design. Operating on the LST rather than raw text means transformations respect types, scope, and style. No regex fragility, no broken builds.

03 - KNOWLEDGE

Moderne Prethink: agents read context instead of inferring it

Coding agents waste tokens reconstructing system understanding on every prompt. Prethink runs that work once, deterministically, against the LST, and writes the result where agents can read it directly: structured models of architecture, dependencies, call graphs, and service boundaries, available as resolved facts.

  • Not RAG, not embeddings, not prompts. Deterministic analysis of semantic code models produces compiler-accurate, reusable context, with guarantees that retrieval and vector approaches can't offer.

  • Built from LSTs, run as recipes. Prethink inherits the accuracy of the LST and the composability of recipes. Teams customize what gets precomputed for their agents.

  • Outputs agents can read. Markdown, CSV, and CALM artifacts written to your repo or a context registry. Refreshable via CI, on a schedule, or after major refactors.

  • Build LST code models per repo

    An LST is a fully resolved, compiler-accurate model of the repository, capturing both structure and meaning of the code.

  • Run Moderne Prethink recipes to build context

    Prethink is generated using a set of recipes that run on the LSTs, bootstrapping knowledge quickly and consistently.

  • Put context where agents work

    Prethink recipes output inspectable CSV, Markdown, and CALM artifacts to a repo or context registry.

  • Agents access Prethink in their workflow

    Agents reference Prethink to understand resolved knowledge about the code without needing to parse it.

  • Keep context up-to-date continuously

    Teams control exactly when and how that context is refreshed.

01 — Search

Agent issues a query

Literal text, regex, or structural pattern. Same syntax as ripgrep.

02 — Trigram Index

Trigrep narrows scope via indexed lookup

Query intersects posting lists in a persistent index built from text and the LST. Sub-second, regardless of corpus size.

10,000 → 47 repos with confirmed matches

03 — Act

Recipe runs only on filtered scope

Semantic analysis and deterministic transformation execute against the 47 confirmed repos, not all 10,000.

99.5% reduction in compute, with no loss in coverage
04 - DISCOVER

Moderne Trigrep: the discovery layer

Agents constantly search code to orient themselves, and every grep burns tokens, compute, and latency. Trigrep replaces repeated file scanning with a persistent trigram index built from text and the LST, shifting the cost of reconnaissance from GPU tokens to CPU-powered lookup.

  • Sub-second, at any scale. Searching a billion lines of code takes roughly the same time as searching thousands. Trigrep is 13.5× faster than ripgrep on average in Moderne's testing.

  • Symbol-aware, not just text. Indexes built from the LST carry type and structural context, so agents can combine text discovery with semantic filters and skip the expensive follow-up reads that text-only grep forces.

  • A prefilter for automation. Search first to narrow scope, then run recipes only where matches exist. A search hit in 47 of 10,000 repos means the recipe runs on 47 (a 99.5% reduction in compute).

  • Scoped to organizational structure. Searches align with how enterprise teams actually work: by business unit, portfolio, or initiative, so results are immediately actionable, not noise.

Three ways to put the stack to work.

The four primitives power three consumer surfaces: Moderne's own chatbot inside the SaaS platform, a hosted MCP server that connects external coding agents to your full code estate, and a local MCP server that grounds external agents in the repository on a developer's machine.

SURFACE 01 · FIRST-PARTY

Moddy

Moderne's first-party agent

Moddy is the conversational interface inside the Moderne SaaS platform and the recommended way to use recipes there. Ask Moddy to find usages, run a migration, or explain a dependency graph, and it operates against the full LST of your code estate using deterministic recipes and Trigrep-backed search.

SURFACE 02 · HOSTED MCP

Moderne SaaS MCP

External agents on your full code estate

The Moderne SaaS MCP server exposes Trigrep and recipe tools over the Model Context Protocol, so external coding agents (Claude Code, Cursor, Copilot, Codex) can search and transform across your entire hosted code estate, not just the repo currently open. Hosted alongside your LSTs, governed by your existing access controls.

SURFACE 03 · LOCAL MCP

Local Moderne MCP

External agents on the local repo

The Moderne CLI runs a local MCP server alongside the developer's coding agent. One command installs it. The agent gets Trigrep search, LST-backed semantic analysis, and deterministic recipe execution against the current repository, with no source code leaving the machine.

How it fits together

Discover. Understand. Act.

Each primitive does one job well. Together they give agents and developers a complete loop for portfolio-scale software evolution: fast reconnaissance, resolved context, and deterministic change.

STEP 01

Discovery

Locate the repositories, patterns, and code that matter, across the entire portfolio, in sub-second time.

Trigrep
STEP 02

Understand

Reason from resolved structure: types, dependencies, and architecture, instead of inferring from raw files.

LST + Prethink
STEP 03

Act

Apply deterministic, format-preserving changes across thousands of repositories with coordinated rollout.

Recipes

PUT THE STACK TO WORK

Coding agents become enterprise-ready when they run on this stack.

From one-repo experimentation to multi-repo execution: precise targeting, deterministic change, and resolved context, anchored to the LST.

Frequently asked questions

What's the difference between Moderne and a coding agent like Claude or Copilot?
Is Prethink just RAG over my codebase?
How is Trigrep different from regular code search like grep or Sourcegraph?
Do I need to finish modernizing my codebase before agents can use Moderne?
Can I use recipes without Moderne?
How do coding agents actually call Moderne's tools?
Why can't my coding agent just do this on its own at scale?