Use case

Fix bugs in legacy code with Codna

No docs, few tests, and nobody remembers why. Codna maps the code for zero tokens, shows what a change reaches, and fixes with root cause and risk attached.

The problem

In legacy code the risk is what you cannot see.

Codna builds a dependency and blast-radius graph of the repository from its import patterns. No model call, zero tokens. Blast radius is computed from the graph, so a fix in a forgotten module reports the callers it reaches, and the agent works from that evidence rather than from a partial read.

How Codna fixes it

How Codna fixes it

1

Map before you touch anything

codna triage prints the suspect files and the raw-to-bundle context size. Zero tokens, nothing changed.

2

Fix with the callers in view

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

Gate, then review

A risk gate runs before anything is applied. 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.

codna triage . --issue "null pointer in legacy invoice export, no docs"
codna fix . --issue "null pointer in legacy invoice export, no docs" --apply

What you get

What you get

Read-only first

codna triage understands the repository and changes nothing.

Blast radius on every fix

Codna reports what the change reaches before you apply it.

Recall across sessions

Telys recall runs on-device and persists, so the second question about the same module is faster.

The proof

Fewer tokens. Faster. Verified.

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

Frequently asked

Codna starts with the map, not the docs. Codna builds a dependency and blast-radius graph of the repository from its import patterns. No model call, zero tokens. 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.

Codna scopes the fix to the issue and reports blast radius and regression risk. It does not rewrite what it does not need to.

codna triage prints suspect files for an issue for zero tokens. codna_recall, over MCP, recalls code from the on-device index.

The risk gate and the blast-radius report still run. Add a failing test for the bug and use --tests --apply to verify the fix against it.

The blast radius names the callers a change reaches, including distant ones. Review it before you merge.

pip install codna, then codna triage . followed by codna fix . --issue "...". Python 3.10 or newer, macOS or Linux, git.

Understand. Fix. Evolve.