- MCP Tools — All 7 code intelligence tools
- Agent Skills — 6 skill files teaching effective tool usage
- PreToolUse Hooks — Automatic knowledge graph enrichment for grep/glob/bash
Quick Setup
Run the setup command to configure everything automatically:- Detect Claude Code installation
- Print the MCP configuration command
- Install skills to
~/.claude/skills/gitnexus/ - Install PreToolUse hooks to
~/.claude/hooks/gitnexus/ - Update
~/.claude/settings.jsonwith hook configuration
Example output
Example output
Manual MCP Configuration
If you prefer manual setup, run:npx gitnexus mcp automatically.
Agent Skills
GitNexus ships with 6 agent skill files that teach Claude Code how to use the tools effectively:| Skill | Purpose | Location |
|---|---|---|
gitnexus-exploring | Navigate unfamiliar code using the knowledge graph | ~/.claude/skills/gitnexus-exploring/ |
gitnexus-debugging | Trace bugs through call chains | ~/.claude/skills/gitnexus-debugging/ |
gitnexus-impact-analysis | Analyze blast radius before changes | ~/.claude/skills/gitnexus-impact-analysis/ |
gitnexus-refactoring | Plan safe refactors using dependency mapping | ~/.claude/skills/gitnexus-refactoring/ |
gitnexus-guide | General guidance on tool usage | ~/.claude/skills/gitnexus-guide/ |
gitnexus-cli | CLI command reference | ~/.claude/skills/gitnexus-cli/ |
gitnexus setup— Global skills for all projectsgitnexus analyze— Project-level skills in.claude/skills/
Skill Discovery: Claude Code automatically discovers and loads skills from
~/.claude/skills/ (global) and .claude/skills/ (project).PreToolUse Hooks
Claude Code’s PreToolUse hook system allows GitNexus to automatically enrich tool calls before execution.How Hooks Work
When you use tools likeGrep, Glob, or Bash, Claude Code:
- Intercepts the tool call before execution
- Runs the GitNexus hook script (
~/.claude/hooks/gitnexus/gitnexus-hook.cjs) - Enriches the call with knowledge graph context
- Passes the enriched context back to Claude Code
- Executes the original tool with additional context
Hook Configuration
Thegitnexus setup command adds this to ~/.claude/settings.json:
What Gets Enriched
The hook enriches:- Grep — Adds process participation and caller/callee context
- Glob — Adds functional cluster membership and related files
- Bash — Adds execution flow context for commands like
git diff
Example Enrichment
When you ask Claude Code to “find all authentication code”: Without hooks:Full Configuration File
Complete~/.claude/settings.json example with GitNexus hooks:
Verification
Test your Claude Code integration:Check MCP connection
Ask Claude Code:
“List all indexed repositories”This should trigger the
list_repos MCP tool.Test skills
Ask Claude Code:
“How should I use GitNexus to understand this codebase?”Claude should reference the installed skills.
Test hooks
Ask Claude Code:
“Find all authentication code”Watch for the status message: “Enriching with GitNexus graph context…”
Integration Levels
Claude Code supports three integration levels:Level 1: MCP Only
MCP tools available, but no skills or hooks. Setup:claude mcp add gitnexus -- npx -y gitnexus mcp
Level 2: MCP + Skills
MCP tools + agent skills for guided workflows. Setup:gitnexus analyze (installs project skills) or gitnexus setup (global skills)
Level 3: Full Integration (Recommended)
MCP tools + skills + PreToolUse hooks for automatic enrichment. Setup:gitnexus setup (configures everything)
Recommendation: Use Level 3 (full integration) for the best experience. Hooks provide automatic knowledge graph awareness without requiring explicit tool calls.
Project vs Global Configuration
Global Configuration
Global configuration applies to all projects on your machine:- MCP: Configured via
claude mcp add(stored in Claude Code’s global settings) - Skills:
~/.claude/skills/gitnexus/ - Hooks:
~/.claude/settings.jsonand~/.claude/hooks/gitnexus/
Project Configuration
Project configuration applies to a single repository:- Skills:
.claude/skills/gitnexus/(installed bygitnexus analyze) - Hooks:
.claude/settings.json(advanced, rarely needed) - Context:
CLAUDE.mdandAGENTS.md(installed bygitnexus analyze)
Best Practice: Use global MCP + hooks, project-level skills. This gives you consistent tool access while tailoring skill guidance to each codebase.
Updating GitNexus
The MCP configuration usesgitnexus@latest, so you automatically get the latest version:
Troubleshooting
Hooks not firing
- Check
~/.claude/settings.jsonsyntax (must be valid JSON) - Verify hook script exists:
ls ~/.claude/hooks/gitnexus/gitnexus-hook.cjs - Check hook timeout (default: 8000ms)
- Restart Claude Code after configuration changes
Skills not loading
- Verify skills directory:
ls ~/.claude/skills/gitnexus-exploring/SKILL.md - Check skill format (must have
SKILL.mdfilename) - Restart Claude Code
MCP tools not appearing
- Verify MCP configuration:
claude mcp list - Check if server starts:
npx gitnexus mcp(should not exit immediately) - Check Claude Code MCP logs
Next Steps
Using the Tools
Learn how to use GitNexus tools effectively
Multi-Repo Usage
Work with multiple indexed repositories
Agent Skills
Understand the installed skill workflows
Resources
Explore MCP resources for structured data