Index your codebase for Claude Code with GitNexus
Turn your repo into a knowledge graph with GitNexus, so Claude Code checks callers, flows and blast radius before it edits, in about 20 minutes.

What you need
GitNexus is free under the PolyForm Noncommercial licence. Using it for commercial work needs a licence from its makers at Akon Labs.
Step 1: Install GitNexus
3 minA global install gives you the
gitnexuscommand and avoids annpxcrash on newer npm.- Run
node --versionand check it meets the version above. - Run the install command below.
- Run
gitnexus doctorto check that it installed.
Run thisnpm install -g gitnexus
You should see the install finishing, and
gitnexus doctorprinting a report on your system.npx crashes with Cannot destructure property 'package'?
That's a known npm 11 bug. Use the global install above and run
gitnexusdirectly, not throughnpx.- Run
Step 2: Index your repository
5 minThe index maps every function, call and dependency, so Claude can look them up instead of guessing.
- Open a terminal at the root of your repo.
- Run the command below and wait for it to finish. Big repos take longer.
- Run
gitnexus statusto check the index.
Run thisgitnexus analyze
You should see a new
.gitnexus/folder, a GitNexus section inAGENTS.mdandCLAUDE.md, and skills under.claude/skills/.You don't want GitNexus to touch your AGENTS.md or CLAUDE.md?
Run
gitnexus analyze --index-onlyto build just the index. Or use--skip-agents-mdto keep your own edits to the GitNexus section.Indexing runs on your machine with no AI model, so your code isn't sent anywhere.
Step 3: Connect GitNexus to Claude Code
3 minThe MCP server gives Claude the graph tools in every session.
- Run
gitnexus setuponce. It finds Claude Code and adds the GitNexus server for all your projects. - Or add the server yourself with the command below. On Windows, put
cmd /cbeforenpx. - Run
claude mcp listto check the connection.
Or add it yourselfclaude mcp add gitnexus -- npx -y gitnexus@latest mcp
You should see
gitnexusin the list, marked Connected.It says Failed to connect?
Run
claude mcp get gitnexusto see the error. Ifnpxcrashes, runclaude mcp remove gitnexus, then add it again withclaude mcp add gitnexus -- gitnexus mcp.- Run
Step 4: Ask Claude how your code connects
4 minA question about callers or flows shows the graph working before you trust it with an edit.
- Start
claudein your repo. - Paste the prompt below, with a real function or class name.
- Watch for GitNexus tool calls, such as
queryandcontext, in the transcript.
Your promptUse GitNexus to answer this: what calls [FUNCTION OR CLASS], and which execution flows run through it? List the files involved.
You should see an answer that names the callers, files and flows, backed by GitNexus tool calls.
Claude searches with grep instead of GitNexus?
Name the tool in your prompt, such as "use the GitNexus context tool". Then run
/mcpto check the server is connected in this session.queryfinds code and flows,contextshows a symbol's callers and dependencies, andimpactshows what a change could affect.- Start
Step 5: Check the impact before an edit
4 minSeeing what depends on the code first keeps a small change from breaking something far away.
- Paste the prompt below before any refactor.
- Read the list of affected callers and flows before you approve any edits.
- After the edit, check the change report against your tests.
Your promptBefore you edit anything, use the GitNexus impact tool on [FUNCTION OR CLASS] and list what could break. Then refactor [FEATURE]. When you're done, run detect_changes on the diff and tell me which flows changed.
You should see a list of what could break before the edit, and a short report of the changed flows after it.
Answers miss code you just wrote?
The index is out of date. Run
gitnexus analyzeagain, or keepgitnexus analyze --watchrunning in a second terminal.
You get
A knowledge graph of your repo that Claude Code checks for callers, flows and blast radius before it edits
Try next
Did this guide work for you?
Thanks. It helps us fix the steps.
Sources
0 of 5Next: Install GitNexus


