Skip to main content
The setup command automatically detects installed AI editors and configures MCP integration so they can access the GitNexus knowledge graph.

Usage

This is a one-time global command. You only need to run it once after installing GitNexus.

What It Does

The setup command:
  1. Detects installed editors (Cursor, Claude Code, OpenCode, Windsurf)
  2. Writes MCP configuration to each editor’s global config file
  3. Installs agent skills for editors that support them
  4. Registers Claude Code hooks for automatic context enrichment

Supported Editors

Output

MCP Configuration

The setup command writes the following MCP entry to each editor’s config:
On Windows:

Claude Code Special Setup

For Claude Code, you need to run an additional command after gitnexus setup:
This is printed during setup.

Skills Installation

The following agent skills are installed:
  • gitnexus-exploring — Navigate unfamiliar code using the knowledge graph
  • gitnexus-debugging — Trace bugs through call chains
  • gitnexus-impact-analysis — Analyze blast radius before changes
  • gitnexus-refactoring — Plan safe refactors using dependency mapping
  • gitnexus-guide — Quick reference for all tools and workflows
  • gitnexus-cli — CLI command reference

Skill Locations

Hooks Installation (Claude Code Only)

GitNexus registers a PreToolUse hook that automatically enriches grep/glob/bash calls with knowledge graph context. Hook location: ~/.claude/hooks/gitnexus/gitnexus-hook.cjs Configuration:
SessionStart hooks are disabled on Windows due to a Claude Code bug (#23576). Session context is delivered via CLAUDE.md instead.

Manual Configuration

If you prefer not to use gitnexus setup, you can configure manually:

Cursor

Edit ~/.cursor/mcp.json:

Claude Code

OpenCode

Edit ~/.config/opencode/config.json:

Windsurf

Add to ~/.windsurf/mcp.json (global) or project-specific config. Refer to Windsurf’s MCP documentation.

Verification

After running setup:
  1. Index a repository:
  2. Open in your editor
  3. Check MCP connection:
    • Claude Code: Should auto-connect on startup
    • Cursor: Check MCP status in settings
    • OpenCode: Check MCP panel
  4. Test a tool:

Troubleshooting

Editor Not Detected

The setup command looks for these directories:
  • Cursor: ~/.cursor/
  • Claude Code: ~/.claude/
  • OpenCode: ~/.config/opencode/
If your editor is installed but not detected, configure manually.

MCP Connection Fails

Ensure npx is available:
Restart your editor after running setup.

Skills Not Appearing

Check skill installation:
Reindex your repository to generate per-repo skills:

Next Steps

Index Repository

Run analyze to index your first repo

MCP Integration

Learn about MCP tools and workflows