概要
CodeGraphは、コードベースに対して事前にインデックス化されたナレッジグラフを構築し、Claude Codeの探索エージェントがファイルをスキャンすることなくシンボル関係を素早く照会できるようにします。19以上の言語とフレームワークのルーティング認識をサポートし、完全にローカルで実行され、ツール呼び出しを最大96%削減し、探索速度を70%以上向上させます。
README プレビュー
\n\n# CodeGraph\n\n### Supercharge Claude Code with Semantic Code Intelligence\n\n**94% fewer tool calls · 77% faster exploration · 100% local**\n\n[](https://www.npmjs.com/package/@colbymchenry/codegraph)\n[](https://opensource.org/licenses/MIT)\n[](https://nodejs.org/)\n\n[](#)\n[](#)\n[](#)\n\n\n\n### Get Started\n\n```bash\nnpx @colbymchenry/codegraph\n```\n\nInteractive installer configures Claude Code automatically\n\n#### Initialize Projects\n\n```bash\ncd your-project\ncodegraph init -i\n```\n\n\n\n\n\n---\n\n## Why CodeGraph?\n\nWhen Claude Code explores a codebase, it spawns **Explore agents** that scan files with grep, glob, and Read — consuming tokens on every tool call.\n\n**CodeGraph gives those agents a pre-indexed knowledge graph** — symbol relationships, call graphs, and code structure. Agents query the graph instantly instead of scanning files.\n\n### Benchmark Results\n\nTested across 6 real-world codebases comparing Claude Code's Explore agent **with** and **without** CodeGraph:\n\n> **Average: 92% fewer tool calls · 71% faster**\n\n| Codebase | With CG | Without CG | Improvement |\n|----------|---------|------------|-------------|\n| **VS Code** · TypeScript | 3 calls, 17s | 52 calls, 1m 37s | **94% fewer · 82% faster** |\n| **Excalidraw** · TypeScript | 3 calls, 29s | 47 calls, 1m 45s | **94% fewer · 72% faster** |\n| **Claude Code** · Python + Rust | 3 calls, 39s | 40 calls, 1m 8s | **93% fewer · 43% faster** |\n| **Claude Code** · Java | 1 call, 19s | 26 calls, 1m 22s | **96% fewer · 77% faster** |\n| **Alamofire** · Swift | 3 calls, 22s | 32 calls, 1m 39s | **91% fewer · 78% faster** |\n| **Swift Compiler** · Swift/C++ | 6 calls, 35s | 37 calls, 2m 8s | **84% fewer · 73% faster** |\n\n\nFull benchmark details\n\nAll tests used Claude Opus 4.6 (1M context) with Claude Code v2.1.91. Each test spawned a single Explore agent with the same question.\n\n**Queries used:**\n| Codebase | Query |\n|----------|-------|\n| VS Code | "How does the extens
FAQ (4)
feature_inquiryCodegraphはコード変更後に自動的に同期しますか?
はい、Codegraphはバージョン0.9.4以降、MCPサーバーが動作している場合、ファイル変更のたびに自動的に同期します。内蔵のFileWatcherを使用し、記号とエッジを約3秒以内にインクリメンタルに再インデックスするため、手動のcodegraph syncやcodegraph indexコマンドは不要です。以前のバージョンでは、コード変更後に手動でcodegraph indexを実行して更新する必要がありました。
トラブル対応codegraphは、barrel re-exportsを通じてインポートされたコンポーネントに対して、なぜ呼び出し元が0と表示するのですか?
これはcodegraph v0.9.8以前の既知のバグで、特定のバレル形式が解決されず、エッジの欠落やライブコンポーネントの誤った 0 callers/impact を引き起こします。影響を受ける形式: export { default as X } from './X.svelte'、裸の import from './' または from '.'、およびワークスペースのパッケージサブパスインポート(@scope/pkg/sub)。修正(PRs #657, #659)はすでにマージされており、v0.9.8の次のリリースで出荷されます。最新バージョン(v0.9.9+)にアップグレードして解決してください。一時的な確認として、codegraph callees <file> を使用して、インポートが未解決/生のノードとして表示されるかどうかを確認できます。
トラブル対応Windows で codegraph daemon を起動するか、ブランチを切り替えるときにコンソールウィンドウが一瞬表示されるのはなぜですか?
codegraph v0.9.7以降にアップグレードしてください。v0.9.6のこのバグにより、git.exeの実行(例:git ls-files、git rev-parse)がwindowsHide: trueなしで行われ、コマンドプロンプトのウィンドウが表示される問題が発生していました。v0.9.7での修正により、すべてのgit/npmの子プロセスにwindowsHideが追加され、ちらつきが解消されました。
ハウツーデフォルトのCodeGraphインデックスディレクトリを.codegraphからカスタムパスに変更する方法は?
CodeGraphを実行する際に--data-dirフラグを使用して、カスタムインデックスディレクトリを指定します。例: codegraph --data-dir /path/to/custom/dir。この機能はPR #568で追加されています。