C++

Fix C++ bugs with Codna

Codna maps your C++ project for zero tokens, fixes from evidence, and runs your test suite until it passes.

The problem

A wrong result in a matrix test is an off-by-one in a header.

Codna builds a dependency and blast-radius graph of the repository from its import patterns. No model call, zero tokens. #include directives are the edges, so the agent follows the call chain from the failing test into the header-only code that computes the result.

How Codna fixes it

How Codna fixes it

1

Map the C++ 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 CTest or GoogleTest

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 "Matrix::operator* gives wrong result for non-square inputs" --tests --apply --test-cmd "ctest --test-dir build --output-junit $CODNA_JUNIT"

What you get

Built for C++

CTest and GoogleTest

ctest --output-junit writes the report Codna reads. Set fix.test_command or pass --test-cmd.

C and C++ recall

On-device recall parses .c, .h, .cc, .cpp, .cxx, .hpp and .hh with tree-sitter.

Header-only code

Includes are edges, so templates and header-only libraries are in the map.

The proof

Fewer tokens. Faster. Verified.

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

Frequently asked

Yes. The map follows includes across the tree, and your CTest command is the oracle.

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. 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.

Includes are edges in the map, so header-only code is part of the graph. The compiler and your tests verify the rest.

Yes. pip install codna on macOS or Linux. Understanding is offline and spends no tokens.

On 87 matched bug-fix cases against Cursor, Codna averaged 16,159 total tokens and about $0.02 of model spend per verified fix, 5× fewer tokens and 1.7× faster. With your own key you pay your provider directly.

The repository map is deterministic and built from import and include patterns without a model. On-device recall is a separate, local index.

Understand. Fix. Evolve.