Metadata-Version: 2.4
Name: benzi
Version: 0.1.0
Summary: Benzi -- a code-intelligence agent (headless CLI)
Author: Variant Technologies
License: Copyright © 2026 Variant. All rights reserved.
        
        This software, including its source code, assets, and documentation (the
        "Software"), is the proprietary and confidential property of Variant. The
        Software is licensed, not sold.
        
        Subject to your continued compliance with these terms, Variant grants you a
        personal, non-exclusive, non-transferable, non-sublicensable, and revocable
        license to install and use the Software for your own software-development
        purposes.
        
        You may NOT, in whole or in part:
        
          * copy, modify, adapt, translate, or create derivative works of the Software;
          * distribute, publish, sublicense, sell, rent, lease, or otherwise transfer
            the Software or make it available to any third party;
          * reverse engineer, decompile, or disassemble the Software, except to the
            limited extent that applicable law expressly permits despite this
            limitation;
          * remove, obscure, or alter any copyright, trademark, or other proprietary
            notice; or
          * use the Software, or any part of it, to build, train, or operate a product
            or service that competes with the Software or with Variant.
        
        All rights not expressly granted to you are reserved by Variant. This license
        does not grant you any rights to Variant's trademarks, logos, or brand.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL
        VARIANT BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN
        ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION
        WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        
        Variant may modify or revoke this license at any time. Continued use of the
        Software constitutes acceptance of the then-current terms.
        
Project-URL: Homepage, https://varianttech.net
Project-URL: Repository, https://github.com/oooscoos/Benzi
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: Microsoft :: Windows
Requires-Python: <3.14,>=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: anthropic==0.116.0
Requires-Dist: openai==2.45.0
Requires-Dist: markdown==3.10.2
Requires-Dist: pyflakes==3.4.0
Requires-Dist: python-toon==0.1.3
Requires-Dist: tree-sitter-language-pack==1.12.5
Requires-Dist: rich>=13
Dynamic: license-file

<p align="center">
  <img src="https://raw.githubusercontent.com/oooscoos/Benzi/main/icon.png" width="120" alt="Benzi">
</p>

<h1 align="center">Benzi<br><sub>by <img src="https://raw.githubusercontent.com/oooscoos/Benzi/main/assets/variant_logo.png" width="16" alt=""> <b>Variant Technologies</b></sub></h1>

<p align="center"><b>An AI coding agent that doesn't read — it <i>queries</i>.</b></p>

<p align="center">Benzi is free to use — actively in development, a work in progress.</p>

<p align="center">
  <a href="https://github.com/oooscoos/Benzi">Full README, benchmarks, and demos on GitHub</a>
</p>

---

## What is Benzi

Most AI coding agents dump a repository into a context window and hope the model finds what matters. Benzi works differently: before answering anything, a real compiler — built on tree-sitter — parses every file in the project and resolves it into a precise, queryable map. Every symbol, every call edge, every reference, every class in its inheritance chain. One pass, done.

Call flow and data flow are joined 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 — and answers in O(1). Ten languages so far, plus a second engine for markup (HTML, CSS, DOM-JS).

## What people say

> "78.2% for $37 is a slap in the face to the 'brute force wins' school."
> — Alex Xiang, [**zicode**](https://zicode.com/blog/ai-coding-supply-chain/) *(translated)*

> "Benzi is proving that the core competency of coding tools is shifting from simple 'reading comprehension' to 'structural grasping ability.'"
> — Gi Pyeong Lee, [**Tech Blog**](https://gipyeong-lee.github.io/2026/09/11/Show-HN-Benzi-A-Code-IntillegenceHarness-Beating-Claude-Code-and-CodeGraph.en/)

> "Fewer tokens, no context drift. Wild idea, honestly."
> — [**prompt 🤖 AI News**](https://t.me/prompt/392)

> "It analyzes changes before writing them — and beats Claude Code on benchmarks."
> — [**Ponte al dIA**](https://ponte-al-dia.com/p/benzi-agente-de-codigo-que-supera-a-claude-sonnet-en-tareas-de-programacion) *(translated)*

## SWE-bench Verified

The full SWE-bench Verified set — 500 real GitHub issues from twelve Python repositories — run end to end on **DeepSeek v4-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.

| | |
|---|---|
| **Resolved** | **391 / 500 — 78.2%** |
| Total cost, all 500 instances | $37.33 |
| Cost per instance resolved | $0.095 |
| Source lines read (total / median) | 231,574 / 379 |
| Model turns (total / median) | 16,091 / 27 |

Full technical report and per-instance breakdowns: [GitHub](https://github.com/oooscoos/Benzi#swe-bench-verified).

## How it works

1. **Compile.** Tree-sitter parses every file; imports are resolved, class ancestry built, every identifier traced to its definition. The output is an index, not a blob of text.
2. **Query.** The agent answers questions and plans edits through structured tools over that index — `profile`, `get_callers`, `backflow`, `trace_path`, `skim_source`, and ~30 more.
3. **Edit, gated.** Every write passes syntax and semantic gates against the real language parser — a broken parse auto-reverts, checking blast radius before a change lands, not just after.
4. **Verify by running it.** A focused repro runs under a runtime tracer — real argument values, real returns, real dispatch — which both proves the change and settles the map.
5. **Reindex, incrementally.** The map follows the filesystem, never the agent's account of what it did — each turn re-parses only the files whose bytes actually moved.

## Tools

A sample of Benzi's 35+ tools — the full list is on GitHub:

| Tool | What it answers |
|---|---|
| `get_callers` | Every call site that reaches a function — the code that will feel a change. |
| `call_tree` | The transitive call closure from one function, forward or in reverse. |
| `trace_path` | The call chain connecting two functions, and the data carried along it. |
| `backflow` / `forwardflow` | Where a wrong value came from / where a return value ends up. |
| `profile` | The full 360 on one symbol in a single call. |
| `search_symbols` | Case-insensitive substring search across every symbol in the repo. |
| `get_hierarchy` | A type's resolved bases and its direct subclasses. |
| `skim_source` | A body's one-level outline, so you know which lines are worth reading. |
| `execute_from` / `execute_generated_testcase` | Runs code under the call tracer; writes and runs a self-contained repro. |

Full list of 35+: [GitHub](https://github.com/oooscoos/Benzi#tools).

## Features

- **Six states, never a guess** — every call site and file carries one: resolved, external, candidate, unresolved, observed, or unindexed. Whatever static analysis can't settle is flagged as unsettled, not guessed.
- **Runtime tracer** — hooks every call during execution and overlays the observations back onto the static map.
- **Persistent memory** — durable per-repo facts survive restarts.
- **Dual-engine: code + markup** — a separate index for HTML/CSS/DOM-JS.
- **Model-agnostic** — Anthropic, OpenAI, or any compatible API.

## Language support

**Python · JavaScript · TypeScript · Java · C# · C++ · C · Go · Rust · Ruby**

One compiler, ten languages. Python is deepest — it's the only one with the runtime tracer. Depth varies elsewhere; see [Language support on GitHub](https://github.com/oooscoos/Benzi#language-support) for specifics.

## Install

```bash
pip install benzi

# one-time setup -- verify your email, then bring your own API key
benzi-login --login you@example.com
benzi-login --anthropic-key sk-ant-...       # or --nonanthropic-key for
                                              # groq/deepseek/kimi/etc

# then, from inside (or pointed at) any repo:
benzi . "what does this repo do?"
```

This also installs `benzi-mcp` — the same compiled index exposed as tools over MCP, for whatever agent you already run (Claude Code, Cursor, your own harness). Point your MCP client at it after the same `benzi-login` step; output quality then depends on that harness, since this mode has no agentic loop of its own.

`.` means "the repo I'm standing in" — pass a path instead if you're running it from somewhere else. Your key stays on your own machine and talks to your model provider directly; Benzi's servers never see it or proxy the call. Run `benzi-login` with no flags any time to see what's currently saved, or `benzi --help` for every option.

Benzi is also available as a [live web demo](https://benzi.fly.dev) (no install, no key needed) and a [VS Code extension](https://marketplace.visualstudio.com/items?itemName=varianttech.benzi).

## FAQ

**Do I need an API key?**
For the CLI, MCP, and the VS Code extension, yes — bring your own Anthropic or OpenAI-compatible key. Only the browser demo runs without one.

**How is this different from Cursor, Copilot, or Claude Code?**
They find code by searching text — grep, or embedding similarity. Benzi resolves it first: a tree-sitter compiler builds a real index of symbols, call edges, inheritance and data flow, and the agent queries that index instead of guessing which files to read.

Full FAQ (privacy, pricing, CodeGraph comparison, repo size limits): [GitHub](https://github.com/oooscoos/Benzi#faq).

---

<p align="center"><sub><a href="https://github.com/oooscoos/Benzi">Full README on GitHub</a> — benchmarks, demos, and more.</sub></p>
