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 | one verb: up | 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 |
Four public corpora, pinned SHAs, same machine (M5 Pro), every tool on its fastest deterministic path — no embeddings, no LLM, no clustering. ctx-optimize cells re-measured on the incremental-sync build (011f50d); versions: CodeGraph 1.5.0 · GitNexus 1.6.9 · graphify 0.9.12 · ast-grep 0.45.0. Raw data: results-multi.json. Note: “graphify src” below is a 754-file bounded corpus from this run — a different, smaller corpus than the 12,484-file full-tree run quoted above and on the front page; don’t mix the two.
| Cold gather (s) | ctx-optimize | CodeGraph | GitNexus | graphify |
|---|---|---|---|---|
| flask (265 files) | 0.65 | 0.46 | 6.5 | 0.86 |
| gin (159) | 0.37 | 0.62 | 7.9 | 0.78 |
| ctx-optimize src (207) | 0.37 | 0.80 | 13.4 | 1.33 |
| graphify src (754) | 0.81 | 1.90 | 18.5 | 5.43 |
| Warm re-sync, 0 changes (s) | ctx-optimize | CodeGraph | GitNexus | graphify |
|---|---|---|---|---|
| flask | 0.040 | 0.143 | 5.3 | 0.77 |
| gin | 0.039 | 0.147 | 5.3 | 0.75 |
| ctx-optimize src | 0.028 | 0.131 | 9.2 † | 1.34 |
| graphify src | 0.030 | 0.200 | 27.9 † | 8.61 |
| Query, median of 5 (ms) | ctx-optimize | ast-grep ‡ | CodeGraph | GitNexus | graphify |
|---|---|---|---|---|---|
| flask | 12 | 22 | 416 | 3778 | 307 |
| gin | 12 | 52 | 368 | 3457 | 345 |
| ctx-optimize src | 13 | 49 | 464 | 3124 | 341 |
| graphify src | 30 | 77 | 182 | 1912 | 1091 |
| Store on disk | ctx-optimize | CodeGraph | GitNexus | graphify |
|---|---|---|---|---|
| flask | 1.4 MB | 5.0 MB | 60 MB | 3.2 MB |
| gin | 1.4 MB | 7.7 MB | 73 MB | 4.7 MB |
| ctx-optimize src | 1.6 MB | 11.4 MB | 137 MB | 6.4 MB |
| graphify src | 9.0 MB | 25.1 MB | 192 MB | 25.6 MB |
Where we lose, shown as-is: CodeGraph wins cold gather on flask (0.46 s vs our 0.65 s). Honest footnotes: ctx-optimize’s cold gather includes the full markdown wiki; its warm number is the tree-signature short-circuit that shipped in this build — earlier releases re-extracted fully and were slower warm than CodeGraph, which is why this row was our loss until 011f50d. † GitNexus’s warm cells on those two corpora were a forced full rebuild (schema-version bump mid-run), not a true incremental re-sync — read them as worst-case, not typical. ‡ ast-grep is grep-style structural search with no index — no gather/store rows apply; its two Python query cells were re-run with a corrected pattern after the original matched zero results (our authoring error, not the tool’s). Each tool builds a different graph (node counts differ up to ~1.6×); disk and query numbers compare each tool’s own artifact, not identical outputs.
| 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) |
potpie and Serena still have no measured row — different architectures (Neo4j + LLM-in-loop; LSP server) that need their own harness, and we won't fake a head-to-head we haven't run. Raw data behind ours: proof/agent · bench/results.json · bench/results-multi.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 what you invoke yourself (a self-update, a one-time toolchain fetch, your own remote scripts) — 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.