工作原理

先理解。外科式修复。

Codna 将代码库理解与模型推理分离。确定性层映射代码库。智能体凭借聚焦证据采取行动。

工作原理

1

解析代码库。

Codna 跨 110 种语言扫描文件、符号、导入、测试和依赖边。此过程无需 LLM,零 token 消耗,不向模型泄露代码。

codna triage . --json
2

构建影响范围图。

依赖图识别函数、文件、包或 API 变更时可能引发的破坏,让 Codna 在智能体启动前缩小搜索范围。

3

打包证据包。

Codna 向智能体提供它所需的精确文件、失败测试、调用路径和历史上下文——而非庞大的上下文转储。

4

生成并验证修复。

智能体编写补丁,Codna 模拟风险,测试进行验证。使用 GitHub App 时,结果将自动生成 Pull Request。

codna fix . --issue "checkout race condition" --pr

Under the hood

What Codna hands the agent.

架构

模型无关的设计。

使用你自己的密钥、模型提供商,或托管 LLM 选项。确定性地图始终保持一致。

使用你的密钥

你的模型密钥。你的限额。你的审计追踪。

MCP 服务器

为 Cursor 和 Claude 提供本地代码库理解工具。

CLI 优先

在任意代码库、CI 任务或容器中运行 Codna。

GitHub App

将问题和失败检查转化为修复 PR。

Frequently asked

A deterministic engine builds a dependency and blast-radius graph of your repository in roughly 60ms, using zero LLM tokens. That graph captures which code affects which — no AI guesswork involved in the analysis step.

An evidence bundle is the minimal slice of context Codna assembles before calling the AI agent — about 600 tokens, measured at 162x less than reading the whole repo. The agent sees only what is relevant to the bug, so fixes are faster and cheaper.

Every fix is verified by your own tests before it is surfaced. If the tests do not pass, the fix is not delivered.

Benchmarked head-to-head against Cursor across 87 tasks, Codna used 5× fewer tokens and ran 1.7× faster — roughly $0.02 per verified fix.

No — Codna supports 250+ languages. It mapped 130 repositories in 9.2 seconds for zero tokens, and the deterministic engine is language-agnostic by design.

Codna ships as a CLI, an MCP server for Cursor and Claude, and a native GitHub App that opens verified fix pull requests. You can self-host, bring your own API key, and egress is fail-closed — your code is never used for training.