Dev.to WebDev 🛠 Dev 👁 0 📖 2 min read

I benchmarked my repo-compression CLI on a 25k-star monorepo, and it found three bugs in itself

Every new Claude Code session on my projects started the same way. The agent re-read the repository, rediscovered the design tokens, and forgot what we decided yesterday. On a large repo that is a lot of tokens spent bef

Every new Claude Code session on my projects started the same way. The agent re-read the repository, rediscovered the design tokens, and forgot what we decided yesterday. On a large repo that is a lot of tokens spent before any real work.

So I built ai-ria, a small open-source CLI that writes a .ria/ folder into your project. Your agent reads that folder instead of the whole repo:

an architecture summary, routes, components and conventions
a compressed context pack, sized to a token budget
memory that survives between sessions: decisions, warnings, design rules
handoffs, so you can switch between Claude Code, Cursor and Codex without starting from zero
design tokens, read from your CSS or from Figma exports
It makes no LLM calls. It is static analysis, so it's deterministic, needs no API key and runs in seconds.

npx ai-ria analyze .
The benchmark
Before announcing it, I ran the published version on two well-known Next.js repositories.

vercel/commerce (14k stars) worked as expected. Roughly 30–42k tokens of source became a ~7.6k-token pack, with 12 routes and 31 components detected.

dubinc/dub (25k stars, a Turborepo monorepo) went worse. From the repo root, ai-ria reported:

framework: Node
routes: 0
components: 2
security findings: 382 (2 critical/high)
All three numbers were wrong:

The monorepo was read by its tooling root. The root package.json only lists tooling. The real app lives in apps/web, which has 456 routes.
Components outside components/ were invisible. dub keeps hundreds of kebab-case components in ui/ folders.
The security report was almost all noise. 379 of the 380 "insecure http URL" findings were inline SVG namespaces (xmlns="http://www.w3.org/2000/svg"). The two "critical" findings were a local Docker URL in a hint message and a password in a Playwright test.
The fixes (0.2.1)
Workspace roots (npm/yarn/bun workspaces, pnpm, Turborepo, Lerna, Nx) are detected, each package is analyzed on its own, and the repo is described by its main app.
Components count from ui/, widgets/, primitives/ and elements/ folders as well. Stories, tests and fixtures don't count.
XML namespaces and localhost URLs are no longer flagged, and e2e suites (playwright/, cypress/, e2e/) are treated as tests. Remote http:// URLs and remote credentials are still flagged.
Same command on dub after the fix:

framework: Next.js (apps/web, 9 workspaces)
routes: 456
components: 846
security findings: 0 (0 critical/high)
context pack: ~13504 tokens (raw ~1989768)
That's about 2M tokens of source down to a ~13.5k-token pack.

What I learned
Running your tool on someone else's real repo, before anyone else does, is the cheapest code review you'll get. My own test fixtures were all single-package apps with a components/ folder, so the tests stayed green while the tool was wrong on a whole class of real projects.

Try it
npx ai-ria analyze . # writes .ria/
npx ai-ria agent-pack . # AGENT_PACK.md, the file the next agent reads
claude mcp add ai-ria -- npx -y ai-ria mcp # or use it as an MCP server in Claude Code
GitHub: https://github.com/maribostashvili-93/ai-ria (MIT, Node ≥ 20)

It's early. I'd like to know where it breaks on your repo, and what you use today to give agents context between sessions.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.