Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gitnexus) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
GitNexus
Graph-powered code intelligence for AI agents. Index any codebase into a knowledge graph, then query it via MCP or CLI.
Works with Cursor, Claude Code, Windsurf, Cline, OpenCode, and any MCP-compatible tool.
Why?
AI coding tools don't understand your codebase structure. They edit a function without knowing 47 other functions depend on it. GitNexus fixes this by precomputing every dependency, call chain, and relationship into a queryable graph.
One command to index. One MCP connection to give your AI agent full codebase awareness.
Quick Start
# Index your repository
npx gitnexus analyze
# Start MCP server (for Cursor, Claude Code, etc.)
npx gitnexus mcpOr install globally:
npm install -g gitnexus
gitnexus analyze
gitnexus mcpMCP Setup
Cursor / Windsurf
Add to your MCP config (.cursor/mcp.json or equivalent):
{
"mcpServers": {
"gitnexus": {
"command": "npx",
"args": ["-y", "gitnexus", "mcp"],
"env": {
"GITNEXUS_CWD": "/path/to/your/repo"
}
}
}
}Claude Code
claude mcp add gitnexus -- npx -y gitnexus mcpOpenCode
Add to your opencode.json:
{
"mcp": {
"gitnexus": {
"command": "npx",
"args": ["-y", "gitnexus", "mcp"]
}
}
}What It Does
GitNexus indexes your codebase through 7 phases:
- Structure — File/folder tree
- Parse — AST extraction via Tree-sitter (9 languages)
- Imports — Resolve import paths (including TS path aliases, Rust modules, Java wildcards, Go packages)
- Calls — Function call resolution with confidence scoring (0.3-0.9)
- Heritage — Class extends/implements chains
- Communities — Leiden algorithm clusters related code into functional groups
- Processes — Entry point detection and execution flow tracing
The result is a KuzuDB graph database stored locally in .gitnexus/ with full-text search and semantic embeddings.
MCP Tools
Your AI agent gets these tools automatically:
| Tool | What It Does | Example |
|---|---|---|
search |
Hybrid search (BM25 + semantic) with cluster context | "Find authentication logic" |
overview |
List all clusters and processes | "Show me the codebase structure" |
explore |
Deep dive on a symbol, cluster, or process | "Tell me about UserService" |
impact |
Blast radius analysis | "What breaks if I change validateUser?" |
cypher |
Raw Cypher graph queries | Complex relationship queries |
read |
Smart file reader with fuzzy path matching | Read specific files |
grep |
Regex pattern search | Find TODOs, error codes |
MCP Resources
| Resource | Purpose |
|---|---|
gitnexus://context |
Codebase stats and overview |
gitnexus://clusters |
All functional clusters |
gitnexus://cluster/{name} |
Cluster members and details |
gitnexus://processes |
All execution flows |
gitnexus://process/{name} |
Full process trace |
gitnexus://schema |
Graph schema for Cypher queries |
CLI Commands
gitnexus analyze [path] # Index a repository (or update stale index)
gitnexus analyze --force # Force full re-index
gitnexus mcp # Start MCP server (stdio)
gitnexus serve # Start HTTP server for web UI
gitnexus list # List all indexed repositories
gitnexus status # Show index status for current repo
gitnexus clean # Delete index for current repoSupported Languages
TypeScript, JavaScript, Python, Java, C, C++, C#, Go, Rust
How Impact Analysis Works
gitnexus_impact("UserService", "upstream")
TARGET: Class UserService (src/services/user.ts)
UPSTREAM (what depends on this):
Depth 1 (direct callers):
handleLogin [CALLS 90%] → src/api/auth.ts:45
handleRegister [CALLS 90%] → src/api/auth.ts:78
Depth 2:
authRouter [IMPORTS] → src/routes/auth.ts
8 files affected, 3 clusters touchedOptions: maxDepth, minConfidence, relationTypes, includeTests
Agent Skills
GitNexus ships with skill files that teach AI agents how to use the tools effectively:
- Exploring — Navigate unfamiliar code using the knowledge graph
- Debugging — Trace bugs through call chains
- Impact Analysis — Analyze blast radius before changes
- Refactoring — Plan safe refactors using dependency mapping
These are installed automatically to .claude/skills/ when you run gitnexus analyze.
Requirements
- Node.js >= 18
- Git repository (uses git for commit tracking)
Privacy
- All processing happens locally on your machine
- No code is sent to any server
- Index stored in
.gitnexus/inside your repo (gitignored)
Web UI
GitNexus also has a browser-based UI at gitnexus.vercel.app — 100% client-side, your code never leaves the browser.
License
Free for non-commercial use. Contact for commercial licensing.