Gortex vs Graphify: Code Exploration Token BenchmarkRead Guide: Gortex vs Graphify: Code Exploration Token Benchmark
hafuture Home

Gortex vs Graphify: Code Exploration Token Benchmark

Benchmark of Gortex v0.64.12 vs Graphify v0.9.124 on a 726-file Next.js repo: 74.4%–97.9% token cuts, CLI latency, disk/RAM footprints, and setup fixes.

Hafuture Engineering Team
GortexGraphifyToken OptimizationMCPAI Coding AgentsCode Knowledge GraphBenchmarkClaude Code
Gortex v0.64.12 vs Graphify v0.9.124 code exploration token benchmark cover

Most token spend in AI coding sessions does not come from writing code—it comes from code archaeology (running grep and reading five to ten whole files just to trace one call chain). Two open-source local code-graph engines tackle this problem from very different angles: Gortex (zzet/gortex), a persistent Go daemon with Tree-sitter + SQLite FTS5, and Graphify (Graphify-Labs/graphify), a Python AST knowledge-graph generator with deterministic JSON/HTML/Markdown artifacts.

Unlike prompt/output compression covered in our Caveman & Ponytail token-saver guide or MCP schema trimming in our Claude Code Code Mode & Background MCP guide, Gortex and Graphify reduce tokens at the repository read layer. We installed both tools locally and benchmarked them head-to-head on a clean copy of our 726-file production Next.js repository (hafuture-app).

Quick Verdict

DimensionGortex (v0.64.12)Graphify (v0.9.124, --code-only)
Architecture & Footprint313 MB static Go binary + persistent Unix-socket daemon (126.2 MiB RAM) + 96 MB SQLite FTS5 store193 MB Python 3.14 venv (59 packages) + 4.6 MB static graphify-out/, 0 MB idle RAM
4-Task Total Tokens & Latency11,246 tokens (-74.4%, 3.9×) · 125.1 ms median (GCX1 payload includes full symbol source code)query: 9,083 tokens (-79.3%, 4.8×) · 269.7 ms / explain & affected: 906 tokens (-97.9%, 48.4×) · 256.1 ms (graph edges & line anchors only)
Best FitDaily multi-repo IDE/MCP work where returning runnable symbol source + blast callers in one round-trip avoids follow-up file readsLow-footprint, zero-daemon repos, CI pipelines, pinpoint caller lookups (affected), and mixed code + Markdown/PDF knowledge graphs

The headline trade-off is what you get per call. Gortex's explore -f gcx ships the actual function source slices and blast-radius callers in a single 125 ms round-trip so the agent can edit immediately. Graphify's explain and affected return ultra-compact 118–376 token relationship maps with exact file:line anchors, letting the agent read only the exact 30-line window it needs.


Test Methodology & Environment

To prevent cross-contamination (such as Gortex indexing Graphify's graphify-out/ artifacts), we created two isolated git clones of /home/hafuture/Projects/hafuture-app at commit 9f4ab12 (726 tracked files: 201 files in src/, 161 Markdown/MDX files in content/, 26 MB working tree) and ran Gortex inside an isolated XDG_* runtime directory.

  • Host Environment: Linux 7.2.15-4-omarchy (x86_64), 16 vCPUs, 30 GiB RAM
  • Exact Tool Versions: gortex v0.64.12+824fbf792 (Go 1.27.3, linux/amd64), graphifyy==0.9.124 + mcp==2.3.0 (CPython 3.14.8, uv 0.13.11)
  • Tokenizer: Exact cl100k_base token counts via tiktoken==0.14.0 across full stdout payloads
  • Latency Protocol: Median wall-clock time across 3 consecutive runs per command
  • Baseline Control: Full-file reads of every TypeScript/TSX file matched by git grep -l for each task. In Task 1, we explicitly excluded five noisy i18n JSON files (src/messages/*.json, 147,892 tokens) from the main baseline (using the 5 clean TS/TSX files = 9,753 tokens) so reduction multiples reflect realistic developer queries rather than accidental JSON dumps.

Reproducible Setup & Indexing Commands

bash
# 1. Install official static binary (or curl -fsSL https://get.gortex.dev | sh)
curl -fsSL https://github.com/zzet/gortex/releases/download/v0.64.12/gortex_linux_amd64.tar.gz -o gortex.tar.gz
tar -xzf gortex.tar.gz -C ~/.local/bin

# 2. Start background daemon (--detach is required in non-interactive shells)
gortex daemon start --detach

# 3. Track repository and wait for index settlement (--loading-wait avoids exit 75)
gortex --loading-wait 30s track /path/to/repo --wait

# 4. Run codebase digest and GCX1 task exploration
gortex --loading-wait 30s wakeup
gortex --loading-wait 30s explore "resolveOgImage WebP fallback" -f gcx -n 5
For MCP wiring across Claude Code, Cursor, Codex, and 16 other agents, run gortex install once per machine and gortex init per repository (or point MCP stdio to gortex mcp).

Quantitative Comparison

1. Indexing Speed, Disk Size & Memory Footprint

MetricGortex (v0.64.12)Graphify (v0.9.124, --code-only)Graphify (update ., incl. Markdown)
Install Footprint313 MB (1 static binary)193 MB (Python venv, 59 packages)Same (193 MB)
Indexed Files692 (code, Markdown, JSON, configs)249 (code only; 437 docs/images skipped)576 (code + Markdown headings)
Graph Size14,754 nodes · 34,707 edges (5,379 FTS5 docs)1,438 nodes · 3,875 edges · 92 communities6,514 nodes · 8,688 edges · 445 communities
Cold Index Time4,877 ms (track --wait; graph settled in 1.0s)7,707 ms (--code-only 7,009 ms + cluster-only 698 ms)5,500 ms (10 parallel workers)
Incremental Update (1-line TS edit)Live daemon file watchergraphify update . 1,549 ms (no-op if topology unchanged)Same (AST cache)
On-Disk Index Size96 MB (store.sqlite 81.5 MiB + WAL 13.0 MiB)4.6 MB (graph.json 1.6 MB + graph.html 1.6 MB)5.8 MB (graph.json 5.3 MB)
Idle Memory (RAM)126.2 MiB alloc (heap_inuse 172.6 MiB)0 MB (stateless CLI; resident only when MCP runs)0 MB
Initial Orientation Digestwakeup: 269 tokens (880 B · 155.6 ms)GRAPH_REPORT.md: 5,673 tokens (19.3 KB)GRAPH_REPORT.md: 138 KB (~30k+ tokens)

Two empirical realities jump out immediately. First, "single static binary" does not mean tiny: bundling 257 Tree-sitter grammars and in-process resolvers makes Gortex 313 MB on disk, plus 96 MB for its SQLite FTS5 graph store. Second, for session orientation, Gortex's wakeup digest (269 tokens) is 21.1× smaller than Graphify's code-only GRAPH_REPORT.md (5,673 tokens).

2. Per-Task Token Consumption & CLI Latency

We ran four realistic maintenance questions against both graphs:

  • T1 (OG Image Fallback): Trace how resolveOgImage maps WebP cover images to social-crawler PNG/JPEG files and find its callers (5 TS/TSX files).
  • T2 (Thin-Post Noindex & Sitemap): Trace how THIN_NOINDEX_SLUGS excludes legacy thin posts from sitemap.ts and blog pages (6 files).
  • T3 (MDX Registry & Detection): Inspect how getPostBySlug detects MDX vs Markdown and which custom components are registered (3 files).
  • T4 (getPosts Blast Radius): Map all routes, pagination views, and sitemap consumers calling getPosts (8 files).
Bar chart comparing cl100k_base token usage across 4 code exploration tasks on the 726-file hafuture-app repository: 43,861 baseline tokens vs 11,246 Gortex GCX vs 9,083 Graphify query vs 906 Graphify explain and affected
Measured token consumption across 4 real exploration tasks on hafuture-app (cl100k_base). Gortex includes source code slices in its payload; Graphify returns structural edges and line anchors.
TaskClean Baseline (Full Files)Gortex explore -f gcx (w/ Source)Gortex explore -f jsonGraphify query (BFS Graph)Graphify explain / affected
T1: OG Image Fallback9,753 tokens (5 files)*993 tokens (-89.8% · 120.7 ms)1,249 tokens (121.3 ms)1,675 tokens (-82.8% · 260.6 ms)138 tokens (-98.6% · 254.3 ms)
T2: Noindex & Sitemap13,612 tokens (6 files)5,720 tokens (-58.0% · 145.4 ms)6,616 tokens (143.8 ms)1,831 tokens (-86.5% · 265.0 ms)118 tokens (-99.1% · 257.9 ms)
T3: MDX Detection7,904 tokens (3 files)1,612 tokens (-79.6% · 110.7 ms)1,909 tokens (115.8 ms)1,861 tokens (-76.5% · 275.7 ms)274 tokens (-96.5% · 253.9 ms)
T4: getPosts Blast Radius12,592 tokens (8 files)2,921 tokens (-76.8% · 129.4 ms)3,423 tokens (133.3 ms)3,716 tokens (-70.5% · 274.4 ms)376 tokens (-97.0% · 262.1 ms)
4-Task Total / Median Latency43,861 tokens11,246 tokens (-74.4% · 125.1 ms)13,197 tokens (-69.9% · 127.3 ms)9,083 tokens (-79.3% · 269.7 ms)906 tokens (-97.9% · 256.1 ms)

* Including the five i18n JSON files matched by an unfiltered grep in T1 raises the raw baseline to 157,645 tokens (a 158.8× drop for Gortex GCX), but we report the clean TS/TSX baseline (9,753 tokens) to avoid inflated comparisons.

3. Reading Behind the Numbers

  • Why Gortex used 5,720 tokens on T2—and why that is useful: Gortex's smart_context returned the complete source bodies of BlogPostPage, getPosts, getPostBySlug, getPageUrl, and THIN_NOINDEX_SLUGS, plus 19 blast_callers and a no_covering_tests=true flag in 145.4 ms. Meanwhile, Gortex's TSV-like GCX1 wire format cut 14.8% off its own JSON output (13,197 → 11,246 tokens) across the four tasks.
  • Graphify's two-tier exploration vs BFS truncation: On T1–T3, graphify query hit its ~2,000-token BFS budget and emitted [!] TRUNCATED: showing 58 of 212 nodes. Once you know a symbol name, however, graphify explain and graphify affected return pinpoint [EXTRACTED] call edges and line numbers (e.g., BlogPage() [calls] src/app/[locale]/blog/page.tsx:L34) in 118–376 tokens, so a targeted 40-line follow-up read still stays dramatically cheaper than full-file reads.
  • CLI round-trip speed (2.1× faster on Gortex): Gortex's resident Go daemon answers CLI calls in 110.7–145.4 ms over a Unix socket. Graphify spawns Python and loads the 1.6 MB graph.json per CLI invocation (253.9–275.7 ms), though running its persistent MCP server (python -m graphify.serve) eliminates that startup overhead.

Real-World Troubleshooting & Gotchas

Every issue below occurred live during our benchmark setup—and will trip up CI pipelines or coding agents if left unhandled.

1. Gortex: Non-TTY repo_loading race condition (exit code 75)

Immediately after gortex daemon start --detach printed daemon ready (50ms boot), running gortex track or gortex daemon status from a non-interactive script failed:

Error: status rejected: repo_loading store is opening or migrating; retry
Error: the gortex daemon is still resolving graph admission (repo_loading, identity_pending) (identity_resolution) — graph admission for this path is not yet established; retry shortly (or pass --loading-wait to wait for it)
  • Root Cause: --loading-wait defaults to 30s on an interactive TTY, but silently drops to 0 when stdout is non-TTY (failing fast with exit 75 while SQLite opens). Running gortex daemon start without --detach also blocks the shell in the foreground.
  • Fix: Always start scripted daemons with gortex daemon start --detach and pass --loading-wait 30s on subsequent non-TTY CLI calls.

2. Gortex: Bare symbol names fail gortex trace with src_not_found

Running gortex trace getPosts resolveOgImage returned:

No call path from getPosts to resolveOgImage.
Reason: src_not_found
  getPosts is not in the graph
  • Root Cause: gortex trace requires fully qualified graph node IDs (<repo>/<path>::<symbol>) rather than short function names.
  • Fix: Pass qualified IDs from gortex explore—e.g., gortex trace "bench-gortex/src/lib/posts.ts::getPosts" "bench-gortex/src/lib/posts.ts::resolveOgImage"—which immediately returns --calls(ast)-->.

3. Graphify: graphify . aborts on mixed code + Markdown repos without an API key

Running graphify . in our Next.js repo failed immediately:

error: no LLM API key found (437 doc/paper/image file(s) need semantic extraction).
Set GEMINI_API_KEY or GOOGLE_API_KEY (gemini), ... Or pass --code-only to index just the code (local AST, no key) and skip the non-code files.
  • Root Cause: Any Markdown, PDF, or image file triggers semantic LLM extraction by default.
  • Fix: Use graphify . --code-only for zero-API-key deterministic AST indexing.

4. Graphify: cluster-only silently falls back to claude -p

Following the post-extract hint to run graphify cluster-only . produced:

[graphify label] no API key found; naming communities via the `claude` CLI (claude -p).
Set an API key or pass --backend to choose explicitly, or GRAPHIFY_BACKEND=none to disable.
  • Root Cause: When no API key is configured but the claude CLI is on $PATH, Graphify invokes claude -p to label communities—which can burn Claude Code quota or hang headless jobs.
  • Fix: Prefix deterministic runs with GRAPHIFY_BACKEND=none (GRAPHIFY_BACKEND=none graphify cluster-only .).

5. Graphify: graphify update . inflates GRAPH_REPORT.md to 138 KB on content-heavy repos

Running graphify update . at the repo root indexed Markdown headings across content/posts/, ballooning the graph from 1,438 nodes to 6,514 nodes, tripping the 5,000-node graph.html cap (falling back to an aggregated community view), and expanding GRAPH_REPORT.md from 19 KB (5,673 tokens) to 138 KB (~30k+ tokens).

  • Fix: Exclude prose/content directories via .graphifyignore or scope updates directly to graphify update src/.

Which One Fits Your Workflow?

Match Your Workflow to Gortex or Graphify6 scenarios
  • Tracing cross-service calls and blast radius across multi-repo workspacesSpeed & Precision· Daily Coding & Refactoring

    257 languages, native multi-repo contract tracking, live file watching, and one-shot GCX1 source payloads minimize agent round-trips.

    Primary Pick:Gortex (MCP + Daemon)Alternative:Graphify merge-graphs
  • Zero idle RAM on constrained laptops or containers with git-hook refreshesLow Footprint· Lightweight, CI & Mixed Docs

    A 4.6 MB static JSON artifact plus a post-commit hook keeps graphs fresh with zero background daemon memory.

    Primary Pick:Graphify (--code-only + hook)Alternative:Gortex on-demand
  • Checking callers of a core function (e.g., getPosts) under 400 tokensUltra-Low Tokens· Daily Coding & Refactoring

    Returns exact caller lines and EXTRACTED confidence tags in 118–376 tokens so agents read only the lines that matter.

    Primary Pick:Graphify affected / explainAlternative:Gortex node --callers
  • Linking code symbols with design docs, PDFs, SQL schemas, and diagramsMultimodal Graph· Lightweight, CI & Mixed Docs

    Combines AST edges with semantic concept nodes and generates an agent-crawlable Markdown --wiki.

    Primary Pick:Graphify (LLM Semantic Mode)Alternative:Gortex + external RAG
  • Deterministic, zero-LLM-cost execution in GitHub Actions or headless agentsCI Determinism· Lightweight, CI & Mixed Docs

    One environment variable disables all LLM fallbacks in Graphify; Gortex works in CI too if you explicitly pass --loading-wait.

    Primary Pick:Graphify (GRAPHIFY_BACKEND=none)Alternative:Gortex (--loading-wait 30s)
  • Minimizing end-to-end API costs across exploration, MCP schemas, and repliesTotal Cost· Full-Stack Token Savings

    Graph tools cut code-reading input tokens by 74%–98%, while output/log compression and Code Mode MCP reduce the remaining overhead.

    Primary Pick:Gortex/Graphify + CavemanAlternative:Add Code Mode MCP

Limitations & Recommendation

This benchmark evaluated a single 726-file TypeScript/Next.js repository via CLI payloads and wall-clock latency. Behavior on 10,000+ file monorepos, LLM-assisted Graphify extraction over PDFs/images, and fixed prompt-token overhead from exposing many MCP tool schemas (Gortex offers up to 175 configurable MCP tools; trim your enabled surface) will vary by workload.

If your repository has fewer than ~20 files, skip both tools—direct file reads cost only a few thousand tokens and avoid maintaining any index or MCP schema overhead.

For medium-to-large repositories, the split is straightforward:

  1. Choose Gortex if you develop daily on a 16 GB+ workstation across one or multiple repositories and want 125 ms responses with runnable code slices and blast-radius callers in a single call—just remember --detach and --loading-wait 30s in scripts.
  2. Choose Graphify if you want a 4.6 MB static index, 0 MB idle RAM, transparent EXTRACTED/INFERRED edge provenance, or unified code + documentation graphs—and lock down --code-only, GRAPHIFY_BACKEND=none, and .graphifyignore when running zero-cost local code graphs.

Official References