GitNexus: CLI Code Intelligence for AI Coding Agents
GitNexus turns the codebase your AI agent is about to edit into a knowledge graph instead of a pile of files it has to grep through blind. That precomputed-structure approach genuinely beats dumping raw code into a prompt: an impact query returns callers, clusters, and confidence scores in one call instead of a chain of exploratory searches, and even a smaller model can act on that without missing a dependency.
What GitNexus actually is
GitNexus is a knowledge-graph indexer for source code: point it at a git repo or a ZIP file and it maps every dependency, call chain, cluster, and execution flow into a queryable graph. It ships as a CLI that installs agent skills and MCP tools for Claude Code, Cursor, Codex, and similar editors, plus a separate browser-only Web UI at gitnexus.vercel.app that needs no install at all.
Key features
- β17 MCP tools (15 per-repo, 2 group-level) covering hybrid search (`query`: BM25 + semantic + RRF), blast-radius analysis (`impact`), and shortest-path tracing between two symbols (`trace`).
- β`detect_changes` reads a git diff and maps the changed lines straight to the execution processes they touch, not just a list of modified files.
- βOptional PDG (program dependence graph) indexing, built with `gitnexus analyze --pdg`, adds `explain` for taint source-to-sink flows and `pdg_query` for statement-level control/data dependence.
- βAgent skills β Exploring, Debugging, Impact Analysis, Refactoring, Guide, CLI, plus the Plan/Work/Review workflow skills and the full-pipeline LFG β install automatically to `.claude/skills/`.
- β`gitnexus analyze --skills` runs Leiden community detection to find a codebase's functional areas and writes a dedicated skill for each one.
- βBridge mode (`gitnexus serve`) lets the Web UI browse repos the CLI already indexed, without re-uploading anything.
- βA raw `cypher` tool for graph queries the packaged tools don't cover.
- β10 MCP resources expose repo stats, cluster membership, process traces, and the graph schema without a tool call.
Installing GitNexus
The CLI is the documented path: `npm install -g gitnexus`, or run it ad hoc with `npx gitnexus analyze`. Two install problems are called out by name in the README. On npm 11.x, `npx` can crash before GitNexus even runs, with the error `Cannot destructure property 'package' of 'node.target'` β an arborist bug in npm itself, not in GitNexus. The fix is installing through pnpm with `pnpm --allow-build=@ladybugdb/core --allow-build=gitnexus --allow-build=tree-sitter dlx gitnexus@latest analyze`, or installing globally and skipping `npx` entirely. Second, native tree-sitter grammars normally build without a C++ toolchain via prebuilt binaries, but if `python3`/`make`/`g++` aren't available, setting `GITNEXUS_SKIP_OPTIONAL_GRAMMARS=1` before install skips just four vendored grammars (Dart, Protocol Buffers, Swift, Kotlin) β every other language still parses. The Web UI needs no install: open gitnexus.vercel.app. Where the index lives differs by mode: the CLI persists it in LadybugDB, the project's own storage engine, while the Web UI keeps everything in an in-memory WASM instance that's gone when the tab closes.
Running analyze and setup
Two commands do the job, both run from the repo root. `npx gitnexus analyze` indexes the codebase, installs the agent skills, registers Claude Code hooks, and writes `AGENTS.md`/`CLAUDE.md` context files, all in one pass. `npx gitnexus setup` then writes the MCP config for whichever editors it auto-detects β narrow it with `gitnexus setup -c cursor,codex` if you only want specific ones. Flags worth knowing: `--branch` pins an index to a branch instead of following the working tree, `--pdg` builds the program-dependence-graph indexes `explain` and `pdg_query` need, and `--skills` generates the repo-specific area skills. `gitnexus serve` starts bridge mode so the Web UI can read CLI-built indexes.
When GitNexus shines
- β’Tracing a call chain across a large codebase after grep already lost the thread.
- β’Running `detect_changes` before a commit to see which execution processes a diff actually touches.
- β’Handing a smaller, cheaper model enough precomputed structure that it doesn't need four or five exploratory tool calls to answer "what calls this."
- β’Generating architecture docs with mermaid diagrams straight from the graph via the `generate_map` prompt.
- β’Coordinating a multi-file rename with the graph-aware `rename` tool instead of a plain text search-and-replace.
What works well
- βThe MCP surface is unusually deep for this category β 17 tools, 10 resources, and 2 prompts, not one generic search endpoint.
- βClaude Code and Codex get real PreToolUse/PostToolUse hook integration, not just a bolted-on MCP server.
- βCLI mode runs entirely local. No network calls, nothing uploaded to a third-party server.
- βThe two documented install failures ship with the actual error string and a working workaround, not a generic "reinstall and hope."
Where GitNexus stumbles
- β³npm 11.x can crash `npx` outright. That's a real install obstacle the project has to work around, since the bug lives upstream in npm's own arborist resolver.
- β³The Web UI caps out around 5,000 files in browser memory unless you pair it with a CLI-indexed backend through bridge mode.
- β³`explain` and `pdg_query` don't work off a plain `gitnexus analyze` run; they need the separate `--pdg` indexing pass first.
- β³Kotlin parsing depends on a cross-built, vendored tree-sitter grammar with no guaranteed prebuilt for every platform-arch β no match means `.kt`/`.kts` files silently don't parse.
- β³On the hosted Render deploy, the proxy strips the `Origin` header, so the server's CSRF guard doesn't apply to proxied traffic β the access token is the only real gate.
GitNexus vs the field
GitNexus is for you if...
This fits a team already routing Claude Code, Cursor, or Codex at a codebase big enough that agents keep missing call sites or shipping half-finished renames β the kind of repo where impact analysis by hand takes longer than the edit itself. A solo developer on a small side project is unlikely to notice the difference; the graph earns its cost once "what else calls this" stops being a question you can answer from memory.
Common questions
GitNexus's CLI and Web UI cost nothing to run β install the CLI via npm or open the Web UI at gitnexus.vercel.app with no signup step described in the README. The project also lists a separate Enterprise offering (SaaS and self-hosted) alongside those free tools, though pricing for that tier isn't published.
Running `npx gitnexus setup` auto-detects Claude Code and writes its MCP config, installs the agent skills, and registers PreToolUse/PostToolUse hooks in one step. For manual setup instead, run `claude mcp add gitnexus -- npx -y gitnexus@latest mcp` to register just the MCP server.
GitNexus parses source with tree-sitter β native bindings in the CLI, WASM in the Web UI. The README names four grammars specifically as vendored and optional: Dart, Protocol Buffers, Swift, and Kotlin, each needing a build step or a matching prebuilt binary. A full list of every other supported language isn't published.
On npm 11.x, GitNexus can fail before it even starts: running it through `npx` crashes with `Cannot destructure property 'package' of 'node.target'`, a bug in npm's own arborist resolver. The documented fix is installing through pnpm with the project's `--allow-build` flags, or running `npm install -g gitnexus` and calling `gitnexus analyze` directly instead of `npx`.
GitNexus doesn't publish a minimum RAM figure for local CLI indexing beyond noting that indexing is memory-bound. Its Render deployment blueprint gives one reference point: the `standard` server plan runs 2 GB of RAM and the `pro` plan runs 4 GB, and the documented fix for running out of memory on a large repo is raising that plan.
GitNexus's Web UI at gitnexus.vercel.app needs no install: open it, then drop in a git repo (GitHub, GitLab, Azure, or local) or a ZIP file. Browser memory limits it to roughly 5,000 files; past that, bridge mode (`gitnexus serve`) connects the same UI to a repo the CLI already indexed.
Related repositories
Is GitNexus worth your time?
ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of GitNexus.
