GitNexus: An Open-Source Intelligence Engine for Transforming Codebases into Knowledge Graphs
GitNexus is an open-source code intelligence tool whose core function is to parse and construct a complete codebase into a structured knowledge graph on the client side. Through simple drag-and-drop operations (GitHub repository links or ZIP files) or command-line instructions, users can deeply index a codebase, enabling visual analysis and intelligent querying of function calls, dependency relationships, and inheritance structures.
Core Technology and How It Works
The technical core of GitNexus lies in its code parsing and graph construction capabilities. It utilizes the Tree-sitter AST (Abstract Syntax Tree) parser to index the entire codebase. This process does not rely on external servers, ensuring code privacy and security.
Its main workflow includes:
- Code Parsing: Using Tree-sitter, it parses source code of supported languages (like TypeScript, Python, Java, etc.) into Abstract Syntax Trees.
- Graph Construction: It extracts key code entities and their relationships from the AST to build a knowledge graph. This graph contains detailed information such as all function calls, module imports, class inheritance relationships, and interface implementations.
- Intelligent Analysis: Based on the graph, the engine can perform advanced analysis tasks, such as clustering code by cohesion for functional grouping, tracing complete call chains from a specified entry point, and conducting impact analysis before modifying code.
Unlike code knowledge bases that focus on textual descriptions, GitNexus emphasizes accurately mapping the structured relationships between code entities, providing a solid data foundation for automated analysis and the integration of AI agents.
Two Operation Modes: Web UI and CLI
GitNexus offers two distinct usage modes to accommodate different scenarios and needs.
Web UI Mode
This mode runs entirely in the browser, requiring no installation. Users can access the officially hosted page at gitnexus.vercel.app to use it. Its features include:
- Convenience: Ideal for quick exploration, code reviews, or educational demonstrations. With a visual graph browser and a built-in AI chat interface, users can interact with the codebase intuitively.
- Technical Implementation: It employs Tree-sitter WASM and LadybugDB WASM (an in-memory database). All data processing and storage are completed within the current browser session and are lost upon closing.
- Limitations: It is subject to browser memory constraints; the official recommendation is to process projects with approximately 5,000 files or fewer. However, it can be extended using the backend mode.
- Privacy: The code never leaves the user’s local machine and is not uploaded to any server.

CLI + MCP Mode
This mode is designed for daily development and is installed globally via npm install -g gitnexus. It runs locally and offers more powerful features:
- Local Processing: The
npx gitnexus analyze command performs deep indexing of the repository locally, supporting projects of any scale.
- Persistent Storage: It uses LadybugDB to persist indexing results locally, facilitating repeated queries and incremental updates.
- AI Integration: It starts an MCP (Multi-Agent Control Protocol) server, allowing AI coding assistants to connect and query the knowledge graph for deep code context.
- Bridge Mode: After running
gitnexus serve, the Web UI can automatically connect to the service started by the local CLI. This allows browsing and analyzing large, locally indexed repositories, combining the powerful processing capabilities of the CLI with the visualization advantages of the Web UI.
AI Agent Integration and Use Cases
A key innovation of GitNexus is its integration with mainstream AI programming tools through the MCP (Multi-Agent Control Protocol), acting as the “nervous system” between the code knowledge graph and AI agents.
By running npx gitnexus analyze in the project’s root directory, the tool automatically indexes the code, generates context files (like AGENTS.md and CLAUDE.md), and configures the AI agent’s skills. This enables the AI agent, when executing tasks, to query the graph to understand relationships between functions, class inheritance chains, and the potential impact of changes, rather than blindly reading files.
Currently supported tools include:
- Claude Code: Offers the deepest integration, supporting PreToolUse and PostToolUse hooks, which automatically inject graph context before and after tool calls.
- Cursor: Supports MCP and skill integration.
- Codex and OpenCode: Also support MCP and skill integration.
This integration supports various use cases, including automatically generating documentation for a codebase, performing impact analysis before refactoring, coordinating symbol renaming across multiple files, and providing precise context for graph-based RAG (Retrieval-Augmented Generation) intelligent agents to produce higher-quality code.