GitNexus — Code Intelligence Setup Guide
Index any repo into a local knowledge graph and wire GitNexus MCP into Cursor or Claude Code — impact analysis, call chains, and safer agent edits.
Why agents need a map
LLM coding tools see files, not architecture. They rename a function without knowing forty callers exist. GitNexus indexes a repository into a local knowledge graph — dependencies, call chains, clusters, execution flows — and exposes it via MCP tools so agents query structure before editing.
Zero-server option: Web UI runs in-browser for exploration. For daily agent work, MyGearHut recommends CLI + MCP on repos you actively ship.
Project: github.com/abhigyanpatwari/GitNexus · Web demo: gitnexus.vercel.app
Two ways to use GitNexus
| Mode | Best for |
|---|---|
| Web UI | Quick tour of unfamiliar OSS repos |
| CLI + MCP | Cursor, Claude Code, Windsurf — production agent loops |
This guide focuses on CLI + MCP.
Prerequisites
- Node.js 18+ and npm
- Git repo on disk
- MCP-capable editor (Cursor, Claude Code, etc.)
Install CLI
npm install -g gitnexus
Verify:
gitnexus --version
One-time MCP setup
From any directory:
gitnexus setup
This detects installed editors, registers MCP servers, may add hooks for Claude Code, and can scaffold AGENTS.md / CLAUDE.md snippets — review diffs before committing.
Index your repository
cd ~/projects/my-app
gitnexus analyze
Force full rebuild after large refactors:
gitnexus analyze --force
Index data lives under .gitnexus/ in the repo — add to .gitignore if you do not want it committed (team policy call).
MCP tools agents gain (core set)
| Tool | What it does |
|---|---|
query | Hybrid search — find symbols, flows, processes |
context | 360° view of a symbol — refs, callers, clusters |
impact | Blast radius — what breaks if you change X |
detect_changes | Map git diff → affected processes |
rename | Coordinated multi-file rename using graph |
cypher | Raw graph queries (power users) |
list_repos | All indexed repos on your machine |
Exact tool count grows between releases — run MCP catalog in your editor after updates.
Wire into Claude Code / Cursor
After gitnexus setup, restart the editor. Confirm MCP server gitnexus is connected (green in MCP panel).
Starter prompt once indexed:
Before editing, use GitNexus impact tool on [function/module].
Summarize callers and risk. Then propose a minimal plan.
Do not edit until I approve.
Agents with graph access make fewer "surprise breakages."
Local backend + Web UI (optional)
Serve all indexed repos without re-uploading:
gitnexus serve
Open the Web UI — it detects the local server. Chat exploration uses the same graph; good for onboarding teammates.
Manual MCP stdio mode:
gitnexus mcp
Editors usually manage this via setup; manual mode helps debugging.
Daily operator workflows
Pre-refactor
gitnexus analyzeif index stale- Ask agent:
impacton symbol - Plan mode → implement → run tests
Pre-commit
Use detect_changes on my current git diff.
List affected processes I should retest.
Onboarding to legacy codebase
- Index repo
- Web UI or agent
queryfor entrypoints - Document findings in team
CLAUDE.md
Performance notes
- Large monorepos: first index takes time; incremental updates are faster
- Web-only mode is browser-memory limited (~thousands of files)
- CLI local index scales better for daily agent use
Check license (PolyForm Noncommercial for upstream) before commercial redistribution. Fixes: MCP missing → gitnexus setup + restart editor; stale graph → analyze --force; wrong repo → list_repos and explicit repo param.
Pair with MyGearHut stack
- Claude Code From Zero — agent basics first
- Two-Model Code Review — graph-informed review pass
- Boris Cherny Principles — plan before blast-radius edits
Copy-paste CLAUDE.md block
## GitNexus
- Run impact/detect_changes before multi-file refactors
- Index refreshed weekly or after architecture changes
- Prefer graph-backed rename over manual search-replace
Safer agent edits start with a map. More setup guides in the MyGearHut free library — The Gear Drop for MCP and agent ops updates.