TypeScript

Fix TypeScript bugs with Codna

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

Why TypeScript bugs are hard to fix

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

How Codna fixes TypeScript bugs

1

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.

2

Hand over a ~600-token evidence bundle

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.

3

Verify with your own tests

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

What you get on TypeScript

Zero-token deterministic map

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.

~600-token evidence bundle

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.

Every fix verified by your tests

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

Fewer tokens. Faster. Verified.

Codna16K
Cline65K
Cursor81K
Total tokens to fix 8 verified bug-fix scenarios — measured head-to-head vs the Codex and Gemini CLIs.

Frequently asked

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.

Understand. Fix. Evolve.