[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-11462":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":9,"totalLinesOfCode":9,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":9,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":9,"createdAt":9,"pushedAt":9,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":16,"starSnapshotCount":16,"syncStatus":27,"lastSyncTime":28,"discoverSource":29},11462,"codegraph","colbymchenry\u002Fcodegraph","colbymchenry","Pre-indexed code knowledge graph for Claude Code, Codex, Gemini, Cursor, OpenCode, AntiGravity, Kiro, and Hermes Agent — fewer tokens, fewer tool calls, 100% local",null,"https:\u002F\u002Fgithub.com\u002Fcolbymchenry\u002Fcodegraph","TypeScript",42986,2641,103,74,0,830,8727,27103,5462,117,false,"main","2026-06-07 04:03:56","\u003Cdiv align=\"center\">\n\n# CodeGraph\n\n### Supercharge Claude Code, Cursor, Codex, and OpenCode with Semantic Code Intelligence\n\n**94% fewer tool calls · 77% faster exploration · 100% local**\n\n[![npm version](https:\u002F\u002Fimg.shields.io\u002Fnpm\u002Fv\u002F@colbymchenry\u002Fcodegraph.svg)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002F@colbymchenry\u002Fcodegraph)\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-yellow.svg)](https:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT)\n[![Node.js](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FNode.js-18+-green.svg)](https:\u002F\u002Fnodejs.org\u002F)\n\n[![Windows](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FWindows-supported-blue.svg)](#)\n[![macOS](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FmacOS-supported-blue.svg)](#)\n[![Linux](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLinux-supported-blue.svg)](#)\n\n[![Claude Code](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FClaude_Code-supported-blueviolet.svg)](#)\n[![Cursor](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCursor-supported-blueviolet.svg)](#)\n[![Codex CLI](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCodex_CLI-supported-blueviolet.svg)](#)\n[![opencode](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fopencode-supported-blueviolet.svg)](#)\n\n\u003Cbr \u002F>\n\n### Get Started\n\n```bash\nnpx @colbymchenry\u002Fcodegraph\n```\n\n\u003Csub>Interactive installer auto-configures your agent(s) — Claude Code, Cursor, Codex CLI, opencode\u003C\u002Fsub>\n\n#### Initialize Projects\n\n```bash\ncd your-project\ncodegraph init -i\n```\n\n![1_C_VYnhpys0UHrOuOgpgoyw](https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Ff168182f-4d9a-44e0-94d7-08d018cc8a3a)\n\n\u003C\u002Fdiv>\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\u002FC++ | 6 calls, 35s | 37 calls, 2m 8s | **84% fewer · 73% faster** |\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Full benchmark details\u003C\u002Fstrong>\u003C\u002Fsummary>\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 extension host communicate with the main process?\" |\n| Excalidraw | \"How does collaborative editing and real-time sync work?\" |\n| Claude Code (Python+Rust) | \"How does tool execution work end to end?\" |\n| Claude Code (Java) | \"How does tool execution work end to end?\" |\n| Alamofire | \"Trace how a request flows from Session.request() through to the URLSession layer\" |\n| Swift Compiler | \"How does the Swift compiler handle error diagnostics?\" |\n\n**With CodeGraph — the agent uses `codegraph_explore` and stops:**\n| Codebase | Files Indexed | Nodes | Tool Uses | Tokens | Time | File Reads |\n|----------|--------------|-------|-----------|--------|------|------------|\n| VS Code (TypeScript) | 4,002 | 59,377 | 3 | 56.6k | 17s | 0 |\n| Excalidraw (TypeScript) | 626 | 9,859 | 3 | 57.1k | 29s | 0 |\n| Claude Code (Python+Rust) | 115 | 3,080 | 3 | 67.1k | 39s | 0 |\n| Claude Code (Java) | — | — | 1 | 40.8k | 19s | 0 |\n| Alamofire (Swift) | 102 | 2,624 | 3 | 57.3k | 22s | 0 |\n| Swift Compiler (Swift\u002FC++) | 25,874 | 272,898 | 6 | 77.4k | 35s | 0 |\n\n**Without CodeGraph — the agent uses grep, find, ls, and Read extensively:**\n| Codebase | Tool Uses | Tokens | Time | File Reads |\n|----------|-----------|--------|------|------------|\n| VS Code (TypeScript) | 52 | 89.4k | 1m 37s | ~15 |\n| Excalidraw (TypeScript) | 47 | 77.9k | 1m 45s | ~20 |\n| Claude Code (Python+Rust) | 40 | 69.3k | 1m 8s | ~15 |\n| Claude Code (Java) | 26 | 73.3k | 1m 22s | ~15 |\n| Alamofire (Swift) | 32 | 52.4k | 1m 39s | ~10 |\n| Swift Compiler (Swift\u002FC++) | 37 | 99.1k | 2m 8s | ~20 |\n\n**Key observations:**\n- With CodeGraph, the agent **never fell back to reading files** — it trusted the codegraph_explore results completely\n- Without CodeGraph, agents spent most of their time on discovery (find, ls, grep) before they could even start reading relevant code\n- The Java codebase needed only **1 codegraph_explore call** to answer the entire question\n- Cross-language queries (Python+Rust) worked seamlessly — CodeGraph's graph traversal found connections across language boundaries\n- The Swift benchmark (Alamofire) traced a **9-step call chain** from `Session.request()` to `URLSession.dataTask()` — CodeGraph's graph traversal at depth 3 captured the full chain in one explore call\n- The **Swift Compiler** benchmark is the largest codebase tested (**25,874 files, 272,898 nodes**) — CodeGraph indexed it in under 4 minutes and the agent answered a complex cross-cutting question with **6 explore calls and zero file reads** in 35 seconds\n\n\u003C\u002Fdetails>\n\n---\n\n## Key Features\n\n| | |\n|---|---|\n| **Smart Context Building** | One tool call returns entry points, related symbols, and code snippets — no expensive exploration agents |\n| **Full-Text Search** | Find code by name instantly across your entire codebase, powered by FTS5 |\n| **Impact Analysis** | Trace callers, callees, and the full impact radius of any symbol before making changes |\n| **Always Fresh** | File watcher uses native OS events (FSEvents\u002Finotify\u002FReadDirectoryChangesW) with debounced auto-sync — the graph stays current as you code, zero config |\n| **19+ Languages** | TypeScript, JavaScript, Python, Go, Rust, Java, C#, PHP, Ruby, C, C++, Swift, Kotlin, Dart, Svelte, Liquid, Pascal\u002FDelphi |\n| **Framework-aware Routes** | Recognizes web-framework routing files and links URL patterns to their handlers across 13 frameworks |\n| **100% Local** | No data leaves your machine. No API keys. No external services. SQLite database only |\n\n---\n\n## Framework-aware Routes\n\nCodeGraph detects web-framework routing files and emits `route` nodes linked by `references` edges to their handler classes or functions. Querying callers of a view\u002Fcontroller now surfaces the URL pattern that binds it.\n\n| Framework | Shapes recognized |\n|---|---|\n| **Django** | `path()`, `re_path()`, `url()`, `include()` in `urls.py` (CBV `.as_view()`, dotted paths) |\n| **Flask** | `@app.route('\u002Fpath', methods=[...])`, blueprint routes |\n| **FastAPI** | `@app.get(...)`, `@router.post(...)`, all standard methods |\n| **Express** | `app.get(...)`, `router.post(...)` with middleware chains |\n| **Laravel** | `Route::get()`, `Route::resource()`, `Controller@action`, tuple syntax |\n| **Rails** | `get '\u002Fx', to: 'users#index'`, hash-rocket `=>` syntax |\n| **Spring** | `@GetMapping`, `@PostMapping`, `@RequestMapping` on methods |\n| **Gin \u002F chi \u002F gorilla \u002F mux** | `r.GET(...)`, `router.HandleFunc(...)` |\n| **Axum \u002F actix \u002F Rocket** | `.route(\"\u002Fx\", get(handler))` |\n| **ASP.NET** | `[HttpGet(\"\u002Fx\")]` attributes on action methods |\n| **Vapor** | `app.get(\"x\", use: handler)` |\n| **React Router** \u002F **SvelteKit** | Route component nodes |\n\n---\n\n## Quick Start\n\n### 1. Run the Installer\n\n```bash\nnpx @colbymchenry\u002Fcodegraph\n```\n\nThe installer will:\n- Ask which agent(s) to configure — auto-detects installed ones from: **Claude Code**, **Cursor**, **Codex CLI**, **opencode**\n- Prompt to install `codegraph` on your PATH (so agents can launch the MCP server)\n- Ask whether configs apply to all your projects or just this one\n- Write each chosen agent's MCP server config + an instructions file (e.g. `CLAUDE.md`, `.cursor\u002Frules\u002Fcodegraph.mdc`, `~\u002F.codex\u002FAGENTS.md`)\n- Set up auto-allow permissions when Claude Code is one of the targets\n- Initialize your current project (local installs only)\n\n**Non-interactive (scripting \u002F CI):**\n\n```bash\ncodegraph install --yes                              # auto-detect agents, install global\ncodegraph install --target=cursor,claude --yes       # explicit target list\ncodegraph install --target=auto --location=local     # detected agents, project-local\ncodegraph install --print-config codex               # print snippet, no file writes\n```\n\n| Flag | Values | Default |\n|---|---|---|\n| `--target` | `auto`, `all`, `none`, or csv (`claude,cursor,...`) | prompt |\n| `--location` | `global`, `local` | prompt |\n| `--yes` | (boolean) | prompt every step |\n| `--no-permissions` | (boolean) skip Claude auto-allow list | permissions on |\n| `--print-config \u003Cid>` | dump snippet for one agent and exit | — |\n\n### 2. Restart Your Agent\n\nRestart your agent (Claude Code \u002F Cursor \u002F Codex CLI \u002F opencode) for the MCP server to load.\n\n### 3. Initialize Projects\n\n```bash\ncd your-project\ncodegraph init -i\n```\n\nBuilds the per-project knowledge graph index. Also wires up any project-local agent surfaces (e.g. Cursor's `.cursor\u002Frules\u002Fcodegraph.mdc`) so a single global `codegraph install` works in every project you open — no need to re-run the installer per project.\n\nThat's it — your agent will use CodeGraph tools automatically when a `.codegraph\u002F` directory exists.\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Manual Setup (Alternative)\u003C\u002Fstrong>\u003C\u002Fsummary>\n\n**Install globally:**\n```bash\nnpm install -g @colbymchenry\u002Fcodegraph\n```\n\n**Add to `~\u002F.claude.json`:**\n```json\n{\n  \"mcpServers\": {\n    \"codegraph\": {\n      \"type\": \"stdio\",\n      \"command\": \"codegraph\",\n      \"args\": [\"serve\", \"--mcp\"]\n    }\n  }\n}\n```\n\n**Add to `~\u002F.claude\u002Fsettings.json` (optional, for auto-allow):**\n```json\n{\n  \"permissions\": {\n    \"allow\": [\n      \"mcp__codegraph__codegraph_search\",\n      \"mcp__codegraph__codegraph_context\",\n      \"mcp__codegraph__codegraph_callers\",\n      \"mcp__codegraph__codegraph_callees\",\n      \"mcp__codegraph__codegraph_impact\",\n      \"mcp__codegraph__codegraph_node\",\n      \"mcp__codegraph__codegraph_status\",\n      \"mcp__codegraph__codegraph_files\"\n    ]\n  }\n}\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>\u003Cstrong>Global Instructions Reference\u003C\u002Fstrong>\u003C\u002Fsummary>\n\nThe installer automatically adds these instructions to `~\u002F.claude\u002FCLAUDE.md`:\n\n```markdown\n## CodeGraph\n\nCodeGraph builds a semantic knowledge graph of codebases for faster, smarter code exploration.\n\n### If `.codegraph\u002F` exists in the project\n\n**NEVER call `codegraph_explore` or `codegraph_context` directly in the main session.** These tools return large amounts of source code that fills up main session context. Instead, ALWAYS spawn an Explore agent for any exploration question (e.g., \"how does X work?\", \"explain the Y system\", \"where is Z implemented?\").\n\n**When spawning Explore agents**, include this instruction in the prompt:\n\n> This project has CodeGraph initialized (.codegraph\u002F exists). Use `codegraph_explore` as your PRIMARY tool — it returns full source code sections from all relevant files in one call.\n>\n> **Rules:**\n> 1. Follow the explore call budget in the `codegraph_explore` tool description — it scales automatically based on project size.\n> 2. Do NOT re-read files that codegraph_explore already returned source code for. The source sections are complete and authoritative.\n> 3. Only fall back to grep\u002Fglob\u002Fread for files listed under \"Additional relevant files\" if you need more detail, or if codegraph returned no results.\n\n**The main session may only use these lightweight tools directly** (for targeted lookups before making edits, not for exploration):\n\n| Tool | Use For |\n|------|---------|\n| `codegraph_search` | Find symbols by name |\n| `codegraph_callers` \u002F `codegraph_callees` | Trace call flow |\n| `codegraph_impact` | Check what's affected before editing |\n| `codegraph_node` | Get a single symbol's details |\n\n### If `.codegraph\u002F` does NOT exist\n\nAt the start of a session, ask the user if they'd like to initialize CodeGraph:\n\n\"I notice this project doesn't have CodeGraph initialized. Would you like me to run `codegraph init -i` to build a code knowledge graph?\"\n```\n\n\u003C\u002Fdetails>\n\n---\n\n## How It Works\n\n```\n┌─────────────────────────────────────────────────────────────────┐\n│                        Claude Code                               │\n│                                                                  │\n│  \"Implement user authentication\"                                 │\n│           │                                                      │\n│           ▼                                                      │\n│  ┌─────────────────┐      ┌─────────────────┐                   │\n│  │  Explore Agent  │ ──── │  Explore Agent  │                   │\n│  └────────┬────────┘      └────────┬────────┘                   │\n│           │                        │                             │\n└───────────┼────────────────────────┼─────────────────────────────┘\n            │                        │\n            ▼                        ▼\n┌───────────────────────────────────────────────────────────────────┐\n│                     CodeGraph MCP Server                          │\n│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐               │\n│  │   Search    │  │   Callers   │  │   Context   │               │\n│  │  \"auth\"     │  │  \"login()\"  │  │  for task   │               │\n│  └──────┬──────┘  └──────┬──────┘  └──────┬──────┘               │\n│         │                │                │                       │\n│         └────────────────┼────────────────┘                       │\n│                          ▼                                        │\n│              ┌───────────────────────┐                            │\n│              │   SQLite Graph DB     │                            │\n│              │   • 387 symbols       │                            │\n│              │   • 1,204 edges       │                            │\n│              │   • Instant lookups   │                            │\n│              └───────────────────────┘                            │\n└───────────────────────────────────────────────────────────────────┘\n```\n\n1. **Extraction** — [tree-sitter](https:\u002F\u002Ftree-sitter.github.io\u002F) parses source code into ASTs. Language-specific queries extract nodes (functions, classes, methods) and edges (calls, imports, extends, implements).\n\n2. **Storage** — Everything goes into a local SQLite database (`.codegraph\u002Fcodegraph.db`) with FTS5 full-text search.\n\n3. **Resolution** — After extraction, references are resolved: function calls → definitions, imports → source files, class inheritance, and framework-specific patterns.\n\n4. **Auto-Sync** — The MCP server watches your project using native OS file events. Changes are debounced (2-second quiet window), filtered to source files only, and incrementally synced. The graph stays fresh as you code — no configuration needed.\n\n---\n\n## CLI Reference\n\n```bash\ncodegraph                         # Run interactive installer\ncodegraph install                 # Run installer (explicit)\ncodegraph init [path]             # Initialize in a project (--index to also index)\ncodegraph uninit [path]           # Remove CodeGraph from a project (--force to skip prompt)\ncodegraph index [path]            # Full index (--force to re-index, --quiet for less output)\ncodegraph sync [path]             # Incremental update\ncodegraph status [path]           # Show statistics\ncodegraph query \u003Csearch>          # Search symbols (--kind, --limit, --json)\ncodegraph files [path]            # Show file structure (--format, --filter, --max-depth, --json)\ncodegraph context \u003Ctask>          # Build context for AI (--format, --max-nodes)\ncodegraph affected [files...]     # Find test files affected by changes (see below)\ncodegraph serve --mcp             # Start MCP server\n```\n\n### `codegraph affected`\n\nTraces import dependencies transitively to find which test files are affected by changed source files.\n\n```bash\ncodegraph affected src\u002Futils.ts src\u002Fapi.ts         # Pass files as arguments\ngit diff --name-only | codegraph affected --stdin   # Pipe from git diff\ncodegraph affected src\u002Fauth.ts --filter \"e2e\u002F*\"     # Custom test file pattern\n```\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `--stdin` | Read file list from stdin | `false` |\n| `-d, --depth \u003Cn>` | Max dependency traversal depth | `5` |\n| `-f, --filter \u003Cglob>` | Custom glob to identify test files | auto-detect |\n| `-j, --json` | Output as JSON | `false` |\n| `-q, --quiet` | Output file paths only | `false` |\n\n**CI\u002Fhook example:**\n\n```bash\n#!\u002Fusr\u002Fbin\u002Fenv bash\nAFFECTED=$(git diff --name-only HEAD | codegraph affected --stdin --quiet)\nif [ -n \"$AFFECTED\" ]; then\n  npx vitest run $AFFECTED\nfi\n```\n\n---\n\n## MCP Tools\n\nWhen running as an MCP server, CodeGraph exposes these tools to Claude Code:\n\n| Tool | Purpose |\n|------|---------|\n| `codegraph_search` | Find symbols by name across the codebase |\n| `codegraph_context` | Build relevant code context for a task |\n| `codegraph_callers` | Find what calls a function |\n| `codegraph_callees` | Find what a function calls |\n| `codegraph_impact` | Analyze what code is affected by changing a symbol |\n| `codegraph_node` | Get details about a specific symbol (optionally with source code) |\n| `codegraph_files` | Get indexed file structure (faster than filesystem scanning) |\n| `codegraph_status` | Check index health and statistics |\n\n---\n\n## Library Usage\n\n```typescript\nimport CodeGraph from '@colbymchenry\u002Fcodegraph';\n\nconst cg = await CodeGraph.init('\u002Fpath\u002Fto\u002Fproject');\n\u002F\u002F Or: const cg = await CodeGraph.open('\u002Fpath\u002Fto\u002Fproject');\n\nawait cg.indexAll({\n  onProgress: (p) => console.log(`${p.phase}: ${p.current}\u002F${p.total}`)\n});\n\nconst results = cg.searchNodes('UserService');\nconst callers = cg.getCallers(results[0].node.id);\nconst context = await cg.buildContext('fix login bug', { maxNodes: 20, includeCode: true, format: 'markdown' });\nconst impact = cg.getImpactRadius(results[0].node.id, 2);\n\ncg.watch();   \u002F\u002F auto-sync on file changes\ncg.unwatch(); \u002F\u002F stop watching\ncg.close();\n```\n\n---\n\n## Configuration\n\nThe `.codegraph\u002Fconfig.json` file controls indexing:\n\n```json\n{\n  \"version\": 1,\n  \"languages\": [\"typescript\", \"javascript\"],\n  \"exclude\": [\"node_modules\u002F**\", \"dist\u002F**\", \"build\u002F**\", \"*.min.js\"],\n  \"frameworks\": [],\n  \"maxFileSize\": 1048576,\n  \"extractDocstrings\": true,\n  \"trackCallSites\": true\n}\n```\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `languages` | Languages to index (auto-detected if empty) | `[]` |\n| `exclude` | Glob patterns to ignore | `[\"node_modules\u002F**\", ...]` |\n| `frameworks` | Framework hints for better resolution | `[]` |\n| `maxFileSize` | Skip files larger than this (bytes) | `1048576` (1MB) |\n| `extractDocstrings` | Extract docstrings from code | `true` |\n| `trackCallSites` | Track call site locations | `true` |\n\n## Supported Languages\n\n| Language | Extension | Status |\n|----------|-----------|--------|\n| TypeScript | `.ts`, `.tsx` | Full support |\n| JavaScript | `.js`, `.jsx`, `.mjs` | Full support |\n| Python | `.py` | Full support |\n| Go | `.go` | Full support |\n| Rust | `.rs` | Full support |\n| Java | `.java` | Full support |\n| C# | `.cs` | Full support |\n| PHP | `.php` | Full support |\n| Ruby | `.rb` | Full support |\n| C | `.c`, `.h` | Full support |\n| C++ | `.cpp`, `.hpp`, `.cc` | Full support |\n| Swift | `.swift` | Full support |\n| Kotlin | `.kt`, `.kts` | Full support |\n| Scala | `.scala`, `.sc` | Full support (classes, traits, methods, type aliases, Scala 3 enums) |\n| Dart | `.dart` | Full support |\n| Svelte | `.svelte` | Full support (script extraction, Svelte 5 runes, SvelteKit routes) |\n| Vue | `.vue` | Full support (script + script-setup extraction, Nuxt page\u002FAPI\u002Fmiddleware routes) |\n| Liquid | `.liquid` | Full support |\n| Pascal \u002F Delphi | `.pas`, `.dpr`, `.dpk`, `.lpr` | Full support (classes, records, interfaces, enums, DFM\u002FFMX form files) |\n\n## Troubleshooting\n\n**\"CodeGraph not initialized\"** — Run `codegraph init` in your project directory first.\n\n**Indexing is slow** — Check that `node_modules` and other large directories are excluded. Use `--quiet` to reduce output overhead.\n\n**Indexing is slow \u002F MCP `database is locked` \u002F WASM fallback active** — `codegraph` ships with a WASM SQLite fallback for environments where `better-sqlite3` (a native module, declared as `optionalDependencies`) can't install. The fallback is 5-10x slower than the native backend and uses a journal mode that lets writers block readers, so MCP queries can also hit `database is locked` while indexing runs. Run `codegraph status` and look at the `Backend:` line:\n\n- `Backend: native` — you're on the fast path, nothing to do.\n- `Backend: wasm` — you're on the slow fallback. Common causes: missing C build tools, prebuilt binary unavailable for your Node version, or your Node version changed after install. Fix:\n\n  ```bash\n  # macOS\n  xcode-select --install                                  # installs the C compiler\n\n  # Linux (Debian \u002F Ubuntu)\n  sudo apt install build-essential python3 make\n\n  # Linux (RHEL \u002F Fedora)\n  sudo yum groupinstall \"Development Tools\"\n\n  # Then rebuild on any platform:\n  npm rebuild better-sqlite3\n\n  # Or force-include as a hard dep:\n  npm install better-sqlite3 --save\n  ```\n\n  After the fix, `codegraph status` should show `Backend: native`.\n\n**MCP server not connecting** — Ensure the project is initialized\u002Findexed, verify the path in your MCP config, and check that `codegraph serve --mcp` works from the command line.\n\n**Missing symbols** — The MCP server auto-syncs on save (wait a couple seconds). Run `codegraph sync` manually if needed. Check that the file's language is supported and isn't excluded by config patterns.\n\n## License\n\nMIT\n\n---\n\n\u003Cdiv align=\"center\">\n\n**Made for the Claude Code community**\n\n[Report Bug](https:\u002F\u002Fgithub.com\u002Fcolbymchenry\u002Fcodegraph\u002Fissues) · [Request Feature](https:\u002F\u002Fgithub.com\u002Fcolbymchenry\u002Fcodegraph\u002Fissues)\n\n\u003C\u002Fdiv>\n","CodeGraph 是一个为 Claude Code 等代码助手提供预索引代码知识图谱的工具，旨在减少工具调用次数和提高代码探索速度。它通过构建符号关系、调用图和代码结构的知识图谱，使得代码代理可以直接查询图谱而无需反复扫描文件，从而大幅降低了 token 消耗并提升了响应速度。该工具完全本地化运行，支持 TypeScript 语言编写，并且兼容 Windows、macOS 和 Linux 平台。CodeGraph 适用于需要频繁进行代码库探索或理解复杂项目结构的开发场景，能够显著提升开发者的工作效率。",2,"2026-06-06 03:32:51","trending"]