Skip to content

Use GitNexus for impact analysis

Use GitNexus to understand code structure, assess the blast radius of a change, and navigate the codebase safely before editing any symbol. This repository is indexed as lingchu-bot. GitNexus indexes the codebase into a knowledge graph and exposes it through CLI commands and MCP tools.

Terminal window
# Index the repository (run from repo root)
npx gitnexus analyze
# Configure MCP for your editors (one-time)
npx gitnexus setup
# Check index status
npx gitnexus status
# List all indexed repositories
npx gitnexus list

If the index is stale (e.g., after significant code changes), re-run npx gitnexus analyze to refresh it.

Use CLI commands to understand architecture and execution flows:

Terminal window
# Generate a repository wiki from the knowledge graph
npx gitnexus wiki
# Generate wiki with a custom model
npx gitnexus wiki --model gpt-4o-mini

For quick exploration without installing anything, use the Web UI or start a local server:

Terminal window
# Start local HTTP server for web UI connection
npx gitnexus serve

Check upstream impact before modifying a function, class, or method:

  1. Run npx gitnexus status to confirm the index is fresh.
  2. Use the MCP tools in your AI editor to run impact analysis (see the callout below).
  3. Record: direct callers, affected flows, and risk level.
  4. If the risk is HIGH or CRITICAL, pause and explain the risk before continuing.

Verify that your changes only affect expected symbols and execution flows:

  1. Run npx gitnexus analyze to refresh the index if needed.
  2. Use the MCP detect_changes tool in your AI editor to check affected scope.
  3. If the result includes unrelated files or flows, inspect the worktree first.

Do not rename symbols through global find-and-replace. Use the GitNexus rename MCP tool so that call relationships and references are handled together across all files.

Terminal window
gitnexus analyze [path] # Index a repository (or update stale index)
gitnexus analyze --force # Full rebuild: re-parse + graph rebuild + FTS rebuild
gitnexus analyze --repair-fts # Rebuild/verify only FTS indexes on existing data
gitnexus analyze --skip-embeddings # Skip embedding generation (faster)
gitnexus analyze --embeddings [n] # Enable embedding generation (slower, better search)
gitnexus analyze --skills # Generate repo-specific skill files
gitnexus analyze --skip-skills # Skip installing skill files
gitnexus analyze --skip-agents-md # Preserve custom AGENTS.md/CLAUDE.md edits
gitnexus analyze --skip-git # Index folders that are not Git repositories
gitnexus analyze --verbose # Log skipped files
gitnexus setup # Configure MCP for your editors (one-time)
gitnexus mcp # Start MCP server (stdio)
gitnexus serve # Start local 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 repo
gitnexus clean --all --force # Delete all indexes
gitnexus wiki [path] # Generate repository wiki from knowledge graph
gitnexus wiki --model <model> # Wiki with custom LLM model
gitnexus wiki --base-url <url> # Wiki with custom LLM API base URL