ai-codegraph — semantic code intelligence via MCP

SkillDatabases & data

Semantic code intelligence via MCP: call chains, blast radius, cross-file symbol relationships. Uses CodeGraph (colbymchenry/codegraph), a local-first Rust server that builds a SQLite knowledge graph from tree-sitter ASTs. One tool: codegraph_explore. Use when the question involves "how does X work", "what calls Y", "if I change X what breaks", or cross-file dependency analysis. Not for literal text search, use find/grep for that. Not for file discovery, use glob. Trigger for "codegraph", "code graph", "call chain", "blast radius", "what depends on", "impact analysis".

Available today. Use it from your connected AI after setup.

Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.

Then ask your AI: use the ai-codegraph skill

What this skill tells your AI

The instructions your AI receives, as published by arcasilesgroup/ai-engineering in skills/ai-codegraph/SKILL.md and read by ahel’s review.

What it produces

Nothing written. This skill reads the code graph and returns structured answers: verbatim source grouped by file, call paths (including dynamic dispatch), and blast radius summaries. The agent uses these to answer graph questions without grepping every file.

When to use CodeGraph vs find/grep

QuestionToolWhy
"How does X work?"codegraph_exploreFollows call chains across files
"What calls function Y?"codegraph_exploreGraph traversal, follows polymorphism
"If I change this interface, what breaks?"codegraph_exploreBlast radius via edge traversal
"What does this module depend on?"codegraph_exploreImport edges in the graph
"Find all TODOs"grepLiteral text search, faster
"Where is X defined?"findSimple path lookup
"Find all files importing X"grepLiteral text match
"Show me the test for this function"find + grepConvention-based lookup

Rule of thumb: graph questions → CodeGraph. Text questions → find/grep.

Steps

  1. Check availability — is CodeGraph installed?

    which codegraph && codegraph --version
    

    If missing: npm i -g @colbymchenry/codegraph

  2. Check daemon — is the daemon running?

    test -S .codegraph/daemon.sock && echo "running" || echo "not running"
    

    If not running: codegraph serve --mcp &

  3. Check index — is the project indexed?

    codegraph status
    

    If not indexed: codegraph init

  4. Query — use codegraph_explore MCP tool:

    • query: natural language or symbol/file names
    • maxFiles: default 12, increase for broad questions
  5. Interpret results — CodeGraph returns:

    • Verbatim source grouped by file (with line numbers)
    • Call paths (calls, imports, extends, implements)
    • Blast radius summary (what depends on the queried symbol)

Per-surface MCP configuration

CodeGraph is an MCP server, not a governance hook. Each surface reads its own config:

SurfaceConfig fileKey
Claude Code~/.claude.json (global) or .mcp.json (project)mcpServers.codegraph
Cursor~/.cursor/mcp.json (global) or .cursor/mcp.json (project)mcpServers.codegraph
Copilot VS Code.vscode/mcp.json (local) or user mcp.jsonservers.codegraph
Copilot CLI~/.copilot/mcp-config.jsonmcpServers.codegraph
opencode~/.config/opencode/opencode.jsoncmcp.servers.codegraph
OMPImport from ~/.claude.json or add manually—
Pipi-codegraph-extension or @isac322/pi-codegraph—

Stdio launch shape (all surfaces):

{
  "type": "stdio",
  "command": "codegraph",
  "args": ["serve", "--mcp"]
}

Lifecycle

Lane: light Writes: nothing (read-only tool server) Read by: any agent that needs graph queries Dies: on session end Next: none — the agent decides when to use it based on the question type

Anti-patterns

  • Do NOT use for literal text search (grep is faster)
  • Do NOT use for file discovery (find/glob is faster)
  • Do NOT use CodeGraph AND grep for the same question — pick one
  • DO remember: CodeGraph leaves 82% more context resident after multi-turn sessions (vendor data: 67k vs 18k tokens after 3 turns). On small repos (<300 files), the cost may outweigh the benefit.

Source

Source: ai-engineering (own), Apache-2.0.

Signals

GitHub stars
58
Forks
3
Last commit
Sep 2026
Advanced
Item type
skill
Key
ai-codegraph
Source
github.com/arcasilesgroup/ai-engineering