<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>CodeGraph on RockB</title><link>https://baeseokjae.github.io/tags/codegraph/</link><description>Recent content in CodeGraph on RockB</description><image><title>RockB</title><url>https://baeseokjae.github.io/images/og-default.png</url><link>https://baeseokjae.github.io/images/og-default.png</link></image><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 07 Jul 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://baeseokjae.github.io/tags/codegraph/index.xml" rel="self" type="application/rss+xml"/><item><title>CodeGraph vs Graphify: Choosing the Right Code Knowledge Graph for AI Coding Agents in 2026</title><link>https://baeseokjae.github.io/posts/codegraph-vs-graphify-ai-coding-agents-2026/</link><pubDate>Tue, 07 Jul 2026 00:00:00 +0000</pubDate><guid>https://baeseokjae.github.io/posts/codegraph-vs-graphify-ai-coding-agents-2026/</guid><description>&lt;p>If your AI coding agent spends half its tool calls grepping files, reading source to find function definitions, and tracing call chains, you already know the pain. The question is which tool to install. &lt;strong>CodeGraph&lt;/strong> and &lt;strong>Graphify&lt;/strong> are the two most popular solutions, but they solve different problems, and picking the wrong one wastes time.&lt;/p>
&lt;p>Here is the short version: use &lt;strong>CodeGraph&lt;/strong> when your bottleneck is AI agents burning tokens on source-code discovery during edits. Use &lt;strong>Graphify&lt;/strong> when you need a shareable project memory graph spanning code, docs, schemas, PDFs, and diagrams, especially for a team.&lt;/p></description><content:encoded><![CDATA[<p>If your AI coding agent spends half its tool calls grepping files, reading source to find function definitions, and tracing call chains, you already know the pain. The question is which tool to install. <strong>CodeGraph</strong> and <strong>Graphify</strong> are the two most popular solutions, but they solve different problems, and picking the wrong one wastes time.</p>
<p>Here is the short version: use <strong>CodeGraph</strong> when your bottleneck is AI agents burning tokens on source-code discovery during edits. Use <strong>Graphify</strong> when you need a shareable project memory graph spanning code, docs, schemas, PDFs, and diagrams, especially for a team.</p>
<p>Everything below is what I learned running both on real monorepos, including this blog&rsquo;s agent pipeline.</p>
<h2 id="codegraph-vs-graphify-the-decision-in-one-table">CodeGraph vs Graphify: The Decision in One Table</h2>
<table>
  <thead>
      <tr>
          <th>Dimension</th>
          <th>CodeGraph</th>
          <th>Graphify</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Best for</td>
          <td>Agent-native code navigation during coding</td>
          <td>Multimodal, team-shareable project knowledge graph</td>
      </tr>
      <tr>
          <td>Agent model</td>
          <td>MCP server — wired per agent</td>
          <td>Skill/command — installed per assistant</td>
      </tr>
      <tr>
          <td>Output</td>
          <td>Local <code>.codegraph/</code> index (SQLite + FTS5)</td>
          <td><code>graphify-out/</code> with <code>graph.html</code>, <code>GRAPH_REPORT.md</code>, <code>graph.json</code></td>
      </tr>
      <tr>
          <td>Freshness</td>
          <td>Auto-sync on file change (2s debounce)</td>
          <td>Manual update or git hook</td>
      </tr>
      <tr>
          <td>Language coverage</td>
          <td>Source code via tree-sitter</td>
          <td>Code + docs + SQL + Terraform + PDFs + Office + images + video</td>
      </tr>
      <tr>
          <td>Benchmarks</td>
          <td>Publishes concrete tool-call and token data</td>
          <td>Third-party claims (up to 71.5× token reduction)</td>
      </tr>
      <tr>
          <td>GitHub stars</td>
          <td>~57K (July 2026)</td>
          <td>~77K (July 2026)</td>
      </tr>
      <tr>
          <td>Install</td>
          <td><code>npm install -g @colbymchenry/codegraph</code></td>
          <td><code>uv tool install graphifyy</code></td>
      </tr>
  </tbody>
</table>
<h2 id="why-ai-coding-agents-need-a-code-graph-in-2026">Why AI Coding Agents Need a Code Graph in 2026</h2>
<p>Here&rsquo;s what happens when Claude Code or Codex CLI edits a large repository without a pre-indexed graph. The agent starts a session with no memory of your codebase. It reads <code>CLAUDE.md</code> (if you have one), then starts exploring. To find a function definition, it calls <code>grep</code>. To understand a call chain, it reads files one at a time. To figure out which routes a change touches, it searches for route registrations across 50 files.</p>
<p>On a medium-sized monorepo — say 500 TypeScript files — this discovery phase can burn 30 to 60 tool calls and several thousand input tokens before the agent makes its first edit. Every session repeats this work because the agent&rsquo;s context resets.</p>
<p>A code knowledge graph shortcuts that. It pre-builds a local index of symbols, relationships, call paths, and dependencies so the agent can query &ldquo;who calls this function&rdquo; or &ldquo;what routes does this handler touch&rdquo; in one MCP tool call instead of ten grep-and-read cycles.</p>
<h2 id="what-codegraph-is">What CodeGraph Is</h2>
<p>CodeGraph, by Colby McHenry (colbymchenry/codegraph on GitHub), is a local-first MCP server that builds a pre-indexed code knowledge graph for AI coding agents. It installs as a global npm package and registers itself as an MCP tool with supported agents.</p>
<p>The architecture is straightforward:</p>
<ul>
<li><strong>Tree-sitter AST parsing</strong> extracts functions, classes, methods, calls, imports, extends, and implements relationships from your source files.</li>
<li><strong>SQLite with FTS5</strong> stores the graph locally in <code>.codegraph/codegraph.db</code>.</li>
<li><strong>A file watcher</strong> monitors your project for changes, debounces with a 2-second quiet window, and incrementally syncs the graph as you edit.</li>
<li><strong>An MCP server</strong> exposes tools like <code>codegraph_explore</code> and <code>codegraph_lookup</code> that agents call instead of grepping.</li>
</ul>
<p>The install flow is:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>npm install -g @colbymchenry/codegraph
</span></span><span style="display:flex;"><span>codegraph install    <span style="color:#75715e"># wires into Claude Code, Cursor, Codex CLI, etc.</span>
</span></span><span style="display:flex;"><span>codegraph init       <span style="color:#75715e"># builds the index in the current project</span>
</span></span></code></pre></div><p>The key design choice: CodeGraph is a <strong>service for agents</strong>. You do not read its output directly. The agent does. The <code>.codegraph/</code> directory is opaque infrastructure — you commit it to <code>.gitignore</code> and forget it.</p>
<h2 id="what-graphify-is">What Graphify Is</h2>
<p>Graphify, by Safi Shamsi (safishamsi/graphify on GitHub), is a Python-based AI coding assistant skill that maps code and project artifacts into a queryable knowledge graph. It is broader in scope and more visible in output.</p>
<p>The install flow is:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>uv tool install graphifyy
</span></span><span style="display:flex;"><span>graphify install
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Then in your assistant: /graphify . or $graphify</span>
</span></span></code></pre></div><p>Graphify creates visible artifacts in <code>graphify-out/</code>:</p>
<ul>
<li><strong><code>graph.json</code></strong> — the complete graph data, suitable for programmatic querying and diffing.</li>
<li><strong><code>GRAPH_REPORT.md</code></strong> — a human-readable project map.</li>
<li><strong><code>graph.html</code></strong> — an interactive visualization you can open in a browser.</li>
</ul>
<p>This makes Graphify inherently more <strong>shareable</strong>. You can commit <code>graph.json</code> to the repo, diff it across PRs, and discuss the project architecture through a document rather than asking each team member to run an agent session.</p>
<p>Beyond code, Graphify supports optional plugins for SQL schemas, Terraform configurations, PDF documents, Office files, Google Workspace exports, images, and video. Code extraction runs locally via tree-sitter, but non-code extraction may call the configured model API unless you route it through a local or enterprise backend.</p>
<h2 id="the-artifact-difference-is-important">The Artifact Difference Is Important</h2>
<p>This is the clearest distinction between the two tools, and most comparisons gloss over it.</p>
<p><strong>CodeGraph treats the graph as agent infrastructure.</strong> The <code>.codegraph/</code> directory is a cached index the agent queries at runtime. You do not review it. You do not commit it. You do not diff it in code review. It is invisible operational plumbing.</p>
<p><strong>Graphify treats the graph as a project artifact.</strong> The <code>graphify-out/</code> directory contains files a human can open, inspect, and share. When a new engineer joins the team, they can read <code>GRAPH_REPORT.md</code> to understand the module structure. When you make a cross-cutting change, you can diff <code>graph.json</code> to verify the impact.</p>
<p>If you are a solo developer using Claude Code for daily edits, CodeGraph&rsquo;s invisible index is the right abstraction — you do not want to manage an artifact. If you lead a team of five and want the knowledge graph to be part of your team workflow, Graphify&rsquo;s visible artifacts are a real differentiator.</p>
<h2 id="benchmarks-codegraphs-numbers-vs-graphifys-claims">Benchmarks: CodeGraph&rsquo;s Numbers vs Graphify&rsquo;s Claims</h2>
<p>CodeGraph publishes concrete benchmark results across seven open-source repositories. The median improvements are:</p>
<ul>
<li><strong>58% fewer tool calls</strong></li>
<li><strong>22% faster answers</strong></li>
<li><strong>File reads cut near zero</strong> for the CodeGraph arm</li>
</ul>
<p>These are reproducible claims. You can run the same repos with and without CodeGraph and verify the numbers.</p>
<p>Graphify&rsquo;s numbers come from third-party articles. The most striking claim — 71.5× token reduction — comes from Emelia&rsquo;s Graphify guide, which attributes it to Graphify&rsquo;s three-pass analysis architecture. I have not been able to reproduce that exact number, and Graphify&rsquo;s own README does not publish controlled benchmarks in the same style.</p>
<p>The honest take: both tools reduce context-discovery overhead. CodeGraph&rsquo;s published benchmarks are more specific to the coding-agent use case. Graphify&rsquo;s broader scope means its savings depend heavily on what artifacts you index.</p>
<h2 id="freshness-and-team-workflow">Freshness and Team Workflow</h2>
<p>CodeGraph&rsquo;s auto-sync is the stronger choice during active development. The file watcher detects saves, debounces to 2 seconds, and updates the index incrementally. If you are in a 40-minute edit-compile-test loop, the graph stays current without manual intervention.</p>
<p>Graphify&rsquo;s freshness depends on process. You can run <code>graphify update</code> manually, wire it to a git pre-commit hook, or schedule periodic rebuilds. The committed <code>graph.json</code> is a snapshot — it gets stale between commits unless your team enforces the update discipline.</p>
<p>For a solo developer, CodeGraph&rsquo;s auto-sync wins. For a team where the graph artifact is part of the review process, Graphify&rsquo;s snapshot model is a feature, not a bug — you can discuss what the graph looked like at the point of the PR.</p>
<h2 id="security-and-privacy-considerations">Security and Privacy Considerations</h2>
<p>Both tools run indexing locally, which is good. But the similarity ends there.</p>
<p><strong>CodeGraph</strong> has a narrower security surface. It extracts only source code via tree-sitter, stores everything in a local SQLite file, and serves the agent through a local MCP server. No data leaves your machine. The main risk to review is trusting the npm installer and the MCP configuration.</p>
<p><strong>Graphify</strong> has a broader surface because of the optional extras. Code extraction runs locally, but PDF, image, and video plugins may call configured model APIs (Ollama, OpenAI, Gemini, Anthropic, Bedrock, or Azure). If your compliance team cares about which data paths touch external APIs — and they should — Graphify&rsquo;s configuration needs a documented review.</p>
<p>For compliance-sensitive codebases, CodeGraph&rsquo;s narrower surface is easier to approve.</p>
<h2 id="when-to-choose-codegraph">When to Choose CodeGraph</h2>
<p>Use CodeGraph when:</p>
<ul>
<li>Your AI coding agent (Claude Code, Cursor, Codex CLI) spends too many tool calls on code discovery</li>
<li>You work alone or in a small team where the graph is infrastructure, not a review artifact</li>
<li>Your repo is a medium-to-large source-code project (500+ files, multiple entry points)</li>
<li>You want auto-sync during active editing</li>
<li>You need to minimize the security review surface</li>
</ul>
<p>I switched this blog&rsquo;s agent pipeline to use CodeGraph for exactly these reasons. The tool-call reduction is measurable — I documented a 52% drop in grep and file-read operations on our first production attempt.</p>
<h2 id="when-to-choose-graphify">When to Choose Graphify</h2>
<p>Use Graphify when:</p>
<ul>
<li>Your project spans code, documentation, SQL schemas, and architecture diagrams</li>
<li>You want a shareable, inspectable knowledge graph artifact your team can read and discuss</li>
<li>You need to onboard new engineers to a polyglot or documentation-heavy codebase</li>
<li>You want to visualize dependencies, routes, and module relationships in a browser</li>
<li>You prefer Python (<code>uv tool install graphifyy</code>) over Node.js</li>
</ul>
<h2 id="when-to-use-neither">When to Use Neither</h2>
<p>Both tools are context accelerators, not correctness engines. If your agent&rsquo;s failures come from unclear requirements, missing tests, incorrect assumptions about runtime state, or poor verification of its own output, a code graph will not fix those problems.</p>
<p>The Reddit discussion on r/codex makes this point well: &ldquo;Codegraph/Graphify are solving the wrong problem for coding agents&rdquo; — the post argues that if the agent still needs to validate its output against what the code actually does at runtime, a symbol graph is a modest improvement. I disagree that it is the wrong problem, but the warning is fair: measure your agent&rsquo;s failure modes before assuming a graph tool is the answer.</p>
<p>Also skip these if your repo is small (under 50 files), you are writing throwaway scripts, or your team cannot maintain the agent configuration an MCP server or skill file requires.</p>
<h2 id="evaluation-checklist-test-both-on-your-own-repo">Evaluation Checklist: Test Both on Your Own Repo</h2>
<p>Run the same task — say, &ldquo;add a new API endpoint that follows the existing pattern&rdquo; — three times:</p>
<ol>
<li><strong>No graph</strong> — baseline with standard agent config</li>
<li><strong>CodeGraph</strong> — after <code>codegraph init</code></li>
<li><strong>Graphify</strong> — after <code>graphify install</code> and <code>/graphify .</code></li>
</ol>
<p>Measure:</p>
<ul>
<li>Tool calls before the first edit</li>
<li>File reads before the first edit</li>
<li>Time to first edit</li>
<li>Wrong-file edits (the agent changed a file it should not have)</li>
<li>Missed-impact review comments (the agent missed a caller, route, or dependency)</li>
<li>Staleness incidents (the agent relied on stale data)</li>
</ul>
<p>This takes an afternoon but tells you exactly which tool works for your codebase.</p>
<h2 id="final-verdict">Final Verdict</h2>
<p>CodeGraph and Graphify are not direct competitors despite sharing the &ldquo;code knowledge graph&rdquo; tag. CodeGraph is a focused <strong>agent context accelerator</strong> for source-code navigation. Graphify is a <strong>multimodal project knowledge graph</strong> that happens to support coding agents.</p>
<p>For editing code, I reach for CodeGraph. For understanding the full project — code plus docs plus schemas — I use Graphify. If I had to pick one for this blog&rsquo;s AI pipeline, which is code-heavy and solo-operated, CodeGraph is the cleaner choice.</p>
<p>Try both with the evaluation checklist above. Your repo will tell you which one fits.</p>
<p><em>Internal links: <a href="/posts/codegraph-for-claude-code-and-cursor-guide-2026/">CodeGraph for Claude Code and Cursor Guide</a> · <a href="/posts/agent-skills-marketplace-guide-2026-claude-codex-cursor-and-gemini-cli/">Agent Skills Marketplace Guide 2026</a> · <a href="/posts/best-mcp-servers-developers-2026/">Best MCP Servers for Developers 2026</a></em></p>
<h2 id="faq">FAQ</h2>
<h3 id="can-i-use-codegraph-and-graphify-together">Can I use CodeGraph and Graphify together?</h3>
<p>Yes, but the overlap is small. CodeGraph handles live code navigation during editing; Graphify handles the broader project knowledge graph across docs, schemas, and media. I run both on larger repos — CodeGraph for the agent&rsquo;s coding loop, Graphify for onboarding documentation and architecture visualization. The main cost is maintaining two config files and two tool registrations.</p>
<h3 id="does-codegraph-support-non-typescript-languages">Does CodeGraph support non-TypeScript languages?</h3>
<p>CodeGraph uses tree-sitter parsers, so it supports any language with a tree-sitter grammar. The README explicitly mentions TypeScript, JavaScript, Python, Rust, Go, and Java. Graphify covers more languages through its broader plugin system, but both tools handle the major languages well. For niche languages, check the tree-sitter grammar availability first.</p>
<h3 id="is-graphify-free-to-use">Is Graphify free to use?</h3>
<p>Yes, Graphify is MIT-licensed and free. The <code>graphifyy</code> PyPI package has no paywall. The cost to consider is infrastructure: if you use the optional plugins for PDF, image, or video extraction with model APIs (OpenAI, Gemini, Anthropic), those API calls incur their own billing. Local-only extraction via tree-sitter is free.</p>
<h3 id="which-tool-has-better-mcp-integration">Which tool has better MCP integration?</h3>
<p>CodeGraph is MCP-native — its entire architecture is an MCP server. Graphify offers MCP as an optional mode (<code>graphify mcp</code>), but its primary workflow is a skill/command executed inside the assistant. If your workflow depends on MCP tools (like mine with Hermes Agent), CodeGraph&rsquo;s MCP-first design is more reliable. If you use a mix of MCP and non-MCP assistants, Graphify&rsquo;s skill-based approach covers more ground.</p>
<h3 id="what-happens-when-the-code-graph-gets-stale">What happens when the code graph gets stale?</h3>
<p>CodeGraph watches your filesystem and auto-syncs with a 2-second debounce — staleness is rare during active editing. Graphify&rsquo;s <code>graph.json</code> is a snapshot that stays stale until you run <code>graphify update</code> or wire a git hook. For solo development, CodeGraph&rsquo;s auto-sync is better. For team review workflows, a committed snapshot at PR time is actually desirable because it lets you diff what the graph looked before and after the change.</p>
]]></content:encoded></item><item><title>CodeGraph for Claude Code and Cursor Guide 2026: Install, Configure, and Measure the ROI</title><link>https://baeseokjae.github.io/posts/codegraph-for-claude-code-and-cursor-guide-2026/</link><pubDate>Mon, 06 Jul 2026 14:00:00 +0000</pubDate><guid>https://baeseokjae.github.io/posts/codegraph-for-claude-code-and-cursor-guide-2026/</guid><description>A practical 2026 guide to installing and using CodeGraph with Claude Code and Cursor — covering setup, workflow, measurement, governance, and when it&amp;#39;s not worth the overhead.</description><content:encoded><![CDATA[<p>By mid-2026, CodeGraph has become one of the fastest-growing developer tools on GitHub — 57,000+ stars, MIT license, and active development since January 2026. If you use Claude Code or Cursor on a codebase larger than a few thousand lines, you&rsquo;ve probably seen the claims: 70% fewer tool calls, 59% lower token consumption, 49% faster response time. Those numbers come from benchmark repos, not every project, but the underlying idea is sound.</p>
<p>I&rsquo;ve been running CodeGraph with both Claude Code and Cursor for the past few months across several production repos. This guide covers what I&rsquo;ve found works, what doesn&rsquo;t, and how to decide whether it&rsquo;s worth adding to your stack.</p>
<h2 id="what-codegraph-is-and-why-claude-code-and-cursor-users-care">What CodeGraph Is and Why Claude Code and Cursor Users Care</h2>
<p>CodeGraph is a local-first, pre-indexed code knowledge graph that exposes itself to AI coding agents through the Model Context Protocol (MCP). It parses your source files with tree-sitter AST extraction, stores the results in a local SQLite database with FTS5 full-text search, and serves queries through MCP tools like <code>codegraph_explore</code>, <code>codegraph_symbol_search</code>, and <code>codegraph_call_graph</code>.</p>
<p>What this means in practice: instead of your agent burning 15 <code>grep</code> and <code>read</code> calls to figure out who calls a function, it asks CodeGraph once and gets back a structured answer. The agent doesn&rsquo;t need to navigate the filesystem to understand your architecture — it has a pre-built map.</p>
<p>Claude Code and Cursor are the two most common targets because both support MCP natively. Claude Code uses <code>~/.claude/settings.json</code> for MCP server registration. Cursor uses <code>~/.cursor/mcp.json</code>. CodeGraph&rsquo;s installer handles both automatically.</p>
<h2 id="the-problem-agents-waste-time-rebuilding-a-map-of-your-repo">The Problem: Agents Waste Time Rebuilding a Map of Your Repo</h2>
<p>Every time you start a Claude Code or Cursor session on a large repo, the agent has zero context about your codebase structure. It doesn&rsquo;t know which files define the routing layer, which functions handle database access, or how the authentication flow connects to the middleware chain. It has to discover all of that from scratch — one <code>grep</code> at a time.</p>
<p>I watched this happen on a 200,000-line TypeScript monorepo. Claude Code needed to understand the impact of changing a shared utility function. It spent 22 tool calls — grep, read, grep again, read more files — just tracing callers and callees before it could propose a change. With CodeGraph, that same question took two calls: <code>codegraph_call_graph</code> to get the callers, then <code>codegraph_explore</code> to read the relevant function signatures.</p>
<p>The waste isn&rsquo;t just token cost. It&rsquo;s session time, attention budget, and the increased chance the agent misses something because it stopped searching too early.</p>
<h2 id="how-codegraph-works-tree-sitter-sqlite-fts5-mcp-and-auto-sync">How CodeGraph Works: Tree-Sitter, SQLite, FTS5, MCP, and Auto-Sync</h2>
<p>CodeGraph&rsquo;s architecture is straightforward and worth understanding because it affects what you can trust:</p>
<ul>
<li><strong>Tree-sitter extraction</strong> parses each source file into an AST and extracts functions, classes, methods, calls, imports, extends, and implements relationships. This is deterministic — no LLM summaries, no hallucinated relationships. What you get is what the parser found.</li>
<li><strong>SQLite storage</strong> with FTS5 full-text search lives in <code>.codegraph/codegraph.db</code> inside your project. The database is local, portable, and queryable with standard SQL if you want to inspect it directly.</li>
<li><strong>MCP server</strong> exposes tools like <code>codegraph_explore</code>, <code>codegraph_symbol_search</code>, <code>codegraph_call_graph</code>, and <code>codegraph_route_search</code>. The server runs as a subprocess launched by your agent&rsquo;s MCP client.</li>
<li><strong>Auto-sync</strong> watches your project files, debounces changes with a 2-second quiet window, filters to source files, and incrementally updates the graph. After you save a file, the index catches up within seconds.</li>
</ul>
<p>The key design decision: CodeGraph indexes structure, not semantics. It knows that <code>authenticateUser</code> is called by <code>loginHandler</code> and calls <code>verifyToken</code>. It does not know what <code>authenticateUser</code> <em>does</em> in a business sense. That&rsquo;s fine — the agent reads the actual source for semantics. CodeGraph just eliminates the discovery overhead.</p>
<h2 id="when-codegraph-helps-most">When CodeGraph Helps Most</h2>
<p>I&rsquo;ve found CodeGraph delivers clear value in these scenarios:</p>
<p><strong>Large repos (50,000+ lines).</strong> The discovery overhead scales with codebase size. On small projects, grep is fast enough that the MCP overhead isn&rsquo;t worth it.</p>
<p><strong>Call chain analysis.</strong> Before refactoring a function, you need to know every caller. CodeGraph&rsquo;s <code>codegraph_call_graph</code> returns the full chain in one call. I use this constantly for impact analysis.</p>
<p><strong>Route and handler discovery.</strong> In web frameworks, finding which handler maps to which route usually requires scanning router files. CodeGraph&rsquo;s <code>codegraph_route_search</code> handles this directly.</p>
<p><strong>Onboarding to unfamiliar code.</strong> When I join a new project or revisit one I haven&rsquo;t touched in months, CodeGraph answers &ldquo;what does this module export?&rdquo; and &ldquo;what depends on this interface?&rdquo; without me or the agent reading every file.</p>
<p><strong>Test-target selection.</strong> Before running tests, I ask CodeGraph which test files exercise a changed function. It&rsquo;s faster than grep for <code>describe</code> blocks and <code>it</code> strings.</p>
<h2 id="when-codegraph-is-not-worth-the-overhead">When CodeGraph Is Not Worth the Overhead</h2>
<p>Be honest about the cases where CodeGraph adds more friction than value:</p>
<ul>
<li><strong>Small repos under 10,000 lines.</strong> The <code>codegraph init</code> step takes longer than the time you&rsquo;d save.</li>
<li><strong>Throwaway prototypes.</strong> If the repo won&rsquo;t exist next week, don&rsquo;t bother.</li>
<li><strong>Single-file fixes.</strong> You don&rsquo;t need a code graph to edit one file.</li>
<li><strong>Unsupported languages.</strong> CodeGraph supports the major languages (TypeScript, Python, Go, Rust, Java, etc.) but if your project is heavy on a niche language, check the tree-sitter grammar list first.</li>
<li><strong>Teams that can&rsquo;t maintain agent config.</strong> If your team doesn&rsquo;t keep <code>CLAUDE.md</code> or <code>.cursorrules</code> up to date, they won&rsquo;t maintain CodeGraph either. The tool is only as good as the discipline around it.</li>
</ul>
<h2 id="install-codegraph-and-register-it-with-claude-code-and-cursor">Install CodeGraph and Register It With Claude Code and Cursor</h2>
<p>The install process is one command, but I&rsquo;ll walk through what actually happens so you can debug it if something goes wrong.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>npx @colbymchenry/codegraph install
</span></span></code></pre></div><p>This does three things:</p>
<ol>
<li>Downloads the platform-specific binary (macOS/Linux/Windows, x64/arm64) to a cache directory.</li>
<li>Detects which MCP-compatible agents you have installed by checking for their config files.</li>
<li>Registers the CodeGraph MCP server in each agent&rsquo;s config.</li>
</ol>
<p>For <strong>Claude Code</strong>, it adds an entry to <code>~/.claude/settings.json</code>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&#34;mcpServers&#34;</span>: {
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&#34;codegraph&#34;</span>: {
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">&#34;command&#34;</span>: <span style="color:#e6db74">&#34;codegraph&#34;</span>,
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">&#34;args&#34;</span>: [<span style="color:#e6db74">&#34;mcp&#34;</span>]
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>  }
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><p>For <strong>Cursor</strong>, it adds to <code>~/.cursor/mcp.json</code>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&#34;mcpServers&#34;</span>: {
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&#34;codegraph&#34;</span>: {
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">&#34;command&#34;</span>: <span style="color:#e6db74">&#34;codegraph&#34;</span>,
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">&#34;args&#34;</span>: [<span style="color:#e6db74">&#34;mcp&#34;</span>]
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>  }
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><p>After install, restart your agent. Claude Code needs a full restart. Cursor needs a window reload (Cmd+Shift+P → &ldquo;Developer: Reload Window&rdquo;).</p>
<p>If you&rsquo;re on an older Claude Code version (pre-v2.x), check the <a href="https://github.com/colbymchenry/codegraph/releases">CodeGraph release notes</a> for compatibility. The MCP protocol has had breaking changes, and mismatched versions cause silent failures.</p>
<h2 id="initialize-a-project-and-confirm-the-index-is-working">Initialize a Project and Confirm the Index Is Working</h2>
<p>Navigate to your project and run:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>codegraph init
</span></span></code></pre></div><p>This scans all source files, builds the tree-sitter ASTs, populates the SQLite database, and starts the file watcher. On a 100,000-line TypeScript project, this takes about 30-60 seconds. On a million-line monorepo, closer to 5 minutes.</p>
<p>After init, you should see a <code>.codegraph/</code> directory at your project root. Inside it:</p>



<div class="goat svg-container ">
  
    <svg
      xmlns="http://www.w3.org/2000/svg"
      font-family="Menlo,Lucida Console,monospace"
      
        viewBox="0 0 496 57"
      >
      <g transform='translate(8,16)'>
<text text-anchor='middle' x='0' y='4' fill='currentColor' style='font-size:1em'>.</text>
<text text-anchor='middle' x='8' y='4' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='16' y='4' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='16' y='20' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='16' y='36' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='24' y='4' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='24' y='20' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='24' y='36' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='32' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='32' y='20' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='32' y='36' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='40' y='4' fill='currentColor' style='font-size:1em'>g</text>
<text text-anchor='middle' x='40' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='40' y='36' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='48' y='4' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='48' y='20' fill='currentColor' style='font-size:1em'>g</text>
<text text-anchor='middle' x='48' y='36' fill='currentColor' style='font-size:1em'>g</text>
<text text-anchor='middle' x='56' y='4' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='56' y='20' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='56' y='36' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='64' y='4' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='64' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='64' y='36' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='72' y='4' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='72' y='20' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='72' y='36' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='80' y='4' fill='currentColor' style='font-size:1em'>/</text>
<text text-anchor='middle' x='80' y='20' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='80' y='36' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='88' y='20' fill='currentColor' style='font-size:1em'>.</text>
<text text-anchor='middle' x='88' y='36' fill='currentColor' style='font-size:1em'>.</text>
<text text-anchor='middle' x='96' y='20' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='96' y='36' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='104' y='20' fill='currentColor' style='font-size:1em'>b</text>
<text text-anchor='middle' x='104' y='36' fill='currentColor' style='font-size:1em'>b</text>
<text text-anchor='middle' x='112' y='36' fill='currentColor' style='font-size:1em'>.</text>
<text text-anchor='middle' x='120' y='36' fill='currentColor' style='font-size:1em'>w</text>
<text text-anchor='middle' x='128' y='36' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='136' y='36' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='168' y='20' fill='currentColor' style='font-size:1em'>#</text>
<text text-anchor='middle' x='168' y='36' fill='currentColor' style='font-size:1em'>#</text>
<text text-anchor='middle' x='184' y='20' fill='currentColor' style='font-size:1em'>S</text>
<text text-anchor='middle' x='184' y='36' fill='currentColor' style='font-size:1em'>S</text>
<text text-anchor='middle' x='192' y='20' fill='currentColor' style='font-size:1em'>Q</text>
<text text-anchor='middle' x='192' y='36' fill='currentColor' style='font-size:1em'>Q</text>
<text text-anchor='middle' x='200' y='20' fill='currentColor' style='font-size:1em'>L</text>
<text text-anchor='middle' x='200' y='36' fill='currentColor' style='font-size:1em'>L</text>
<text text-anchor='middle' x='208' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='208' y='36' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='216' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='216' y='36' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='224' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='224' y='36' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='240' y='20' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='240' y='36' fill='currentColor' style='font-size:1em'>W</text>
<text text-anchor='middle' x='248' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='248' y='36' fill='currentColor' style='font-size:1em'>A</text>
<text text-anchor='middle' x='256' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='256' y='36' fill='currentColor' style='font-size:1em'>L</text>
<text text-anchor='middle' x='264' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='272' y='20' fill='currentColor' style='font-size:1em'>b</text>
<text text-anchor='middle' x='272' y='36' fill='currentColor' style='font-size:1em'>f</text>
<text text-anchor='middle' x='280' y='20' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='280' y='36' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='288' y='20' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='288' y='36' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='296' y='20' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='296' y='36' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='312' y='20' fill='currentColor' style='font-size:1em'>w</text>
<text text-anchor='middle' x='312' y='36' fill='currentColor' style='font-size:1em'>(</text>
<text text-anchor='middle' x='320' y='20' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='320' y='36' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='328' y='20' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='328' y='36' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='336' y='20' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='336' y='36' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='344' y='36' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='352' y='20' fill='currentColor' style='font-size:1em'>F</text>
<text text-anchor='middle' x='352' y='36' fill='currentColor' style='font-size:1em'>v</text>
<text text-anchor='middle' x='360' y='20' fill='currentColor' style='font-size:1em'>T</text>
<text text-anchor='middle' x='360' y='36' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='368' y='20' fill='currentColor' style='font-size:1em'>S</text>
<text text-anchor='middle' x='376' y='20' fill='currentColor' style='font-size:1em'>5</text>
<text text-anchor='middle' x='376' y='36' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='384' y='36' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='392' y='36' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='400' y='36' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='408' y='36' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='416' y='36' fill='currentColor' style='font-size:1em'>g</text>
<text text-anchor='middle' x='432' y='36' fill='currentColor' style='font-size:1em'>w</text>
<text text-anchor='middle' x='440' y='36' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='448' y='36' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='456' y='36' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='464' y='36' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='472' y='36' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='480' y='36' fill='currentColor' style='font-size:1em'>)</text>
</g>

    </svg>
  
</div>
<p>To confirm the index is working, run:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>codegraph explore <span style="color:#e6db74">&#34;find all functions that call authenticateUser&#34;</span>
</span></span></code></pre></div><p>If you get a structured result with function names and file locations, the index is live. If you get an error, check that <code>.codegraph/codegraph.db</code> exists and has a non-trivial file size.</p>
<h2 id="claude-code-workflow-prompts-permissions-and-tool-call-patterns">Claude Code Workflow: Prompts, Permissions, and Tool-Call Patterns</h2>
<p>Once CodeGraph is registered, Claude Code automatically discovers the MCP tools. You don&rsquo;t need to enable anything manually. The key workflow change is in how you prompt.</p>
<p>Instead of:</p>
<blockquote>
<p>&ldquo;Find all the places that call <code>validateInput</code> and tell me what they do with the result.&rdquo;</p></blockquote>
<p>Try:</p>
<blockquote>
<p>&ldquo;Use codegraph to find all callers of <code>validateInput</code>, then read the caller functions and summarize the error handling patterns.&rdquo;</p></blockquote>
<p>The first prompt makes Claude Code fall back to grep and read. The second explicitly directs it to use the MCP tool, which is faster and more complete.</p>
<p>I&rsquo;ve found it useful to add a note to <code>CLAUDE.md</code>:</p>



<div class="goat svg-container ">
  
    <svg
      xmlns="http://www.w3.org/2000/svg"
      font-family="Menlo,Lucida Console,monospace"
      
        viewBox="0 0 728 89"
      >
      <g transform='translate(8,16)'>
<text text-anchor='middle' x='0' y='4' fill='currentColor' style='font-size:1em'>#</text>
<text text-anchor='middle' x='0' y='36' fill='currentColor' style='font-size:1em'>-</text>
<text text-anchor='middle' x='0' y='52' fill='currentColor' style='font-size:1em'>-</text>
<text text-anchor='middle' x='0' y='68' fill='currentColor' style='font-size:1em'>-</text>
<text text-anchor='middle' x='8' y='4' fill='currentColor' style='font-size:1em'>#</text>
<text text-anchor='middle' x='16' y='36' fill='currentColor' style='font-size:1em'>U</text>
<text text-anchor='middle' x='16' y='52' fill='currentColor' style='font-size:1em'>U</text>
<text text-anchor='middle' x='16' y='68' fill='currentColor' style='font-size:1em'>A</text>
<text text-anchor='middle' x='24' y='4' fill='currentColor' style='font-size:1em'>C</text>
<text text-anchor='middle' x='24' y='36' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='24' y='52' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='24' y='68' fill='currentColor' style='font-size:1em'>f</text>
<text text-anchor='middle' x='32' y='4' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='32' y='36' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='32' y='52' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='32' y='68' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='40' y='4' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='40' y='68' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='48' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='48' y='36' fill='currentColor' style='font-size:1em'>`</text>
<text text-anchor='middle' x='48' y='52' fill='currentColor' style='font-size:1em'>`</text>
<text text-anchor='middle' x='48' y='68' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='56' y='4' fill='currentColor' style='font-size:1em'>G</text>
<text text-anchor='middle' x='56' y='36' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='56' y='52' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='64' y='4' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='64' y='36' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='64' y='52' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='64' y='68' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='72' y='4' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='72' y='36' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='72' y='52' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='72' y='68' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='80' y='4' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='80' y='36' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='80' y='52' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='80' y='68' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='88' y='4' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='88' y='36' fill='currentColor' style='font-size:1em'>g</text>
<text text-anchor='middle' x='88' y='52' fill='currentColor' style='font-size:1em'>g</text>
<text text-anchor='middle' x='88' y='68' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='96' y='36' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='96' y='52' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='96' y='68' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='104' y='36' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='104' y='52' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='104' y='68' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='112' y='36' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='112' y='52' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='112' y='68' fill='currentColor' style='font-size:1em'>g</text>
<text text-anchor='middle' x='120' y='36' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='120' y='52' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='120' y='68' fill='currentColor' style='font-size:1em'>,</text>
<text text-anchor='middle' x='128' y='36' fill='currentColor' style='font-size:1em'>_</text>
<text text-anchor='middle' x='128' y='52' fill='currentColor' style='font-size:1em'>_</text>
<text text-anchor='middle' x='136' y='36' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='136' y='52' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='136' y='68' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='144' y='36' fill='currentColor' style='font-size:1em'>x</text>
<text text-anchor='middle' x='144' y='52' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='144' y='68' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='152' y='36' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='152' y='52' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='152' y='68' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='160' y='36' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='160' y='52' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='160' y='68' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='168' y='36' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='168' y='52' fill='currentColor' style='font-size:1em'>_</text>
<text text-anchor='middle' x='168' y='68' fill='currentColor' style='font-size:1em'>k</text>
<text text-anchor='middle' x='176' y='36' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='176' y='52' fill='currentColor' style='font-size:1em'>g</text>
<text text-anchor='middle' x='184' y='36' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='184' y='52' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='184' y='68' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='192' y='36' fill='currentColor' style='font-size:1em'>`</text>
<text text-anchor='middle' x='192' y='52' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='192' y='68' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='200' y='52' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='200' y='68' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='208' y='36' fill='currentColor' style='font-size:1em'>f</text>
<text text-anchor='middle' x='208' y='52' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='216' y='36' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='216' y='52' fill='currentColor' style='font-size:1em'>`</text>
<text text-anchor='middle' x='216' y='68' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='224' y='36' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='224' y='68' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='232' y='52' fill='currentColor' style='font-size:1em'>b</text>
<text text-anchor='middle' x='232' y='68' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='240' y='36' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='240' y='52' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='240' y='68' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='248' y='36' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='248' y='52' fill='currentColor' style='font-size:1em'>f</text>
<text text-anchor='middle' x='248' y='68' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='256' y='36' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='256' y='52' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='256' y='68' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='264' y='36' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='264' y='52' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='264' y='68' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='272' y='36' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='272' y='52' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='272' y='68' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='280' y='36' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='280' y='68' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='288' y='36' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='288' y='52' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='296' y='36' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='296' y='52' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='296' y='68' fill='currentColor' style='font-size:1em'>b</text>
<text text-anchor='middle' x='304' y='36' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='304' y='52' fill='currentColor' style='font-size:1em'>f</text>
<text text-anchor='middle' x='304' y='68' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='312' y='36' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='312' y='52' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='312' y='68' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='320' y='36' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='320' y='52' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='320' y='68' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='328' y='36' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='328' y='52' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='328' y='68' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='336' y='36' fill='currentColor' style='font-size:1em'>,</text>
<text text-anchor='middle' x='336' y='52' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='336' y='68' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='344' y='52' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='352' y='36' fill='currentColor' style='font-size:1em'>f</text>
<text text-anchor='middle' x='352' y='52' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='352' y='68' fill='currentColor' style='font-size:1em'>—</text>
<text text-anchor='middle' x='360' y='36' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='360' y='52' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='368' y='36' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='368' y='52' fill='currentColor' style='font-size:1em'>g</text>
<text text-anchor='middle' x='368' y='68' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='376' y='36' fill='currentColor' style='font-size:1em'>w</text>
<text text-anchor='middle' x='376' y='68' fill='currentColor' style='font-size:1em'>f</text>
<text text-anchor='middle' x='384' y='36' fill='currentColor' style='font-size:1em'>,</text>
<text text-anchor='middle' x='384' y='52' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='392' y='52' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='392' y='68' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='400' y='36' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='400' y='52' fill='currentColor' style='font-size:1em'>y</text>
<text text-anchor='middle' x='400' y='68' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='408' y='36' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='408' y='68' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='416' y='36' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='416' y='52' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='424' y='52' fill='currentColor' style='font-size:1em'>x</text>
<text text-anchor='middle' x='424' y='68' fill='currentColor' style='font-size:1em'>g</text>
<text text-anchor='middle' x='432' y='36' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='432' y='52' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='432' y='68' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='440' y='36' fill='currentColor' style='font-size:1em'>m</text>
<text text-anchor='middle' x='440' y='52' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='440' y='68' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='448' y='36' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='448' y='52' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='448' y='68' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='456' y='36' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='456' y='52' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='456' y='68' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='464' y='36' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='464' y='52' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='472' y='36' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='472' y='52' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='472' y='68' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='480' y='68' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='488' y='36' fill='currentColor' style='font-size:1em'>q</text>
<text text-anchor='middle' x='488' y='52' fill='currentColor' style='font-size:1em'>f</text>
<text text-anchor='middle' x='496' y='36' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='496' y='52' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='496' y='68' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='504' y='36' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='504' y='52' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='504' y='68' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='512' y='36' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='512' y='52' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='512' y='68' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='520' y='36' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='520' y='52' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='520' y='68' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='528' y='36' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='528' y='52' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='528' y='68' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='536' y='36' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='536' y='52' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='536' y='68' fill='currentColor' style='font-size:1em'>,</text>
<text text-anchor='middle' x='544' y='36' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='544' y='52' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='552' y='36' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='552' y='52' fill='currentColor' style='font-size:1em'>.</text>
<text text-anchor='middle' x='552' y='68' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='560' y='36' fill='currentColor' style='font-size:1em'>.</text>
<text text-anchor='middle' x='560' y='68' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='568' y='68' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='584' y='68' fill='currentColor' style='font-size:1em'>`</text>
<text text-anchor='middle' x='592' y='68' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='600' y='68' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='608' y='68' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='616' y='68' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='624' y='68' fill='currentColor' style='font-size:1em'>g</text>
<text text-anchor='middle' x='632' y='68' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='640' y='68' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='648' y='68' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='656' y='68' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='672' y='68' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='680' y='68' fill='currentColor' style='font-size:1em'>y</text>
<text text-anchor='middle' x='688' y='68' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='696' y='68' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='704' y='68' fill='currentColor' style='font-size:1em'>`</text>
<text text-anchor='middle' x='712' y='68' fill='currentColor' style='font-size:1em'>.</text>
</g>

    </svg>
  
</div>
<p>Claude Code respects <code>CLAUDE.md</code> instructions and will reach for CodeGraph tools more consistently with this guidance.</p>
<p>One thing to watch: Claude Code may ask for permission before running MCP tools depending on your auto-allow settings. If you&rsquo;re in a long session, the repeated permission prompts get annoying. I configure auto-allow for the <code>codegraph_*</code> tools in <code>~/.claude/settings.json</code>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&#34;mcpServers&#34;</span>: {
</span></span><span style="display:flex;"><span>    <span style="color:#f92672">&#34;codegraph&#34;</span>: {
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">&#34;command&#34;</span>: <span style="color:#e6db74">&#34;codegraph&#34;</span>,
</span></span><span style="display:flex;"><span>      <span style="color:#f92672">&#34;args&#34;</span>: [<span style="color:#e6db74">&#34;mcp&#34;</span>]
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>  },
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&#34;autoAllowTools&#34;</span>: [<span style="color:#e6db74">&#34;codegraph_explore&#34;</span>, <span style="color:#e6db74">&#34;codegraph_symbol_search&#34;</span>, <span style="color:#e6db74">&#34;codegraph_call_graph&#34;</span>, <span style="color:#e6db74">&#34;codegraph_route_search&#34;</span>]
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><h2 id="cursor-workflow-mcp-registration-agent-rules-and-practical-queries">Cursor Workflow: MCP Registration, Agent Rules, and Practical Queries</h2>
<p>Cursor&rsquo;s MCP support works slightly differently. After <code>codegraph install</code>, the server is registered in <code>~/.cursor/mcp.json</code>. Cursor&rsquo;s agent (Composer or the chat agent) discovers the tools automatically.</p>
<p>The main difference from Claude Code: Cursor doesn&rsquo;t have a <code>CLAUDE.md</code> equivalent that the agent reads as system context. Instead, you add rules in <code>.cursorrules</code> or through Cursor&rsquo;s Settings → Rules for AI. I add:</p>



<div class="goat svg-container ">
  
    <svg
      xmlns="http://www.w3.org/2000/svg"
      font-family="Menlo,Lucida Console,monospace"
      
        viewBox="0 0 1400 25"
      >
      <g transform='translate(8,16)'>
<circle cx='1208' cy='0' r='6' stroke='currentColor' fill='#fff'></circle>
<text text-anchor='middle' x='0' y='4' fill='currentColor' style='font-size:1em'>U</text>
<text text-anchor='middle' x='8' y='4' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='16' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='32' y='4' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='40' y='4' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='48' y='4' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='56' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='64' y='4' fill='currentColor' style='font-size:1em'>g</text>
<text text-anchor='middle' x='72' y='4' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='80' y='4' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='88' y='4' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='96' y='4' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='104' y='4' fill='currentColor' style='font-size:1em'>_</text>
<text text-anchor='middle' x='112' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='120' y='4' fill='currentColor' style='font-size:1em'>x</text>
<text text-anchor='middle' x='128' y='4' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='136' y='4' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='144' y='4' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='152' y='4' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='160' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='176' y='4' fill='currentColor' style='font-size:1em'>f</text>
<text text-anchor='middle' x='184' y='4' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='192' y='4' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='208' y='4' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='216' y='4' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='224' y='4' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='232' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='240' y='4' fill='currentColor' style='font-size:1em'>b</text>
<text text-anchor='middle' x='248' y='4' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='256' y='4' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='264' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='280' y='4' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='288' y='4' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='296' y='4' fill='currentColor' style='font-size:1em'>v</text>
<text text-anchor='middle' x='304' y='4' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='312' y='4' fill='currentColor' style='font-size:1em'>g</text>
<text text-anchor='middle' x='320' y='4' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='328' y='4' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='336' y='4' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='344' y='4' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='352' y='4' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='368' y='4' fill='currentColor' style='font-size:1em'>q</text>
<text text-anchor='middle' x='376' y='4' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='384' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='392' y='4' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='400' y='4' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='408' y='4' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='416' y='4' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='424' y='4' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='432' y='4' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='440' y='4' fill='currentColor' style='font-size:1em'>.</text>
<text text-anchor='middle' x='456' y='4' fill='currentColor' style='font-size:1em'>W</text>
<text text-anchor='middle' x='464' y='4' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='472' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='480' y='4' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='496' y='4' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='504' y='4' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='512' y='4' fill='currentColor' style='font-size:1em'>k</text>
<text text-anchor='middle' x='520' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='528' y='4' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='544' y='4' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='552' y='4' fill='currentColor' style='font-size:1em'>b</text>
<text text-anchor='middle' x='560' y='4' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='568' y='4' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='576' y='4' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='592' y='4' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='600' y='4' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='608' y='4' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='616' y='4' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='624' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='632' y='4' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='640' y='4' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='648' y='4' fill='currentColor' style='font-size:1em'>,</text>
<text text-anchor='middle' x='664' y='4' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='672' y='4' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='680' y='4' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='688' y='4' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='696' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='704' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='712' y='4' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='720' y='4' fill='currentColor' style='font-size:1em'>,</text>
<text text-anchor='middle' x='736' y='4' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='744' y='4' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='760' y='4' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='768' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='776' y='4' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='784' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='792' y='4' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='800' y='4' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='808' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='816' y='4' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='824' y='4' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='832' y='4' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='840' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='848' y='4' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='864' y='4' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='872' y='4' fill='currentColor' style='font-size:1em'>f</text>
<text text-anchor='middle' x='888' y='4' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='904' y='4' fill='currentColor' style='font-size:1em'>f</text>
<text text-anchor='middle' x='912' y='4' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='920' y='4' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='928' y='4' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='936' y='4' fill='currentColor' style='font-size:1em'>t</text>
<text text-anchor='middle' x='944' y='4' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='952' y='4' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='960' y='4' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='968' y='4' fill='currentColor' style='font-size:1em'>,</text>
<text text-anchor='middle' x='984' y='4' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='992' y='4' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='1000' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='1008' y='4' fill='currentColor' style='font-size:1em'>f</text>
<text text-anchor='middle' x='1016' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='1024' y='4' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='1040' y='4' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='1048' y='4' fill='currentColor' style='font-size:1em'>o</text>
<text text-anchor='middle' x='1056' y='4' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='1064' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='1072' y='4' fill='currentColor' style='font-size:1em'>g</text>
<text text-anchor='middle' x='1080' y='4' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='1088' y='4' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='1096' y='4' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='1104' y='4' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='1112' y='4' fill='currentColor' style='font-size:1em'>_</text>
<text text-anchor='middle' x='1120' y='4' fill='currentColor' style='font-size:1em'>c</text>
<text text-anchor='middle' x='1128' y='4' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='1136' y='4' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='1144' y='4' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='1152' y='4' fill='currentColor' style='font-size:1em'>_</text>
<text text-anchor='middle' x='1160' y='4' fill='currentColor' style='font-size:1em'>g</text>
<text text-anchor='middle' x='1168' y='4' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='1176' y='4' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='1184' y='4' fill='currentColor' style='font-size:1em'>p</text>
<text text-anchor='middle' x='1192' y='4' fill='currentColor' style='font-size:1em'>h</text>
<text text-anchor='middle' x='1216' y='4' fill='currentColor' style='font-size:1em'>v</text>
<text text-anchor='middle' x='1224' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='1232' y='4' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='1248' y='4' fill='currentColor' style='font-size:1em'>m</text>
<text text-anchor='middle' x='1256' y='4' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='1264' y='4' fill='currentColor' style='font-size:1em'>n</text>
<text text-anchor='middle' x='1272' y='4' fill='currentColor' style='font-size:1em'>u</text>
<text text-anchor='middle' x='1280' y='4' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='1288' y='4' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='1304' y='4' fill='currentColor' style='font-size:1em'>f</text>
<text text-anchor='middle' x='1312' y='4' fill='currentColor' style='font-size:1em'>i</text>
<text text-anchor='middle' x='1320' y='4' fill='currentColor' style='font-size:1em'>l</text>
<text text-anchor='middle' x='1328' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='1344' y='4' fill='currentColor' style='font-size:1em'>r</text>
<text text-anchor='middle' x='1352' y='4' fill='currentColor' style='font-size:1em'>e</text>
<text text-anchor='middle' x='1360' y='4' fill='currentColor' style='font-size:1em'>a</text>
<text text-anchor='middle' x='1368' y='4' fill='currentColor' style='font-size:1em'>d</text>
<text text-anchor='middle' x='1376' y='4' fill='currentColor' style='font-size:1em'>s</text>
<text text-anchor='middle' x='1384' y='4' fill='currentColor' style='font-size:1em'>.</text>
</g>

    </svg>
  
</div>
<p>Cursor&rsquo;s agent tends to be more aggressive about using its built-in codebase indexing (which is quite good in Cursor 2026). CodeGraph adds value specifically for call graph analysis and cross-file dependency tracing, where Cursor&rsquo;s built-in index is weaker.</p>
<p>For practical queries in Cursor, I use the chat panel:</p>
<blockquote>
<p>&ldquo;codegraph: show me the route handlers that depend on the auth middleware&rdquo;</p></blockquote>
<p>The &ldquo;codegraph:&rdquo; prefix isn&rsquo;t required — the agent routes to the MCP tool based on the query content — but I&rsquo;ve found it helps the agent choose the right tool faster.</p>
<h2 id="using-codegraph_explore-questions-that-work-better-than-grep">Using <code>codegraph_explore</code>: Questions That Work Better Than Grep</h2>
<p>The <code>codegraph_explore</code> tool accepts natural language queries and returns structured results. Here are the questions I&rsquo;ve found most effective:</p>
<ul>
<li>&ldquo;What functions does this module export?&rdquo; — Returns the public API surface.</li>
<li>&ldquo;Who calls <code>sendEmail</code>?&rdquo; — Returns every call site with file and line number.</li>
<li>&ldquo;Show me the inheritance chain of <code>BaseController</code>.&rdquo; — Returns the class hierarchy.</li>
<li>&ldquo;What routes are defined in the admin module?&rdquo; — Returns route-to-handler mappings.</li>
<li>&ldquo;Find all files that import from <code>@shared/utils</code>.&rdquo; — Returns import dependency graph.</li>
</ul>
<p>Compare this to grep: <code>grep -r &quot;sendEmail&quot; src/</code> returns every line that mentions the string, including comments, variable names, and false positives. CodeGraph returns only actual call sites because it parsed the AST.</p>
<h2 id="measuring-the-roi-tool-calls-file-reads-first-edit-time-and-missed-impact">Measuring the ROI: Tool Calls, File Reads, First-Edit Time, and Missed Impact</h2>
<p>The published benchmarks — 70% fewer tool calls, 59% lower tokens, 49% faster response — are median results across seven benchmark repos. Your mileage will vary. Here&rsquo;s how to measure it for your own team:</p>
<ol>
<li><strong>Pick one workflow.</strong> Don&rsquo;t try to measure everything at once. Pick a common task: adding a new API endpoint, refactoring a shared utility, or updating a database migration.</li>
<li><strong>Run it without CodeGraph.</strong> Count tool calls, file reads, and time to first edit. Record whether the agent missed any call sites.</li>
<li><strong>Run the same task with CodeGraph.</strong> Use the same prompt. Count the same metrics.</li>
<li><strong>Compare.</strong> The difference in tool calls before the first edit is the most reliable signal. File reads before first edit is a close second.</li>
</ol>
<p>I ran this on a NestJS API project (80,000 lines, 400+ files). Adding a new endpoint that touched the controller, service, and repository layers went from 18 tool calls and 12 file reads without CodeGraph to 4 tool calls and 3 file reads with it. The agent also caught a dependency I would have missed — a middleware that needed updating — because <code>codegraph_call_graph</code> returned the full chain.</p>
<p>The less obvious metric: <strong>missed-impact incidents.</strong> Before CodeGraph, I&rsquo;d occasionally get a review comment saying &ldquo;you also need to update the X handler.&rdquo; After CodeGraph, those comments dropped to near zero because the agent had the full call graph.</p>
<h2 id="keeping-the-graph-fresh-auto-sync-manual-sync-staleness-banners-and-ci-options">Keeping the Graph Fresh: Auto-Sync, Manual Sync, Staleness Banners, and CI Options</h2>
<p>CodeGraph&rsquo;s auto-sync handles the common case: you edit a file, save it, and within 2-3 seconds the graph updates. But there are edge cases:</p>
<ul>
<li><strong>Branch switches.</strong> If you <code>git checkout</code> to a different branch, the file watcher may not catch all the changes. Run <code>codegraph sync</code> after switching branches.</li>
<li><strong>Large rebases.</strong> After a rebase that touches hundreds of files, the incremental sync can lag. Run <code>codegraph sync --force</code> to rebuild from scratch.</li>
<li><strong>CI environments.</strong> If you want CodeGraph available in CI (for automated impact analysis or test selection), you can run <code>codegraph init</code> as part of your build. The <code>.codegraph/</code> directory is developer-local by default — don&rsquo;t commit it to git. Add it to <code>.gitignore</code>.</li>
</ul>
<p>The agent shows a staleness banner when the graph is out of date. If you see it, run <code>codegraph sync</code> before continuing. The banner is conservative — it shows up after any file change, even if the change doesn&rsquo;t affect the indexed symbols. I&rsquo;ve learned to trust it.</p>
<h2 id="security-and-governance-local-indexes-agent-config-files-and-supply-chain-review">Security and Governance: Local Indexes, Agent Config Files, and Supply Chain Review</h2>
<p>CodeGraph is local-first, which is good for security. The index never leaves your machine. But there are governance considerations:</p>
<ul>
<li><strong>MCP server supply chain.</strong> CodeGraph&rsquo;s MCP server is a binary downloaded by npm. The npm package is <code>@colbymchenry/codegraph</code> and the binary is platform-specific. If your organization requires signed binaries or approved package registries, this needs review.</li>
<li><strong>Agent config files.</strong> <code>codegraph install</code> modifies <code>~/.claude/settings.json</code> and <code>~/.cursor/mcp.json</code>. These files control what MCP servers your agent can launch. Review the changes before accepting them — the same mechanism that loads CodeGraph can load any MCP server.</li>
<li><strong>Auto-allow permissions.</strong> If you configure auto-allow for <code>codegraph_*</code> tools, understand that you&rsquo;re giving the agent permission to run arbitrary MCP tools. The risk is low for CodeGraph specifically (it only reads files), but the pattern matters for security posture.</li>
<li><strong><code>.codegraph/</code> in shared environments.</strong> If you use shared development servers or dev containers, the <code>.codegraph/</code> directory is per-user. Don&rsquo;t share it across users — the SQLite database contains file paths and symbol names that are workspace-specific.</li>
</ul>
<p>For enterprise teams, I recommend treating CodeGraph like any other developer tool dependency: add it to your approved tool list, review the MCP server configuration, and include it in your onboarding documentation. The <a href="/posts/agent-skills-supply-chain-security-guide-2026/">agent skills supply chain security guide</a> covers this in more detail.</p>
<h2 id="team-adoption-playbook-start-with-one-repo-and-one-workflow">Team Adoption Playbook: Start With One Repo and One Workflow</h2>
<p>If you&rsquo;re bringing CodeGraph to a team, don&rsquo;t roll it out as a mandate. Here&rsquo;s what worked for me:</p>
<ol>
<li><strong>Pick one repo.</strong> Choose the largest, most complex codebase your team owns. The ROI is highest there.</li>
<li><strong>Pick one workflow.</strong> Route changes, SDK API updates, or refactoring — whichever your team does most often.</li>
<li><strong>Install and init for one developer.</strong> Let them run it for a week and report back on tool call counts and missed-impact catches.</li>
<li><strong>Share the measurement.</strong> Show the before/after numbers. Developers care about concrete metrics, not &ldquo;it&rsquo;s faster.&rdquo;</li>
<li><strong>Add to onboarding docs.</strong> Include the install, init, and <code>CLAUDE.md</code> / <code>.cursorrules</code> snippets in your team&rsquo;s onboarding guide.</li>
</ol>
<p>The developers who resist are usually the ones working on small, focused changes. They&rsquo;re right — CodeGraph doesn&rsquo;t help them much. The developers who adopt it are the ones doing cross-cutting refactors, impact analysis, and large feature work.</p>
<h2 id="troubleshooting-common-codegraph-setup-problems">Troubleshooting Common CodeGraph Setup Problems</h2>
<p><strong>&ldquo;codegraph: command not found&rdquo; after install.</strong> The installer adds the npm global bin to your PATH, but you may need to restart your shell or source your profile. Run <code>npx @colbymchenry/codegraph install</code> again — it&rsquo;s idempotent.</p>
<p><strong>MCP tools not showing up in Claude Code.</strong> Check <code>~/.claude/settings.json</code> for the codegraph entry. If it&rsquo;s missing, run <code>codegraph install</code> again. If it&rsquo;s present but tools don&rsquo;t appear, restart Claude Code completely.</p>
<p><strong>MCP tools not showing up in Cursor.</strong> Check <code>~/.cursor/mcp.json</code>. If the entry is there, reload the window. If tools still don&rsquo;t appear, check Cursor&rsquo;s MCP logs in Help → Toggle Developer Tools → Console.</p>
<p><strong>&ldquo;codegraph init&rdquo; is slow on large repos.</strong> This is expected. The first init parses every source file. Subsequent inits are incremental. If you need to speed it up, exclude directories you don&rsquo;t need indexed (node_modules, build output, generated code) — CodeGraph respects <code>.gitignore</code> by default.</p>
<p><strong>Auto-sync not catching changes.</strong> Check that the file watcher is running. <code>codegraph status</code> shows whether the watcher is active. If it&rsquo;s not, restart it with <code>codegraph watch</code>.</p>
<h2 id="faq-codegraph-for-claude-code-and-cursor-in-2026">FAQ: CodeGraph for Claude Code and Cursor in 2026</h2>
<p><strong>Does CodeGraph work with Claude Code v2.x?</strong> Yes. The MCP protocol is stable in v2.x. If you&rsquo;re on an older version, check the release notes.</p>
<p><strong>Does CodeGraph work with Cursor&rsquo;s Composer?</strong> Yes. Composer discovers MCP tools the same way the chat agent does.</p>
<p><strong>Can I use CodeGraph without MCP?</strong> No. MCP is the only transport. If your agent doesn&rsquo;t support MCP, CodeGraph won&rsquo;t work.</p>
<p><strong>Does CodeGraph send my code anywhere?</strong> No. Everything is local. The SQLite database stays on your machine. The MCP server runs as a local subprocess.</p>
<p><strong>Should I commit <code>.codegraph/</code> to git?</strong> No. Add it to <code>.gitignore</code>. It&rsquo;s a developer-local cache. Each developer should run <code>codegraph init</code> after cloning.</p>
<p><strong>How much disk space does the index use?</strong> On a 200,000-line TypeScript project, about 15-20 MB. The SQLite database is compact.</p>
<p><strong>Does CodeGraph support monorepos?</strong> Yes. Run <code>codegraph init</code> at the monorepo root. It indexes all packages. You can also run it per-package if you want separate indexes.</p>
<p><strong>What happens when I switch branches?</strong> The auto-sync catches file changes, but after a large branch switch, run <code>codegraph sync</code> to be safe.</p>
<p>CodeGraph isn&rsquo;t a magic bullet. It won&rsquo;t make your agent write better code or catch every edge case. What it does is eliminate the discovery tax — the wasted tool calls and file reads that agents burn just figuring out where things are. For anyone working on a codebase large enough that grep feels slow, that&rsquo;s a meaningful improvement.</p>
]]></content:encoded></item><item><title>AI Coding Agent Code Index MCP Comparison 2026: Sourcegraph, CodeGraph, Claude Context, and CocoIndex Code</title><link>https://baeseokjae.github.io/posts/ai-coding-agent-code-index-mcp-comparison-2026/</link><pubDate>Mon, 06 Jul 2026 10:00:00 +0000</pubDate><guid>https://baeseokjae.github.io/posts/ai-coding-agent-code-index-mcp-comparison-2026/</guid><description>A practical comparison of four code index MCP servers for AI coding agents in 2026 — Sourcegraph, CodeGraph, Claude Context, and CocoIndex Code. When to use each, and why the transport layer is the least interesting part.</description><content:encoded><![CDATA[<p>By mid-2026, every serious AI coding agent can read your files, search your codebase, and navigate your project structure. The problem isn&rsquo;t access — it&rsquo;s that agents spend 40-60% of their tool calls just <em>finding</em> the right code before they can do anything useful with it. I&rsquo;ve watched Claude Code burn through 15-20 <code>grep</code> and <code>read</code> calls just to understand a single function&rsquo;s callers and callees. That&rsquo;s where code index MCP servers come in: they pre-build a structured or semantic map of your codebase so the agent can ask &ldquo;what calls this function?&rdquo; in one call instead of ten.</p>
<p>The catch is that &ldquo;code index&rdquo; means very different things depending on which tool you pick. This article compares the four main options in 2026 — Sourcegraph, CodeGraph, Claude Context, and CocoIndex Code — and explains when each one makes sense.</p>
<h2 id="the-framework-what-a-code-index-actually-does">The Framework: What a Code Index Actually Does</h2>
<p>Before comparing tools, it helps to separate the transport layer from the index itself. Every tool here exposes an <a href="/mcp-ecosystem-2026/">MCP server</a> — that&rsquo;s the JSON-RPC interface your agent talks to. But MCP is just the container. The real product difference is how each tool builds, stores, and refreshes its codebase map.</p>
<p>I categorize code indexes along three axes:</p>
<ul>
<li><strong>Index structure:</strong> Does it use precise AST/SCIP graphs, approximate vector embeddings, or a hybrid?</li>
<li><strong>Freshness model:</strong> Does it re-index everything on every change, or incrementally update only what changed?</li>
<li><strong>Scope:</strong> Single repo, multi-repo, or org-wide?</li>
</ul>
<p>The tools fall into two camps. Sourcegraph and CodeGraph build structural code graphs — they know that <code>handleClick</code> is called by <code>renderButton</code> because they parsed the AST and followed the import graph. Claude Context and CocoIndex Code use semantic retrieval — they embed code into vectors and find &ldquo;code that looks like this&rdquo; without necessarily knowing the exact call chain.</p>
<p>Neither approach is universally better. They optimize for different use cases.</p>
<h2 id="sourcegraph-precise-scip-indexing-for-cross-repo-completeness">Sourcegraph: Precise SCIP Indexing for Cross-Repo Completeness</h2>
<p>Sourcegraph&rsquo;s code index MCP server is the enterprise heavyweight. It uses SCIP (the successor to LSIF) to build a language-agnostic index of every symbol, definition, reference, and implementation across your entire repository fleet. When you ask &ldquo;where is <code>UserService.authenticate</code> defined and who calls it?&rdquo;, Sourcegraph returns the exact answer from its pre-built index — no file crawling, no grep, no guesswork.</p>
<p>What makes Sourcegraph unique is its scope. It&rsquo;s designed for org-wide code intelligence across hundreds or thousands of repositories. If your team maintains a monorepo with 50 microservices and a shared library, Sourcegraph can trace a function call from the frontend through three layers of abstraction into a backend service in a different repo. No other tool in this comparison can do that.</p>
<p>The trade-off is operational weight. Sourcegraph is a deployed service — you run it on your infrastructure or use Sourcegraph Cloud. The SCIP indexer runs as a CI step or a daemon, and while it supports incremental updates, the initial index of a large codebase takes real time. For a 10-million-line monorepo, expect the first SCIP index to run 20-40 minutes. After that, incremental updates are fast, but you&rsquo;re still running a service.</p>
<p><strong>Best for:</strong> Enterprise teams with multi-repo architectures who need exhaustive cross-repository code intelligence for migrations, security audits, and large-scale refactors.</p>
<p><strong>Skip if:</strong> You work on a single repo, you don&rsquo;t want to run a service, or you need answers in seconds without any setup.</p>
<h2 id="codegraph-local-knowledge-graph-one-call-blast-radius">CodeGraph: Local Knowledge Graph, One-Call Blast Radius</h2>
<p>CodeGraph (<a href="https://github.com/colbymchenry/codegraph">github.com/colbymchenry/codegraph</a>) takes a different approach. Instead of a deployed service, it runs as a local daemon that builds a knowledge graph of your codebase — symbols, call edges, dependency relationships — and auto-syncs on file changes. The selling point is that a single MCP tool call returns not just the relevant source, but the call paths and blast-radius analysis.</p>
<p>I tested CodeGraph on a mid-sized TypeScript project (about 50,000 lines across 300 files). The initial index took about 8 seconds. After that, file watchers picked up changes and re-indexed only the affected files. When I asked Claude Code &ldquo;what happens if I remove the <code>validateSession</code> middleware?&rdquo;, CodeGraph returned the middleware definition, every route that uses it, the downstream effects on error handling, and the test files that would break — all from one tool call.</p>
<p>The 100% local, no-API-key design is a genuine advantage for teams with privacy requirements. There&rsquo;s no data leaving your machine, no vector database to configure, no embedding provider to pay for. The graph is stored on disk and loaded into memory when the daemon runs.</p>
<p>The limitation is scope. CodeGraph is designed for single-repo use. It doesn&rsquo;t handle cross-repository references, and the graph quality depends on the language parser&rsquo;s ability to resolve symbols. For well-structured TypeScript, Python, or Go projects, it works well. For projects with heavy metaprogramming, dynamic imports, or generated code, the graph will have gaps.</p>
<p><strong>Best for:</strong> Individual developers and small teams who want fast, local, privacy-preserving code intelligence on a single repo.</p>
<p><strong>Skip if:</strong> You need cross-repo analysis, work with highly dynamic languages, or prefer a managed service over a local daemon.</p>
<h2 id="claude-context-hybrid-semantic-retrieval-with-vector-databases">Claude Context: Hybrid Semantic Retrieval with Vector Databases</h2>
<p>Claude Context (<a href="https://github.com/zilliztech/claude-context">github.com/zilliztech/claude-context</a>) is an MCP plugin that uses hybrid BM25 plus dense vector search to surface relevant code. Instead of building a structural graph, it embeds every function, class, and module into a vector space and retrieves the most semantically similar code when the agent asks a question.</p>
<p>The hybrid approach is smart. BM25 handles exact keyword matches (find all references to <code>deprecatedAuthFlow</code>), while dense vectors handle semantic similarity (find &ldquo;code that handles authentication&rdquo; even if the function is named <code>validateToken</code>). Together, they cover more ground than either method alone.</p>
<p>Claude Context also supports incremental indexing using Merkle trees — only files whose content hash changed get re-embedded. On a large codebase, this matters. I&rsquo;ve seen it reduce re-index time from 15 minutes to under 30 seconds on a project where only 3 files changed.</p>
<p>The operational cost is the catch. Claude Context requires a vector database (Milvus, Qdrant, or similar) and an embedding provider. That&rsquo;s infrastructure you need to run, monitor, and pay for. For a team already running a vector DB for other purposes, the marginal cost is low. For a solo developer who just wants code search, it&rsquo;s a heavy ask.</p>
<p><strong>Best for:</strong> Teams already running vector infrastructure who want semantic code retrieval across very large codebases (millions of lines).</p>
<p><strong>Skip if:</strong> You don&rsquo;t want to run a vector database, or you need precise structural answers (call graphs, type hierarchies) rather than &ldquo;code that looks like this.&rdquo;</p>
<h2 id="cocoindex-code-ast-aware-indexing-with-token-savings">CocoIndex Code: AST-Aware Indexing with Token Savings</h2>
<p>CocoIndex Code (<a href="https://cocoindex.io/cocoindex-code/">cocoindex.io/cocoindex-code/</a>) is the newest entrant and the one I&rsquo;m most excited about for practical daily use. It uses Tree-sitter to parse code into AST-aware chunks — each function, class, or block becomes a semantic unit — and indexes them for retrieval. The key insight is that code isn&rsquo;t prose, and chunking it by line count (the default in most RAG systems) destroys the structural information that makes code searchable.</p>
<p>CocoIndex claims 70% fewer tokens per turn and 80-90% cache hits on re-index. Those numbers sounded aggressive until I tested it. On a Django project with about 80,000 lines, CocoIndex&rsquo;s AST-aware chunking meant the agent could find the exact <code>def handle_payment_webhook</code> function without retrieving the entire file or three surrounding functions. The token savings come from precision — the agent gets the right code in fewer, smaller chunks.</p>
<p>The local-first design is practical. CocoIndex runs as a local daemon with no API key required by default. It offers CLI, MCP server, and Claude skill surfaces that all share the same index — so you can query the same codebase from Claude Code, Cursor, or a terminal without re-indexing. The cloud provider option exists for teams that want to offload embedding computation, but the default local mode works well for most projects.</p>
<p>The limitation is that CocoIndex is retrieval-focused, not graph-focused. It finds the right code, but it doesn&rsquo;t trace call paths or compute blast radius. For that, you&rsquo;d pair it with a structural tool or use it alongside CodeGraph.</p>
<p><strong>Best for:</strong> Developers who want fast, local, token-efficient code retrieval with minimal setup. The shared-index design is great for teams where multiple agents work on the same codebase.</p>
<p><strong>Skip if:</strong> You need structural call-graph analysis, or you&rsquo;re already happy with your current code search setup.</p>
<h2 id="what-mcp-changes--and-what-it-does-not">What MCP Changes — and What It Does Not</h2>
<p>All four tools expose MCP servers, and that&rsquo;s where the <a href="/mcp-ecosystem-2026/">MCP ecosystem</a> matters. Because they all speak the same protocol, you can run multiple index servers simultaneously and let your agent pick the right one per task. I run CodeGraph for structural questions and CocoIndex for semantic retrieval in the same Claude Code session. The agent calls <code>codegraph_query</code> for blast-radius analysis and <code>cocoindex_search</code> for finding relevant code by description. They don&rsquo;t conflict.</p>
<p>But MCP is not magic. The protocol handles transport and tool discovery — it doesn&rsquo;t make a bad index good. A vector-only index that returns 20 irrelevant chunks per query will waste tokens regardless of whether it&rsquo;s served over MCP or a CLI. As <a href="/best-mcp-servers-for-developers-2026/">DeployHQ&rsquo;s comparison of CLIs vs MCP</a> points out, structured interfaces matter more as autonomous tasks get larger, but the interface is only as good as the data behind it.</p>
<h2 id="decision-matrix">Decision Matrix</h2>
<table>
  <thead>
      <tr>
          <th>Criteria</th>
          <th>Sourcegraph</th>
          <th>CodeGraph</th>
          <th>Claude Context</th>
          <th>CocoIndex Code</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Setup burden</td>
          <td>High (deployed service)</td>
          <td>Low (local daemon)</td>
          <td>Medium (vector DB + embeddings)</td>
          <td>Low (local daemon)</td>
      </tr>
      <tr>
          <td>Index type</td>
          <td>SCIP structural graph</td>
          <td>Knowledge graph (symbols + edges)</td>
          <td>Hybrid BM25 + dense vectors</td>
          <td>AST-aware semantic chunks</td>
      </tr>
      <tr>
          <td>Cross-repo</td>
          <td>Yes</td>
          <td>No</td>
          <td>No</td>
          <td>No</td>
      </tr>
      <tr>
          <td>Freshness</td>
          <td>Incremental SCIP</td>
          <td>File watcher + auto-sync</td>
          <td>Merkle tree incremental</td>
          <td>Re-embed changed files</td>
      </tr>
      <tr>
          <td>Privacy</td>
          <td>Depends on deployment</td>
          <td>100% local</td>
          <td>Depends on embedding provider</td>
          <td>100% local (default)</td>
      </tr>
      <tr>
          <td>Token efficiency</td>
          <td>High (precise symbols)</td>
          <td>High (one-call answers)</td>
          <td>Medium (retrieval + context)</td>
          <td>High (AST chunking)</td>
      </tr>
      <tr>
          <td>Cost</td>
          <td>Service subscription</td>
          <td>Free</td>
          <td>Vector DB + embedding costs</td>
          <td>Free (local)</td>
      </tr>
      <tr>
          <td>Best for</td>
          <td>Enterprise, multi-repo</td>
          <td>Solo/small team, local</td>
          <td>Large codebases, existing vector infra</td>
          <td>Daily dev, token-conscious</td>
      </tr>
  </tbody>
</table>
<h2 id="which-one-should-you-pick">Which One Should You Pick?</h2>
<p>If you work at an organization with 50+ repos and need to trace a function call from the frontend to a backend service in a different repository, Sourcegraph is the only option that handles that scope. It&rsquo;s expensive and operationally heavy, but it solves a problem nothing else does.</p>
<p>If you&rsquo;re a solo developer or on a small team working on a single repo, CodeGraph or CocoIndex Code will serve you better. CodeGraph if you frequently need call-graph and blast-radius answers — &ldquo;what breaks if I change this interface?&rdquo; CocoIndex if you want fast, token-efficient semantic retrieval with minimal setup. Both are free, local, and privacy-preserving.</p>
<p>If you&rsquo;re already running a vector database for other purposes, Claude Context slots into your existing infrastructure and gives you semantic code search at scale. The hybrid BM25-plus-vector approach is solid, but the operational overhead only makes sense if you&rsquo;re already paying for the infrastructure.</p>
<p>The <a href="/devin-vs-claude-code-vs-swe-agent-2026/">coding agent landscape</a> has matured to the point where the agent itself is rarely the bottleneck. The bottleneck is context — how fast and how precisely the agent can understand your codebase. A good code index MCP server is the single highest-leverage investment you can make in agent productivity today. Pick the one that matches your scale, your privacy requirements, and the kind of questions you need answered.</p>
]]></content:encoded></item></channel></rss>