What is GitNexus
GitNexus is an open-source code knowledge graph engine that builds code repositories into a complete dependency graph through Tree-sitter parsing, and uses the MCP protocol to expose structured context to Cursor、Claude Code、Codex and other AI tools. The tool can precompute relationships such as call chains, clustering, and risk scoring, enabling AI to obtain a complete view of the codebase in a single call without multiple rounds of queries.
GitNexus's main features
- Knowledge graph construction: Parses code repositories into a graph composed of nodes (functions, classes, methods, interfaces) and edges (calls, inheritance, imports, implementations), supporting 14 mainstream languages.
- Impact analysis: Enter any symbol and it returns the multi-level dependency impact scope, annotating confidence and risk level, so you can predict which callers will break before changing code.
- 360° symbol context: When querying a single symbol, it simultaneously returns its upstream callers, downstream callees, the execution flows it belongs to, and cross-file references, eliminating AI's context blind spots.
- Change detection: Compares Git diff with the knowledge graph, automatically maps changed lines to affected symbols and flows, and evaluates the risk level.
- Multi-file rename: Performs coordinated cross-file renames based on graph dependencies, distinguishing high-confidence graph edits from low-confidence text search edits.
- Hybrid search: BM25 + semantic vectors + RRF fusion retrieval, returning results grouped by execution flow and prioritizing key paths across communities.
- Cypher graph query: Executes the Cypher graph query language directly against the codebase to customize retrieval of high-confidence call relationships or specific community structures.
- Automatic Wiki generation: Calls LLM based on the knowledge graph structure to automatically generate module documentation and architecture overviews, supporting multilingual output.
GitNexus's technical principles
- Multi-stage indexing pipeline: GitNexus uses a six-stage pipeline to transform code repositories into a knowledge graph. The first stage traverses the file tree to establish a directory structure mapping; the second stage parses the AST through Tree-sitter to extract symbol nodes such as functions, classes, methods, and interfaces; the third stage performs cross-file resolution, resolving imports, calls, and inheritance relationships, and inferring constructors and
self/thisreceiver types; the fourth stage uses the Leiden community detection algorithm to cluster related symbols into functional modules; the fifth stage traces execution flows starting from entry points to generate process chains with step indexes; the sixth stage builds a hybrid search index, fusing BM25 inverted indexes, semantic vectors, and RRF reranking. - Graph storage and concurrency: Index results are stored in LadybugDB, with the CLI using native bindings and the Web UI using the WASM version, and data is fully persisted locally. The parsing stage uses a Worker thread pool for concurrent processing, balancing throughput and stability through chunked scheduling and timeout fallback mechanisms; large-scale repositories support embedding vector generation, with a default safety limit of 50,000 nodes to prevent memory overflow.
- Precomputed relationship intelligence: Unlike traditional Graph RAG, which hands raw graph edges to an LLM for real-time exploration, GitNexus completes computations such as clustering, call chain tracing, and risk confidence scoring during the indexing stage. During queries, it returns structured results in one go through MCP tools, so AI can obtain complete 360° symbol context, impact blast radius, or change detection reports without multiple rounds of interaction.
How to use GitNexus
- CLI + MCP mode:
-
Global installation:
npm install -g gitnexus -
Run from the repository root:
npx gitnexus analyze -
One-click editor setup:
npx gitnexus setup -
Call MCP tools directly in Claude Code / Cursor and other tools
-
- Web UI mode:
-
Visit
gitnexus.vercel.app, and drag a GitHub repository or ZIP file directly into the browser -
Or run locally
npx gitnexus@latest serveto start the backend; the frontend connects automatically
-
- Docker mode: run
docker compose up -dto start both the backend (port 4747) and the frontend (port 4173)
Core advantages of GitNexus
- Precomputed relationship intelligence: Traditional Graph RAG hands raw graph edges to the LLM to explore on its own; GitNexus completes clustering, call-chain tracing and risk scoring during indexing, so the AI can get a complete answer in a single call.
- Local, zero server: The CLI runs entirely locally, with no network access and no code uploads; the Web UI processes everything only in the browser, so data never leaves the local machine.
- Small-model friendly: The heavy lifting is handled by the tool layer, so the model does not need exceptionally strong reasoning ability, and small and medium models can achieve the same architectural clarity as large models.
- Global multi-repository registration: One MCP server can serve multiple indexed repositories at the same time, managed globally via
~/.gitnexus/registry.json, with no need to configure each project separately. - Deep editor integration: Claude Code receives the most complete support (MCP + Skills + Pre/Post ToolUse hooks), and after a commit it automatically detects stale indexes and prompts for re-indexing.
GitNexus project address
- Project website:https://gitnexus.vercel.app/
- GitHub repository:https://github.com/abhigyanpatwari/GitNexus
Comparison of GitNexus with similar competitors
| Dimension | GitNexus | DeepWiki |
|---|---|---|
| Core output | Structured knowledge graph + queryable tools | Natural-language document descriptions |
| Relationship expression | Explicit graph edges (calls, inheritance, imports) | Implicit in textual descriptions |
| How AI uses it | Tool calls, returning complete context in one go | Text reading, requiring the structure to be inferred |
| Model requirements | Small models can be used; tools handle the heavy lifting | Depends on large models to understand long texts |
| Typical action | "Query the dependency impact of UserService" | "Read the functional description of UserService" |
| Editor integration | Native MCP, supports Cursor/Claude/Codex | Usually a standalone platform or documentation site |
| Privacy | Fully local, zero uploads | Usually requires cloud processing |
Application scenarios of GitNexus
- Assessment before large-scale refactoring: Before changing the return value of a core service, first use the
impacttool to inspect all dependents and layering risks, avoiding changes that affect the whole system. - Newcomer code familiarization: Through the knowledge graph and automatically generated Wiki, quickly understand the module breakdown, execution flow and key entry points of an unfamiliar codebase.
- Bug root-cause tracing: Use
contextandqueryTrace backward along the call chain to locate defect paths that propagate across files. - PR impact review: run
detect_changesbefore committing to map the diff to affected symbols and flows and automatically generate a risk report. - Cross-repository microservice governance: use the
groupcommand to create multi-repository groups, extract inter-service contracts, and match cross-repository call relationships.