This page is written the way the rest of this site is: if a competitor is better at something, it says so. ctx-optimize is a fresh entrant in a lane that already has two 40K-star leaders. We think our design choices are right — but you should see the whole board, including where we lose, before you decide.
A year ago "give your agent codebase context" meant embeddings and a vector DB. It doesn't anymore. The tools that broke out — CodeGraph (~47K stars, MIT) and GitNexus (~42K stars) — both pre-compute a structural graph on-device and expose it to agents over the Model Context Protocol (MCP): no cloud, no embeddings API, no code leaving the machine. graphify popularized the central-store idea; potpie took the funded, Neo4j-backed platform route; Serena skips the graph entirely and wraps live language servers. We share the local-first, deterministic half of that consensus — and we make one deliberately contrarian choice, spelled out below.
proof/compare/) — when it lands, the measured rows replace the claimed ones, wins and losses alike.
| ctx-optimize | CodeGraph | GitNexus | graphify | potpie | Serena | |
|---|---|---|---|---|---|---|
| Adoption (approx) | new | ~47K★ | ~42K★ | ~82K★ | funded | established |
| Runtime | one static Go binary | SQLite | embedded DB | Python | Neo4j service | language servers |
| Setup deps | zero | zero (1 file) | zero | model key | DB + infra | LSP per lang |
| Distribution | agent skill + hook | MCP (42 tools) | MCP (16 tools) | skill | API | MCP |
| Agent reach | CC / Codex / Copilot / Devin | 8 hosts via MCP | MCP hosts | skill | API | MCP hosts |
| Determinism | no model, ever | structural | structural | model-assisted | LLM in loop | LSP-exact |
| Extraction engine | tree-sitter AST | AST | AST | AST | AST | language server |
| Call-edge precision | AST + conservative name-resolve | AST name-resolve | AST name-resolve | AST name-resolve | AST name-resolve | LSP type-exact |
| Freshness / staleness gate | git-HEAD gate | auto-sync | sync | static dump | re-index | live |
| Routes / deps / k8s as graph | yes (v0.3) | routes+bridges | partial | no | no | no |
| Extensible without forking | packs (4 axes) | config | config | plugins | no | no |
| Module = scattered folders (src/ + tests/) | yes (v0.3.5) | one graph | one graph | one graph | — | — |
| Team clone → prebuilt graph in one step | init auto-pulls | rebuild | rebuild | rebuild | re-index | re-warm |
| License | MIT | MIT | noncommercial | open | open-core | MIT |
green = a genuine strength, amber = partial / caveated, red = a real weakness. Notice ours has red in it. The most important red is MCP — see "our bet."
You don't need a benchmark to count dependencies. This is the win we hold against the whole field, not just one tool — the deterministic single binary carries none of the runtime cost a graph-DB, a model, or a language-server does:
| ctx-optimize | CodeGraph | GitNexus | graphify | potpie | Serena | |
|---|---|---|---|---|---|---|
| Services to run | 0 | SQLite (embedded) | embedded DB | Python runtime | Neo4j | LSP / language |
| Model / API key | none | none | none | for labeling | LLM in loop | none |
| Install | 1 static binary | binary + index | binary | pip + deps | containers | server + LSPs |
| Works fully offline | yes | yes | yes | not for labeling | no | yes |
| Cold start → first answer | seconds | seconds | seconds | index + model | DB bring-up | LSP warmup |
The cross-tool harness (proof/compare/) that runs CodeGraph, GitNexus, potpie and Serena on the same repos is still being built — so for a real, apples-to-apples number today we only claim graphify, on the deterministic core both tools share (M5 Pro, cold shell, raw data):
| operation | corpus | ctx-optimize vs graphify | note |
|---|---|---|---|
| Cold gather | graphify source, 12,484 files | 13.3× faster | store 8.3 MB vs 30.1 MB — 3.6× smaller; nodes within 1% |
| Cold gather | gin, 159 files | 2.2× faster | graphify finds slightly more nodes here — shown as-is |
| Query latency | 12k-file corpus, median of 5 | ~4× faster | 3.8–4.1× across three questions, 2,000-token budget |
Honest caveats, same as on the benchmarks page: graphify was timed on its fastest deterministic path (no clustering, no LLM); on gin and its own source it finds a few more nodes than we do, shown as-is; and it does things we deliberately don't (LLM community labeling). This is the shared core, not a claim we win at everything.
| ours (measured) | result | theirs (their claim) |
|---|---|---|
| Cold gather, 12,484 files | 0.67 s | CodeGraph: 58% fewer tool calls, 22% faster |
| Query, 1.49M-node Chromium store | < 1 s | GitNexus / graphify: large token savings |
| Federated query, 188K-node monorepo | ≈ 0.6 s | (measured their way, not ours) |
When the full harness lands, every rival gets a measured row here — including the ones where we lose. Until then we won't fake a head-to-head we haven't run. Raw data behind ours: proof/agent · bench/results.json.
fresh, determinism, and mirrored per-module stores against. We adopted its best idea (community subsystems) without the staleness.Strip away the scoreboard and the difference is philosophical. Everyone else is a store format + a server (SQLite, LadybugDB, Neo4j) or a live service (LSP). We're a single static Go binary — no database process, no embeddings, no model, no network except a remote you configure — whose artifacts are plain, sorted, git-diffable files. What that buys:
npm i -g or one binary, works offline, nothing to stand up — not even a local DB daemon.EXTRACTED (parsed) or INFERRED (name-matched); fresh gates answers against git HEAD so the agent never trusts a stale graph.install --skills.