graphify-ts: Local MCP server cuts Claude Code PR review tokens from 63K to 8.7K

If you've used Claude Code on a real codebase, you've seen the problem: every question triggers 8-10 sequential tool calls (glob, grep, read, read, read) to build context from scratch. Input tokens pile up, latency drags, and the agent rediscovers the same structure each time. graphify-ts is a free, open-source MCP server that pre-indexes your code into a local knowledge graph, so Claude makes a single retrieve call instead.
How it works
At index time, graphify-ts parses your code with tree-sitter AST, extracts structural relationships (files, functions, classes, calls, imports), runs Louvain community detection to group related modules, indexes with BM25, and optionally re-ranks with a local ONNX model. The resulting graph is served via MCP stdio — fully local, no data leaves your laptop. The default core profile exposes 6 tools to keep session overhead low (about 5K tokens); you can opt into the full 21-tool surface with GRAPHIFY_TOOL_PROFILE=full.
Benchmarks you can verify
The repo includes a verify.sh script that re-derives all numbers from committed evidence. Results measured on a real production NestJS + Next.js codebase (1,268 files) with Claude Opus 4.7:
- Single code query: 9 tool calls → 3, 615,190 input tokens → 233,508 (2.6× fewer), latency 96 sec → 35 sec (2.8× faster). Both from Claude's
--output-format jsonusage field. - 36-file PR review: Prompt tokens dropped from 63,024 to 8,690 (7.25× smaller). Same reviewer, same diff, same review depth — both runs flagged the same hotspots.
- Multi-repo question across 3 repos: Estimated naive prompt ~1.5M tokens (wouldn't fit any window) vs. 2,800 tokens with graphify-ts. The author notes this is a structural estimate, not a sent prompt.
Install & use
npm install -g @mohammednagy/graphify-ts
cd your-project
graphify-ts generate .
graphify-ts claude installAlso works with Cursor, Copilot, Gemini CLI, Aider, OpenCode via <agent> install.
Trade-offs to know
- Cold-start cost: First session costs about 13% more than no-graph baseline due to tool-schema overhead (~5K tokens). Multi-question sessions amortize this.
- Language support: Deep extraction is best on JS/TS with framework-aware passes (Express, NestJS, Next.js, Redux Toolkit, React Router). Python/Ruby/Go/Java/Rust use plain tree-sitter AST. C/Kotlin/C#/Scala/PHP/Swift/Zig use a generic structural extractor.
- Limits: This is a structural map for an agent, not a full program-analysis database. Heavily meta-programmed routes fall back to the base AST.
The author is actively seeking counterexamples — repos where structural slicing breaks. MIT licensed, requires Node 20+.
📖 Read the full source: r/ClaudeAI
👀 See Also

Godogen: Claude Code Skills for Complete Godot Game Generation
Godogen is an open-source pipeline that uses Claude Code skills to generate complete, playable Godot 4 projects from text prompts. It handles architecture design, 2D/3D asset generation, GDScript writing, and visual QA testing, addressing specific engineering bottlenecks like GDScript training data scarcity and build-time vs runtime state issues.

Mind Keg MCP: Persistent Memory for Claude Code and MCP-Compatible Agents
Mind Keg MCP v0.1.1 is an open-source MCP server that provides persistent memory for Claude Code and other MCP-compatible agents. It stores learnings locally via SQLite and retrieves them via semantic search, allowing AI coding assistants to remember context between sessions.

Stagent: Open-source ops layer for Claude Agent SDK with local governance and workflow orchestration
Stagent is an open-source, local-first coordination workspace built on top of Claude Agent SDK and Claude API that provides workflow orchestration, budget guardrails, and human-in-the-loop governance for AI agents. It includes 15 product surfaces, 6 workflow patterns, 52+ reusable agent profiles, and runs entirely locally with SQLite.

XLI: Open-Source Python Library for Claude Code-Style Terminal UIs
Building a coding agent? Terminal UX is half the work. XLI is an open-source Python rendering engine that replicates Claude Code's streaming markdown, tool cards, inline approvals, and slash commands without hijacking your terminal scrollback.