Prethink is the deterministic context registry for coding agents and organizations.

Prethink turns a highly edge-dense code graph into tables that a coding agent can consume. The same tables populate central code observation data lakes for enterprise-wide context. It is computed deterministically, at zero token cost, across all your repositories.

Agents spend most of their tokens on discovery,
not on writing code.

An agent loop runs in four phases: discover, plan, act, and review. Only act writes code, and it gets about a fifth of the budget. Discovery and planning come first, so 75% of the token budget is gone before the agent writes a line. The loop then repeats: every task, every iteration.

AI coding agents promise speed, but in a real codebase the context is what slows them down.

Prethink is a recipe that pulls data out of the LSTs and writes it back as data tables covering dependencies, APIs, architecture, code quality, and test metrics. It runs deterministically at no token cost, and you can extend it to capture your own internal frameworks and architectural patterns.

Instead of making an agent infer your architecture from raw code, Prethink hands it resolved knowledge about service endpoints, dependencies, test coverage, and more.

Moderne’s AI agent tools: deterministic, accurate, and faster reasoning at scale.

Prethink provides far deeper context than many
AST based attempts, because of the richness of the
LST it is derived from.

Instead of scanning hundreds of files and burning tens of thousands of tokens, an agent starts from resolved knowledge of service boundaries, dependencies, data flows, and architecture, versioned alongside the code itself.

Dropped into a repository, it lets an agent query for what it needs instead of re-reading files and dependencies to rebuild the same picture every session. As new code lands, the agent gets immediate feedback on code quality and test coverage.

Enabling coding agents and organizations
on the whole code estate.

Aggregate Prethink context centrally across every repository and you get a view of the estate that no agent could assemble on its own. An agent working in one repo can pull from it too, reading organization-wide architecture practices, the dependencies already in use, and where each API is called, so it knows how to evolve an application that spans many repositories.

Organizations use the same tables for centralized planning, technology decisions, and vendor management.

Compiler-accurate context for your agents and your organization, at zero token cost.

Frequently asked questions

LLMs need more than raw source files to understand large codebases. Accurate context comes from a resolved, system-level understanding that captures structure, dependencies, and relationships across repositories. Prethink deterministically derives this context directly from the codebase and keeps it refreshed as the code changes, giving agents a shared, up-to-date view they can reason from without scanning millions of lines on every task.

Hallucinations happen when agents infer how a system works from incomplete or fragmented context. Ground an agent in resolved, authoritative knowledge (real dependencies, service boundaries, and configuration) and it reasons from verified structure instead of guessing, so hallucinations drop and outputs become more reliable.

Raw code is text without meaning attached. On its own it doesn’t convey resolved types, symbol relationships, architectural boundaries, or runtime behavior. LLMs have to infer those from snippets, which leads to partial understanding and errors. Structured, resolved context gives agents the meaning behind the code, not just the characters on the page.

Semantic code context represents what code means, not just what it says. It includes resolved symbols, types, dependencies, relationships between components, and architectural structure, so agents can reason about behavior, impact, and constraints instead of stitching together guesses from raw text.

Sending large volumes of raw code consumes tokens quickly, and it usually has to be repeated across sessions and tasks. Agents spend tokens reconstructing context every time they work on a repository, which drives inference costs up, and that cost grows fast in large, multi-repo systems.

Structured context lets agents start from a shared understanding of the codebase instead of rebuilding it on every interaction. When key relationships and structure are already resolved, agents need fewer tokens to build their understanding, which lowers overall LLM usage and cost.

Service boundaries are rarely obvious from individual files. Agents need explicit knowledge of endpoints, integrations, and how components interact. Surfaced as structured context, that knowledge lets agents reason about impact across services instead of inferring boundaries from scattered code references.

Architecture diagrams built for humans are visual and descriptive, but not machine-readable. Prethink emits CALM-formatted architecture: structured representations of components and relationships that agents can query and validate, so they understand boundaries, dependencies, and system topology programmatically.

Recommendations are grounded when agents reason from authoritative, up-to-date knowledge of how the system actually works, resolved from the codebase itself rather than from ad hoc prompts or inferred relationships. Grounded context reduces guesswork and makes outputs more trustworthy.