Skip to main content
Get GitNexus indexing your codebase and connected to your AI editor in under 5 minutes.

Fast path

1

Index your repository

Run from your repository root:
npx gitnexus analyze
This command:
  • Indexes your codebase into a knowledge graph
  • Installs agent skills to .claude/skills/
  • Registers Claude Code hooks
  • Creates AGENTS.md / CLAUDE.md context files
  • Adds the repo to ~/.gitnexus/registry.json
2

Configure your editor

Run the one-time setup:
npx gitnexus setup
This auto-detects your editors and writes the correct MCP configuration.
3

Restart your editor

Restart your AI coding assistant to load the MCP server and skills.
That’s it! Your agent now has deep codebase awareness through GitNexus.

What your agent gets

7 MCP Tools

ToolWhat It Does
list_reposDiscover all indexed repositories
queryProcess-grouped hybrid search (BM25 + semantic + RRF)
context360-degree symbol view — categorized refs, process participation
impactBlast radius analysis with depth grouping and confidence
detect_changesGit-diff impact — maps changed lines to affected processes
renameMulti-file coordinated rename with graph + text search
cypherRaw Cypher graph queries

6 Resource Types

ResourcePurpose
gitnexus://reposList all indexed repositories
gitnexus://repo/{name}/contextCodebase stats and staleness check
gitnexus://repo/{name}/clustersFunctional clusters with cohesion scores
gitnexus://repo/{name}/cluster/{name}Cluster members and details
gitnexus://repo/{name}/processesAll execution flows
gitnexus://repo/{name}/process/{name}Full process trace with steps

4 Agent Skills

Automatically installed to .claude/skills/gitnexus/:
  • 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

Example: Query tool

Ask your agent to search for authentication-related code:
// Agent calls:
query({
  query: "authentication middleware",
  context: "user login flow",
  limit: 3
})
Response shows process-grouped results:
{
  "processes": [
    {
      "summary": "LoginFlow",
      "priority": 0.042,
      "symbol_count": 4,
      "process_type": "cross_community",
      "step_count": 7
    }
  ],
  "process_symbols": [
    {
      "name": "validateUser",
      "type": "Function",
      "filePath": "src/auth/validate.ts",
      "process_id": "proc_login",
      "step_index": 2
    }
  ],
  "definitions": [
    {
      "name": "AuthConfig",
      "type": "Interface",
      "filePath": "src/types/auth.ts"
    }
  ]
}

Example: Impact tool

Check what breaks if you change a function:
// Agent calls:
impact({
  target: "UserService",
  direction: "upstream",
  minConfidence: 0.8
})
Response shows blast radius:
TARGET: Class UserService (src/services/user.ts)

UPSTREAM (what depends on this):
  Depth 1 (WILL BREAK):
    handleLogin [CALLS 90%] -> src/api/auth.ts:45
    handleRegister [CALLS 90%] -> src/api/auth.ts:78
    UserController [CALLS 85%] -> src/controllers/user.ts:12
  Depth 2 (LIKELY AFFECTED):
    authRouter [IMPORTS] -> src/routes/auth.ts

Manual editor setup

If you prefer manual configuration instead of gitnexus setup:
claude mcp add gitnexus -- npx -y gitnexus@latest mcp
Claude Code gets full integration: MCP + skills + PreToolUse hooks.

Editor support

EditorMCPSkillsHooks (auto-augment)Support
Claude Code✓ (PreToolUse)Full
CursorMCP + Skills
WindsurfMCP
OpenCodeMCP + Skills
Claude Code gets the deepest integration with PreToolUse hooks that automatically enrich grep, glob, and bash calls with knowledge graph context.

Multi-repo workflow

GitNexus supports indexing multiple repositories:
1

Index each repository

cd ~/projects/api && npx gitnexus analyze
cd ~/projects/web && npx gitnexus analyze
cd ~/projects/lib && npx gitnexus analyze
2

List indexed repos

npx gitnexus list
Shows all registered repositories with stats.
3

Use in agent

With multiple repos indexed, the MCP server serves them all automatically.When only one repo is indexed, the repo parameter is optional:
query({ query: "auth" })
With multiple repos, specify which one:
query({ query: "auth", repo: "api" })

Next steps

Core Concepts

Learn how the knowledge graph works

MCP Integration

Deep dive into MCP tools and resources

CLI Reference

Explore all CLI commands

Agent Skills

Master the 4 agent skills

Build docs developers (and LLMs) love