Coding agents use 7x fewer tokens with Moderne Prethink on code quality and test coverage tasks.
A code quality team gave its coding agents a list of every untested method from Moderne Prethink. Its test analysis agent finished 15x faster with 7x fewer tokens, and another of its agents worked out its own way to rank which gaps to close first. The team used that ranking to write tests for its most critical gaps first. A coding agent’s work is only as reliable as the tests that check it, so every gap the team closes makes its code more ready for AI.
- Financial services
- Industry
- 40,000
- Repositories with Prethink
Moderne Prethink gives coding agents deterministic context with zero token use.
Coding agents need to understand a codebase before they change it, and working that out from scratch in every session costs tokens. Prethink builds that context once, ahead of time. It runs Moderne recipes against the Lossless Semantic Tree, Moderne’s compiler-accurate model of the code, and writes the results into the repository as data files covering dependencies, architecture, test gaps, and code quality.
No AI model is involved, so generating the context uses no tokens and gives the same answer every run. When an agent opens the repository, the context is already there.
The team’s test analysis agent used 7x fewer tokens and finished 15x faster.
The agent reviews each repository’s test coverage and code quality, and the team uses it to write the tests that are missing. Without Prethink, it had to search the code for untested methods every time it ran. With Prethink, it read the list and went straight to the analysis, which now takes under a minute, down from 15.
Because it started from the full list of untested methods, the agent also had more to analyze, and its analysis came back 14x more comprehensive than what it produced without Prethink.
One of the team’s agents combined test gaps with code complexity to decide which tests to write first.
Prethink’s code quality data includes a complexity score for every class and flags code smells that coding agents tend to write, such as god classes and feature envy.
Because Prethink writes each kind of data as its own file, an agent can combine them however a task needs. Without being asked to, one of the team’s agents paired the test gap list with class complexity. It reasoned that an untested method in a complex class carries more risk than one in a simple class, and used that to rank which gaps to close first.
With agents writing more of its code, the team needed to know exactly where tests were missing.
The team is part of a code quality initiative that spans the company’s business units. It had been tracking testing with a coverage percentage, which shows how much of the code has tests but can’t tell an agent which methods don’t.
Prethink already reported coverage by listing the methods that had tests. The team asked for the reverse, every method without a test, along with a code quality report. Moderne released both the next day, and both are now part of Prethink.
The company now runs Prethink across all of its repositories.
Prethink now runs on all 40,000 of the company’s repositories, across multiple languages. Its recipes, including the code smell recipes, are built into the company’s own context tooling. The team’s agents now start each task knowing where tests are missing and where the code is hardest to change.
Related resources
See deterministic, estate-wide code change on your own repositories.