Map deterministically, not by retrieval
Codna builds a dependency and blast-radius graph with a deterministic engine — no embeddings, no LLM, ~60ms per repo for zero tokens. It is a structural map, not a ranked search result.
Sourcegraph is built to find context across every repo you own. Codna is built to make the fix provably correct. One answers "where does this live?"; the other answers "is this patch actually right?"
The problem
Sourcegraph turned code search into infrastructure. Zoekt and trigram indexing, SCIP-precise go-to-definition, find-references across repositories, and embeddings for semantic recall let it locate context at organization scale. Cody draws on that code graph to answer questions over your whole remote codebase, and the Amp agent layers autonomous editing on top, calling subagents like the Oracle for deeper analysis. It is genuinely strong at the find problem. But finding the right context is not the same as proving a change is correct: retrieval ranks candidates, the model still reads and reasons over them per task, and whether the resulting edit holds up is left to review and CI after the fact.
How Codna fixes it
Codna builds a dependency and blast-radius graph with a deterministic engine — no embeddings, no LLM, ~60ms per repo for zero tokens. It is a structural map, not a ranked search result.
The agent receives a ~600-token bundle: the suspect files, the call paths into them, and the failing test — already scoped, so the model reasons over evidence instead of re-reading candidates.
Every patch must pass your own suite before it ships. A fix that fails tests never becomes a pull request — verification happens before review, not after.
codna fix . --issue "regression after the search-indexer refactor"
What you get
Codna builds a dependency and blast-radius graph with a deterministic engine — no embeddings, no RAG, ~60ms per repo for zero LLM tokens. It is a structural map of what a change touches, not a list of retrieval candidates the model still has to read and rank.
A patch must pass your own suite before it becomes a pull request. Verification happens before review instead of after, so a fix that fails tests never reaches a teammate.
Codna hands the agent a ~600-token evidence bundle — 162x less context than reading the repo — so a verified fix costs pennies. The understanding step itself spends zero tokens.
The proof
No — they solve different halves of the problem. Sourcegraph is built to find context across every repo you own; Codna makes the resulting fix provably correct with a deterministic map and a test gate. Many teams run both, keeping Sourcegraph for org-scale search and adding Codna for verified fixes.
Sourcegraph is a code-intelligence platform: a search index, a code graph, and an agent that reads and reasons over ranked candidates per task. Codna's repository map is deterministic — a dependency and blast-radius graph built in ~60ms for zero LLM tokens, with no embeddings or RAG. One answers where code lives; the other scopes a fix to a ~600-token bundle and proves it against your tests.
Yes. Codna ships as a CLI, an MCP server for Cursor and Claude, and a native GitHub App, so it can supply scoped evidence bundles and the test gate to whatever agent your team already uses. It complements an existing Sourcegraph workflow rather than displacing it.
Codna is model-agnostic and bring-your-own-key, so you point it at the model you already prefer. The deterministic map is built from source structure, not a trained index, so it spans many languages — 130 repos across 110 languages mapped in 9.2s in our measured run, at 100% ecosystem accuracy.
Codna can self-host with fail-closed egress, runs on your own key, and never trains on your code. The deterministic map and the test-gated fix loop can run entirely inside your own perimeter, so nothing leaves unless you choose to send it.
About $0.04 per verified fix, measured at public model rates. Because the deterministic map costs zero LLM tokens and the agent works from a ~600-token evidence bundle instead of reading the whole repo, a fix runs roughly 28x cheaper than a typical agentic edit that loads ~200K tokens of context.
Related