Language Agnostic · Model Agnostic · Compiles Locally · BYOK · MCP Compatible
https://github.com/user-attachments/assets/626ee911-1dbe-4970-bb25-ec2e3fc31d7b
### What is Benzi
Most AI coding agents grep and glob raw source code into AI model's context window and hope the model finds what matters. Benzi parses every file first — a real compiler, built on tree-sitter — into a precise, queryable map. Every symbol, every call edge, every reference, every class in its inheritance chain. One pass, done.
Every file parsed, imports resolved, class ancestry built, every identifier traced to its definition — before a single question is answered. Call flow and data flow join at every call site, so a bad value traces to its origin in one tool call. Claude Code greps; Cursor embeds; Aider maps signatures; Benzi resolves — in O(1). Ten languages so far, plus a markup engine for HTML, CSS, and DOM-JS — see [Language support](#language-support). Benzi is free to use during beta.
You can try pasting this repo's link to Benzi in the [live demo](https://varianttech.net/demo) too!
Benzi on SQLite
Like where this is headed? A ⭐ goes a long way.
### Live demos
**[StallionSwipe](BENZI_GREENFIELDING_EXAMPLES/horse_tinder/) · Python, HTML, CSS, JS** — a dating app for horses, greenfielded by Benzi from scratch in a single chat session. No image is a file: every horse portrait is procedural SVG, generated in code. Match with one and it flirts back through a real model, live. Frontend, backend, and the prompts — all written by Benzi. [Try it live](https://varianttech.net/horse_tinder).
### Language support
**Python · JavaScript · TypeScript · Java · C# · C++ · C · Go · Rust · Ruby**
One compiler, ten languages — each is a tree-sitter grammar plugin, so the core of the map (symbols, call edges, references, inheritance, data flow) is built the same way everywhere.
**Depth is uneven.** Python is deepest, and the only one with the runtime tracer. Every language reaches the core of the map, but each has its own constructs, not all modelled yet. For most code, every other language's map comes close to Python's.
Incremental reindexing is also less optimized for C, C++, Rust, and Ruby — it works, just not as fast on a large edit loop.
Wrong or thin answer in your language? [Open an issue](https://github.com/oooscoos/Benzi/issues) with the repo, the question, and what it got wrong — that's how the uneven parts get found.
### Getting started
Benzi is completely free to use during beta. There are two ways to use it, and they share one login: the same `benzi-login` config works everywhere.
1. **The Benzi agent** — Benzi's own agent, running on the compiled index, in VS Code or from the terminal. These features are part of the agent itself, so they come with VS Code and headless and are **not available over MCP**:
- **Runtime tracer** — runs your code and records what actually happened: which target each ambiguous call really hit, with the real argument values.
- **Static-analysis-gated edits** — every write is syntax-checked and checked against a fresh index before the next step; an edit that breaks the code is rolled back instead of built on.
- **Blast radius before and after every edit** — who calls the symbol, who holds it, and what feeds its parameters, before the change and again once it lands.
- **Self-aware upgrade to pro** — when a task outgrows the model it's running on, the agent upgrades itself to a larger model, then drops back when the task is done. Set `BENZI_ESCALATE_MODEL=deepseek-pro` (or another model alias) to turn it on.
- **Persistent memory and rollback** — per-repo facts that survive restarts, and one-step undo of any edit.
Run it either way:
- **VS Code extension** — [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=varianttech.benzi)
1. Install **Benzi** from the VS Code Marketplace.
2. Click the **Benzi** icon in the left activity bar (circled below) to open the **Benzi: Settings** panel.
3. Pick your model and paste your API key: an Anthropic key, or a non-Anthropic one (DeepSeek, Groq, Kimi and others).
4. Enter your email and press **Send**, then type in the one-time code it emails you.
5. Press **Save model & keys**, then **Run Benzi**.
### SWE-bench Verified
The full SWE-bench Verified set — 500 real GitHub issues from twelve Python repositories — run end to end on **DeepSeek V4.1-Flash**, one attempt per instance, graded by the official `swebench.harness.run_evaluation` inside its own per-instance Docker images, with network access to GitHub and PyPI blocked inside every container. **413 of 500 resolved (82.6%) for $9.26 in total**, 1.85¢ per task, with 97.6% of input tokens served from cache.
### How it works
1. **Compile.** Tree-sitter parses every file, resolves imports, builds class ancestry, traces every identifier to its definition. Output is an index, not text.
2. **Query.** The agent reads and plans through structured tools over that index — `profile`, `get_callers`, `backflow`, `trace_path`, `skim_source`, ~30 more.
3. **Edit, gated.** Every write is checked against the real parser; a broken parse auto-reverts. Blast radius — the changed symbol, its callers, its holders, the relevant tests — is checked going in and again once the write lands.
4. **Verify by running it.** A focused repro runs under a runtime tracer alongside the tests blast-radius flagged. Real values, real dispatch: this proves the change and settles the map — ambiguous edges collapse onto whatever target actually fired.
5. **Reindex, incrementally.** Every turn re-parses only what changed on disk — your edits and the agent's, treated the same.
6. **Revert, from a snapshot.** Every write snapshots the index first, so undo reloads that snapshot instead of re-deriving it.
7. **Back to step 2.** The next question always answers against the code as it is now.
### Toolset
16 of Benzi's 35+ tools. Full tool list [here](https://varianttech.net/temp/benzi_tools_list.txt).
### Features
- **Six states, never a guess** — every call site and every file carries one: **resolved** (proven in-repo edge), **external** (into a library, with the import evidence), **candidate** (ambiguous — the bounded set of possible targets, kept in full), **unresolved** (seen but not settled, carrying *why*), **observed** (confirmed by an actual run), **unindexed** (never parsed, with the reason). One rule throughout: whatever static analysis can't settle is flagged as unsettled rather than guessed — and running the program is what settles it.
- **Runtime tracer** — hooks every call during execution and overlays the observations back onto the static map.
- **Reasoning you can click** — the same map that drives the tools drives a live call graph beside the chat; when the agent names a function, that node lights up.
- **Persistent memory** — durable per-repo facts survive restarts; conventions learned once aren't re-derived every session.
- **Dual-engine: code + markup** — a separate index for HTML/CSS/DOM-JS with cascade resolution and selector specificity, including frontend embedded inside Python strings.
- **Model-agnostic** — Anthropic, OpenAI, or any compatible API; the agent can escalate itself to a larger model mid-task when a problem outgrows the one running it.
### What the index actually changes
Same 24 bugs, one run each, four harness/model combinations. **Lines read** counts only what came back from file-read calls — grep and shell output are search, not reading, so this is the one figure that means the same thing in every harness.
More detail, per-bug breakdowns, and full methodology: [varianttech.net/benchmark](https://varianttech.net/benchmark).
### FAQ & comparisons
**Does my code leave my machine?**
No. In VS Code, the CLI, or MCP, the compiler and index run locally — nothing uploaded, no copy kept. Only the snippets the agent actually reads go to your model provider, same as any AI assistant, and less of them: **9,125** lines read vs Claude Code's 20,704 on the same 24 bugs. The browser demo differs — it fetches a *public* repo server-side, read-only, deletes it after your session.
**Is it actually free?**
Yes, Benzi doesn't charge. The CLI and MCP are BYOK, so you pay your own model provider. Early and in development — that's the trade, not a paywall.
**Can it run on a local model?**
In principle, yes: Benzi talks to models through standard APIs, so a local model (Ollama, LM Studio and the like) could plug in. It isn't supported yet, though. Today Benzi runs on hosted providers with your own key.
**Can I point it at a private repo?**
Not the web demo (public GitHub API only). Everywhere else, yes — the compiler runs locally on whatever path you give it.
**How large a repo can it handle?**
The browser demo caps at 2,000 files, 2 MB each.
**How is this different from Cursor, Copilot, or Claude Code?**
They search — grep or embeddings. Benzi resolves first: a real index of symbols, calls, inheritance, data flow, queried instead of guessed. Same 24 bugs, 2.3× less source read than Claude Code. Details: [what the index actually changes](#what-the-index-actually-changes).
**How is this different from an LSP-backed MCP server?**
An LSP answers at a cursor, in one open file: go-to-definition or find-references, one position and one hop at a time. Benzi compiles the whole repo up front into one index, so the questions are whole-codebase ones: transitive call trees, the path between two functions, and **data flow**, meaning where a bad value came from or where a return value lands. Every answer also carries a **confidence tier**: resolved, candidate, unresolved (with the reason), or observed. An LSP gives an answer or nothing. The **runtime tracer** then settles what static analysis can't by watching what actually fires. And the compiler itself is **language agnostic**: ten languages run through one pipeline into one index format. An LSP setup needs a separate server per language, each installed, configured and kept running.
**How is this different from CodeQL or Sourcegraph's SCIP indexers?**
They need a working build and index in batch: dependencies installed, the project compiling, a CI job measured in minutes. Benzi needs no build, works on half-finished code, and re-parses only what changed on every turn. That's what makes gated writes possible: each edit is checked against a fresh index before the next step, not after a rebuild. One pipeline covers all ten languages instead of one indexer per language. Where that costs precision, Benzi flags the call site as candidate or unresolved instead of guessing.
**How is this different from CodeGraph?**
Both index instead of search, but CodeGraph **retrieves** — ranked candidates from a queried database. Benzi **resolves** — settles what a name binds to before answering, and refuses rather than guesses when a call site is ambiguous. It also models code the way an engineer reads it — file → scopes → call flow → data/control flow — not a flat symbol graph.
On CodeGraph's own benchmark (their repos, their questions, their methodology), Gemini, ChatGPT, Claude and DeepSeek each reviewed the answers from a fresh account, and all four ranked Benzi's first. Full results: [varianttech.net/benchmark_codegraph](https://varianttech.net/benchmark_codegraph).
by
Variant Technologies · varianttech.net