Inspiration
Ask an AI if a codebase is well built, and you get an opinion. Ask it why, and you get another opinion.
CHECK24 gave every team the same three real-world codebases (Artemis, ThingsBoard, Apache Fineract) and the same brief: map the architecture, judge its quality, and say whether it got better or worse once AI coding tools arrived. We didn't want to add one more opinion. We wanted a verdict you can check.
So we made one rule: every line has a witness. Every claim CodeJudge makes points to a source line, pinned to an exact commit.
What it does
For each repository, CodeJudge turns thousands of files into a ranked, evidence-backed top 20, and a before/after verdict on where the architecture is heading.
Every repository runs through the same pipeline, at two snapshots: the pinned commit, and the last mainline commit before 1 March 2025.
| Artemis | ThingsBoard | Fineract | |
|---|---|---|---|
| Production files (before → now) | 3,506 → 7,188 | 4,667 → 7,838 | 4,288 → 5,795 |
| Architecture findings today | 543 | 377 | 155 |
| Shown in Fix First | top 20 | top 19 (1 failed the evidence check) | top 20 |
| #1 finding | account ↔ course two-way dependency (36 vs 180 uses) |
BaseController.java hotspot (complexity 338) |
SavingsAccount.java hotspot (complexity 780, 33 commits/yr) |
| Largest knot | 31 Java modules / 32 TypeScript modules | 33 packages in application |
26 packages in fineract-loan |
| Verdict since March 2025 | MIXED | MIXED | BETTER |
- Fix First, not 500 warnings. Findings are ranked by code; the top 20 per repository each come with exact file and line evidence, a one-sentence explanation, and an LLM judgment with a concrete fix. Everything else is counted, not listed, and stays on the map.
- Down to the line. Every finding opens a case file with highlighted source lines at the pinned commit and a GitHub link. Example: Artemis #1 is proven by
ConductAgreement.java, line 15. - Knots, not noise. A two-way dependency is a pair; pairs that share modules (or packages inside one module) form a knot. Artemis's 270 module-level cycle pairs collapse into 2 knots. Fineract's modules are Gradle sub-projects, which cannot form module cycles, so its knots appear at package level.
- We test the cut instead of promising it. Simulate cutting a dependency on the map: the graph is recomputed and shows whether the pair breaks and whether the knot still holds.
- An honest before/after. Rates per 1,000 production files instead of raw counts, renamed or added modules separated from real change, and moves under 10% marked unchanged. Artemis: cycles between features 14.5 → 8.1 and layer violations 2.3 → 1.0 per 1,000 files, but the main Java knot grew from 19 to 31 modules (MIXED). Fineract: cycles between features 13.8 → 10.7 per 1,000 files (BETTER).
- Wrapped: each codebase's story since March 2025, in a few cards.
In total: 4.5 million lines across both snapshots of all three repositories.
How we built it
A Python pipeline of single-purpose stages that communicate only through JSON files. Everything up to the ranking is deterministic code.
- Git history. Churn over the 12 months before each snapshot: renames followed, mass commits (> 300 files, e.g. formatting sweeps) and bots excluded, cherry-picks deduplicated by patch-id. Complexity is cyclomatic complexity per file (lizard). Hotspot score = percentile(change frequency) × percentile(complexity).
- Parse. Java and TypeScript via tree-sitter syntax trees, not regex: explicit, wildcard and same-package imports, fully qualified class names in code and in strings, TypeScript path aliases, barrels and Angular lazy routes. Every edge stores the source lines that create it.
- Model. Files rolled up into packages and modules (NetworkX). Imports that are only named in Javadoc, or never used, are dropped; interface-to-implementation links are kept out of cycle detection.
- Analyze. Two-way dependencies grouped into knots per language and level; layer violations where a lower layer uses a higher one (web layer = classes annotated
@RestController/@Path, so it works across Spring and JAX-RS codebases without per-repo configuration); hotspots. - Rank. Score = severity × impact × confidence, where impact is the mean of the churn and fan-in percentiles of the most affected file (for a cycle: the weaker direction, the code you would change to cut it). The LLM shortlist is capped per type, per file and per knot (3 cuts per knot), so the review budget covers distinct problems.
The LLM comes in only at the end (Claude Sonnet 5.5 as judge, Claude Opus 5.5 for the overview, via the CHECK24 proxy). It reviews only the shortlist, about 25 findings per snapshot, and only what code can't decide: is this a real design problem, and how do you fix it? Each call gets one finding, its graph neighbourhood and at most 3 snippets of 60 numbered lines read from git. Code then enforces:
- Evidence check: any citation outside the snippets we sent rejects the answer.
- Bounded influence: severity can move one level at most; the LLM never orders findings, code re-ranks.
- Number check: in the before/after verdict, every number must be one our code computed, or the answer is rejected (one retry with the exact problems, then a summary written by code).
Replay. LLM answers are cached by a SHA-256 of model, prompt version, system prompt, schema and input, and committed. ./run.sh rebuilds everything: no API key, zero LLM calls, byte-identical output (verified from a fresh clone and under different hash seeds). The UI loads straight from disk.
Challenges we ran into
- The proxy runs Claude on Google Vertex AI, whose policy blocks structured outputs and server-side fallbacks. We moved the JSON schema into the prompt, validate every field ourselves, built a client-side refusal fallback, and turn off any feature the endpoint rejects for the rest of the run.
- Raw numbers lie. Artemis doubled in size and reorganised its folders: 75 "new" and 41 "resolved" cycles were renames. Every comparison is now size-normalised and rename-aware.
- Unstable cache keys. Rank positions and score ties in the prompts invalidated the cache whenever a finding was added. We removed positions and made every tie-break deterministic.
- Keeping the LLM honest. It cited lines it never saw and copied unchecked numbers into summaries; both are now blocked by code.
- Parallel calls without overspending. Six requests in flight, each reserving its worst-case cost first, so concurrent calls can never jointly exceed a spending cap.
Accomplishments that we're proud of
- The LLM caught a mistake in our own rules. It dismissed Fineract services living in
domainpackages as false positives; our broken-rule signal (> 1/3 of a type dismissed) fired, and we fixed the rule. - 4.43 USD for the whole project (294 LLM calls). A replay costs nothing and sends nothing anywhere.
- Three large codebases, one command, a few minutes, and a jury rerun that reproduces our results exactly.
- Over 200 automated tests, and every evidence line verified against the real file at its commit.
What we learned
The most useful AI isn't the one with the most opinions. It's the one that has to show its evidence. Let code find, measure and rank; let the LLM judge only what code can't; and make every claim checkable. And "better or worse" is easy to answer badly: normalisation, rename handling and stating clearly what the AI did not review matter as much as the verdict.
What's next for CodeJudge
- A CI mode that comments on a pull request when it grows a hotspot or a knot.
- Private code, on-premise: all model calls go through one module (
llm.py), so a locally hosted model is a contained change, and no code leaves the building. - More languages: a new language needs a tree-sitter grammar and import rules; the later stages don't change.
Other tools give opinions. CodeJudge gives evidence, down to the line.
Built With
- anthropic
- claude
- css
- cytoscape.js
- git
- highlight.js
- html
- javascript
- lizard
- networkx
- python
- tree-sitter