Map the module graph deterministically
Codna resolves imports, re-exports, path aliases, and generic call paths into a dependency and blast-radius graph in about 60ms — for zero LLM tokens, no embeddings or RAG.
Barrel files, path aliases, and deep generic inference scatter a single bug across a TypeScript project. Codna resolves the real module and type graph deterministically, so this AI TypeScript debugging starts from facts and hands the agent exactly the files that matter.
The problem
A failing Vitest spec or a `tsc` type error rarely lives where it surfaces. It traces back through re-exports in index.ts barrels, a path alias pointed at the wrong build, or a generic constraint inferred three modules away. Engineers lose hours reading files by hand and pasting fragments into a chat window, while most AI tools blindly stuff the whole repo into context and still guess at the cause. To fix TypeScript bugs reliably you have to follow the actual module and type graph first — not the file that happened to throw.
How Codna fixes it
Codna resolves imports, re-exports, path aliases, and generic call paths into a dependency and blast-radius graph in about 60ms — for zero LLM tokens, no embeddings or RAG.
The agent receives the failing spec, the resolved call chain, and the suspect modules — about 162x less context than reading the whole project, so it fixes the cause instead of a symptom.
Codna re-runs your test runner (Vitest, Jest, or node:test) and only proposes the patch once it passes — every fix is verified, at roughly $0.04 each.
npm install -g codna codna fix . --issue "ky: prefixUrl is dropped when baseUrl is set"
What you get
Codna parses your TypeScript module graph — barrels, aliases, types, and blast radius — with a deterministic engine in ~60ms and zero LLM tokens. No embeddings, no RAG, no guesswork.
Instead of feeding 100,000+ tokens of source into a model, this AI coding agent works from a focused ~600-token bundle — 162x less context — so it stays on the real cause.
A patch only ships after it passes your existing Vitest, Jest, or node:test suite. Verified TypeScript bug fixes land for about $0.04 each.
The proof
Run `codna fix .` with a short description of the failure. Codna maps your module and type graph deterministically, hands the agent a ~600-token evidence bundle, applies a patch, and verifies it against your test runner before proposing it.
Yes. Codna maps cross-package dependencies, so a fix in one workspace package accounts for its blast radius across the whole repo — pnpm, npm, and yarn workspaces included.
All supported. Your existing runner is the oracle: the failing spec defines the bug, and Codna only ships the fix once your suite passes.
Both. Use it as an AI TypeScript pair programmer in your editor through the MCP server for Cursor and Claude, from the CLI, or as a native GitHub App that opens verified fix PRs.
Yes. The deterministic engine resolves tsconfig path aliases, follows index.ts re-exports, and traces generic call paths, so the agent sees the true dependency chain rather than the file that happened to throw.
Yes. Codna supports self-hosting with bring-your-own-key, fail-closed egress, and no training on your code — so your TypeScript stays on your infrastructure.
Related