TypeScript

Fix TypeScript bugs with Codna

Codna maps your TypeScript repository for zero tokens, fixes from evidence, and runs your test command until it passes.

The problem

Types tell you what is wrong. They do not tell you where it started.

A type error in one package often starts in another. Codna builds a dependency and blast-radius graph of the repository from its import patterns. No model call, zero tokens. Barrel files and re-exports are edges in that graph, so the agent follows them instead of guessing.

How Codna fixes it

How Codna fixes it

1

Map the TypeScript repository

Codna builds a dependency and blast-radius graph of the repository from its import patterns. No model call, zero tokens.

2

Fix from evidence

The agent receives an evidence bundle scoped to the issue: the suspect files, the call paths, the failing test. Codna prints the raw-to-bundle token size on every run. Every fix reports root cause, confidence, blast radius and regression risk, and passes a risk gate before it is applied or a pull request opens.

3

Verify with your test runner

Run codna fix --tests --apply and Codna runs your tests in a sandbox and re-fixes until they pass, up to the iteration limit you set. Set fix.test_command in codna.yaml, or pass --test-cmd, when your runner is not pytest. With --open-pr, or through the GitHub App, the pull request states the issue, the root cause, the symbols touched and a confidence score, and asks for review before merging. Codna never merges.

pip install codna
codna fix . --issue "ky: prefixUrl is dropped when baseUrl is set"
codna fix . --tests --apply --test-cmd "npx vitest run --reporter=junit --outputFile=$CODNA_JUNIT"

What you get

Built for TypeScript

Any runner

Vitest, Jest or node:test: pass --test-cmd or set fix.test_command. The command writes JUnit to $CODNA_JUNIT.

TypeScript-aware recall

On-device recall parses .ts and .tsx with tree-sitter. Zero cloud round-trips.

Monorepos

codna impact lists the tests a diff can affect across the workspace, offline and for zero tokens.

The proof

Fewer tokens. Faster. Verified.

Codna16K
Cursor81K
Average tokens per fix on 87 matched bug-fix cases: Codna and Cursor.

Frequently asked

Install with pip, then codna fix . --issue "..." or codna fix . --tests --apply with your test command. Every fix reports root cause, confidence, blast radius and regression risk, and passes a risk gate before it is applied or a pull request opens.

Yes. The map spans the repository, and codna impact narrows a diff to the tests it can affect.

Any runner that can write a JUnit report. Set fix.test_command in codna.yaml or pass --test-cmd.

Both. Run codna fix from the terminal, or give Cursor or Claude the five Codna tools over MCP and work interactively.

Imports are the edges of the map, including re-exports through barrel files. Dynamic imports and reflection are a lower bound.

Understanding runs on your machine and spends no tokens. Only the evidence bundle or the diff reaches your model provider, with your key from the OS keychain. Set privacy.egress to fail-closed in codna.yaml and Codna runs your tests only under kernel-level network denial. Secret redaction is always on.

Understand. Fix. Evolve.