Map the package deterministically
Codna resolves modules, imports, fixtures, decorators, and blast radius into a dependency graph in about 60ms — for zero LLM tokens, no embeddings, no RAG.
Dynamic imports, decorators, and duck typing make Python quick to write and hard for an agent to trace. Codna is an AI Python pair programmer that builds the dependency graph deterministically first, so the fix starts from facts about your code, not guesses from a token budget.
The problem
A single failing pytest can originate three modules away — through a fixture, a monkeypatch, a late import inside a function, or a decorator that quietly rewrites behavior at import time. Python's dynamic nature means the call you need to trace often isn't visible until runtime, so static reading goes only so far. Most AI coding agents respond by pulling large slices of the package into the model and reasoning over them, which is slow, lossy, and expensive on a real Django or FastAPI codebase. Engineers lose hours bisecting failures, re-reading import chains, and re-running the suite to confirm a fix that may have only moved the symptom. AI Python debugging works better when the agent knows the real call paths before it writes a line.
How Codna fixes it
Codna resolves modules, imports, fixtures, decorators, and blast radius into a dependency graph in about 60ms — for zero LLM tokens, no embeddings, no RAG.
The agent receives only the failing test, the resolved call chain, and the suspect functions — a measured 162x less context than reading the whole package into the model.
Codna re-runs your pytest or unittest suite and ships the patch only when it passes, so the failing test is the oracle that gates every fix.
pip install codna codna fix . --issue "test_split_arg_string fails on trailing backslash"
What you get
A deterministic dependency and blast-radius graph of your Python package, built in ~60ms for zero LLM tokens — no embeddings or RAG to maintain.
The agent fixes from the failing test, the call chain, and the suspect functions — a measured 162x less context than feeding it the whole package.
Every patch must pass your existing pytest or unittest suite before it lands, and a verified fix costs about $0.04.
The proof
It maps your package deterministically first — imports, fixtures, decorators, and blast radius — in about 60ms for zero LLM tokens. The agent then fixes from a ~600-token evidence bundle drawn from that graph, instead of pulling the whole package through the model.
Yes. The deterministic graph follows your imports, routes, and dependency injection regardless of framework, so the agent is pointed straight at the suspect file rather than guessing across the project.
Yes. Codna verifies every fix against your existing test runner — the failing test is the oracle, and a patch that does not pass never ships.
About $0.04 per verified fix, because Codna fixes from a ~600-token bundle rather than reading ~100k tokens of repo through a frontier model on every task.
Use it however you already work: the CLI (pip install codna), the MCP server inside Cursor or Claude, or the native GitHub App that opens a verified pull request.
Yes. Codna supports self-hosting with bring-your-own-key, fail-closed egress, and no training on your code, so nothing leaves your environment.
Related