@colbymchenry/codegraph 0.6.6 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/README.md +180 -502
  2. package/dist/bin/codegraph.d.ts +0 -5
  3. package/dist/bin/codegraph.d.ts.map +1 -1
  4. package/dist/bin/codegraph.js +217 -263
  5. package/dist/bin/codegraph.js.map +1 -1
  6. package/dist/bin/uninstall.d.ts +0 -1
  7. package/dist/bin/uninstall.d.ts.map +1 -1
  8. package/dist/bin/uninstall.js +3 -29
  9. package/dist/bin/uninstall.js.map +1 -1
  10. package/dist/config.d.ts.map +1 -1
  11. package/dist/config.js +0 -3
  12. package/dist/config.js.map +1 -1
  13. package/dist/context/index.d.ts +3 -5
  14. package/dist/context/index.d.ts.map +1 -1
  15. package/dist/context/index.js +497 -46
  16. package/dist/context/index.js.map +1 -1
  17. package/dist/db/migrations.d.ts +1 -1
  18. package/dist/db/migrations.d.ts.map +1 -1
  19. package/dist/db/migrations.js +10 -1
  20. package/dist/db/migrations.js.map +1 -1
  21. package/dist/db/queries.d.ts +53 -0
  22. package/dist/db/queries.d.ts.map +1 -1
  23. package/dist/db/queries.js +244 -24
  24. package/dist/db/queries.js.map +1 -1
  25. package/dist/db/schema.sql +1 -16
  26. package/dist/errors.d.ts +1 -1
  27. package/dist/errors.d.ts.map +1 -1
  28. package/dist/errors.js +1 -7
  29. package/dist/errors.js.map +1 -1
  30. package/dist/extraction/dfm-extractor.d.ts +31 -0
  31. package/dist/extraction/dfm-extractor.d.ts.map +1 -0
  32. package/dist/extraction/dfm-extractor.js +151 -0
  33. package/dist/extraction/dfm-extractor.js.map +1 -0
  34. package/dist/extraction/grammars.d.ts +9 -1
  35. package/dist/extraction/grammars.d.ts.map +1 -1
  36. package/dist/extraction/grammars.js +34 -2
  37. package/dist/extraction/grammars.js.map +1 -1
  38. package/dist/extraction/index.d.ts +7 -1
  39. package/dist/extraction/index.d.ts.map +1 -1
  40. package/dist/extraction/index.js +373 -29
  41. package/dist/extraction/index.js.map +1 -1
  42. package/dist/extraction/languages/c-cpp.d.ts +4 -0
  43. package/dist/extraction/languages/c-cpp.d.ts.map +1 -0
  44. package/dist/extraction/languages/c-cpp.js +126 -0
  45. package/dist/extraction/languages/c-cpp.js.map +1 -0
  46. package/dist/extraction/languages/csharp.d.ts +3 -0
  47. package/dist/extraction/languages/csharp.d.ts.map +1 -0
  48. package/dist/extraction/languages/csharp.js +72 -0
  49. package/dist/extraction/languages/csharp.js.map +1 -0
  50. package/dist/extraction/languages/dart.d.ts +3 -0
  51. package/dist/extraction/languages/dart.d.ts.map +1 -0
  52. package/dist/extraction/languages/dart.js +192 -0
  53. package/dist/extraction/languages/dart.js.map +1 -0
  54. package/dist/extraction/languages/go.d.ts +3 -0
  55. package/dist/extraction/languages/go.d.ts.map +1 -0
  56. package/dist/extraction/languages/go.js +58 -0
  57. package/dist/extraction/languages/go.js.map +1 -0
  58. package/dist/extraction/languages/index.d.ts +10 -0
  59. package/dist/extraction/languages/index.d.ts.map +1 -0
  60. package/dist/extraction/languages/index.js +43 -0
  61. package/dist/extraction/languages/index.js.map +1 -0
  62. package/dist/extraction/languages/java.d.ts +3 -0
  63. package/dist/extraction/languages/java.d.ts.map +1 -0
  64. package/dist/extraction/languages/java.js +64 -0
  65. package/dist/extraction/languages/java.js.map +1 -0
  66. package/dist/extraction/languages/javascript.d.ts +3 -0
  67. package/dist/extraction/languages/javascript.d.ts.map +1 -0
  68. package/dist/extraction/languages/javascript.js +90 -0
  69. package/dist/extraction/languages/javascript.js.map +1 -0
  70. package/dist/extraction/languages/kotlin.d.ts +3 -0
  71. package/dist/extraction/languages/kotlin.d.ts.map +1 -0
  72. package/dist/extraction/languages/kotlin.js +253 -0
  73. package/dist/extraction/languages/kotlin.js.map +1 -0
  74. package/dist/extraction/languages/pascal.d.ts +3 -0
  75. package/dist/extraction/languages/pascal.d.ts.map +1 -0
  76. package/dist/extraction/languages/pascal.js +66 -0
  77. package/dist/extraction/languages/pascal.js.map +1 -0
  78. package/dist/extraction/languages/php.d.ts +3 -0
  79. package/dist/extraction/languages/php.d.ts.map +1 -0
  80. package/dist/extraction/languages/php.js +107 -0
  81. package/dist/extraction/languages/php.js.map +1 -0
  82. package/dist/extraction/languages/python.d.ts +3 -0
  83. package/dist/extraction/languages/python.d.ts.map +1 -0
  84. package/dist/extraction/languages/python.js +56 -0
  85. package/dist/extraction/languages/python.js.map +1 -0
  86. package/dist/extraction/languages/ruby.d.ts +3 -0
  87. package/dist/extraction/languages/ruby.d.ts.map +1 -0
  88. package/dist/extraction/languages/ruby.js +114 -0
  89. package/dist/extraction/languages/ruby.js.map +1 -0
  90. package/dist/extraction/languages/rust.d.ts +3 -0
  91. package/dist/extraction/languages/rust.d.ts.map +1 -0
  92. package/dist/extraction/languages/rust.js +109 -0
  93. package/dist/extraction/languages/rust.js.map +1 -0
  94. package/dist/extraction/languages/swift.d.ts +3 -0
  95. package/dist/extraction/languages/swift.d.ts.map +1 -0
  96. package/dist/extraction/languages/swift.js +91 -0
  97. package/dist/extraction/languages/swift.js.map +1 -0
  98. package/dist/extraction/languages/typescript.d.ts +3 -0
  99. package/dist/extraction/languages/typescript.d.ts.map +1 -0
  100. package/dist/extraction/languages/typescript.js +129 -0
  101. package/dist/extraction/languages/typescript.js.map +1 -0
  102. package/dist/extraction/liquid-extractor.d.ts +52 -0
  103. package/dist/extraction/liquid-extractor.d.ts.map +1 -0
  104. package/dist/extraction/liquid-extractor.js +313 -0
  105. package/dist/extraction/liquid-extractor.js.map +1 -0
  106. package/dist/extraction/parse-worker.d.ts +8 -0
  107. package/dist/extraction/parse-worker.d.ts.map +1 -0
  108. package/dist/extraction/parse-worker.js +57 -0
  109. package/dist/extraction/parse-worker.js.map +1 -0
  110. package/dist/extraction/svelte-extractor.d.ts +47 -0
  111. package/dist/extraction/svelte-extractor.d.ts.map +1 -0
  112. package/dist/extraction/svelte-extractor.js +230 -0
  113. package/dist/extraction/svelte-extractor.js.map +1 -0
  114. package/dist/extraction/tree-sitter-helpers.d.ts +28 -0
  115. package/dist/extraction/tree-sitter-helpers.d.ts.map +1 -0
  116. package/dist/extraction/tree-sitter-helpers.js +103 -0
  117. package/dist/extraction/tree-sitter-helpers.js.map +1 -0
  118. package/dist/extraction/tree-sitter-types.d.ts +179 -0
  119. package/dist/extraction/tree-sitter-types.d.ts.map +1 -0
  120. package/dist/extraction/tree-sitter-types.js +10 -0
  121. package/dist/extraction/tree-sitter-types.js.map +1 -0
  122. package/dist/extraction/tree-sitter.d.ts +67 -125
  123. package/dist/extraction/tree-sitter.d.ts.map +1 -1
  124. package/dist/extraction/tree-sitter.js +1052 -1860
  125. package/dist/extraction/tree-sitter.js.map +1 -1
  126. package/dist/graph/traversal.d.ts.map +1 -1
  127. package/dist/graph/traversal.js +20 -2
  128. package/dist/graph/traversal.js.map +1 -1
  129. package/dist/index.d.ts +29 -53
  130. package/dist/index.d.ts.map +1 -1
  131. package/dist/index.js +88 -117
  132. package/dist/index.js.map +1 -1
  133. package/dist/installer/claude-md-template.d.ts +1 -1
  134. package/dist/installer/claude-md-template.d.ts.map +1 -1
  135. package/dist/installer/claude-md-template.js +15 -15
  136. package/dist/installer/config-writer.d.ts +2 -13
  137. package/dist/installer/config-writer.d.ts.map +1 -1
  138. package/dist/installer/config-writer.js +4 -87
  139. package/dist/installer/config-writer.js.map +1 -1
  140. package/dist/installer/index.d.ts +3 -4
  141. package/dist/installer/index.d.ts.map +1 -1
  142. package/dist/installer/index.js +118 -127
  143. package/dist/installer/index.js.map +1 -1
  144. package/dist/mcp/index.d.ts +5 -0
  145. package/dist/mcp/index.d.ts.map +1 -1
  146. package/dist/mcp/index.js +25 -4
  147. package/dist/mcp/index.js.map +1 -1
  148. package/dist/mcp/tools.d.ts +33 -0
  149. package/dist/mcp/tools.d.ts.map +1 -1
  150. package/dist/mcp/tools.js +405 -26
  151. package/dist/mcp/tools.js.map +1 -1
  152. package/dist/mcp/transport.d.ts.map +1 -1
  153. package/dist/mcp/transport.js +0 -2
  154. package/dist/mcp/transport.js.map +1 -1
  155. package/dist/resolution/frameworks/csharp.js +29 -84
  156. package/dist/resolution/frameworks/csharp.js.map +1 -1
  157. package/dist/resolution/frameworks/express.js +44 -48
  158. package/dist/resolution/frameworks/express.js.map +1 -1
  159. package/dist/resolution/frameworks/go.js +34 -70
  160. package/dist/resolution/frameworks/go.js.map +1 -1
  161. package/dist/resolution/frameworks/java.js +29 -87
  162. package/dist/resolution/frameworks/java.js.map +1 -1
  163. package/dist/resolution/frameworks/laravel.js +6 -6
  164. package/dist/resolution/frameworks/laravel.js.map +1 -1
  165. package/dist/resolution/frameworks/python.js +33 -98
  166. package/dist/resolution/frameworks/python.js.map +1 -1
  167. package/dist/resolution/frameworks/react.js +53 -76
  168. package/dist/resolution/frameworks/react.js.map +1 -1
  169. package/dist/resolution/frameworks/ruby.js +12 -24
  170. package/dist/resolution/frameworks/ruby.js.map +1 -1
  171. package/dist/resolution/frameworks/rust.js +26 -66
  172. package/dist/resolution/frameworks/rust.js.map +1 -1
  173. package/dist/resolution/frameworks/svelte.js +11 -31
  174. package/dist/resolution/frameworks/svelte.js.map +1 -1
  175. package/dist/resolution/frameworks/swift.js +42 -160
  176. package/dist/resolution/frameworks/swift.js.map +1 -1
  177. package/dist/resolution/index.d.ts +19 -6
  178. package/dist/resolution/index.d.ts.map +1 -1
  179. package/dist/resolution/index.js +300 -144
  180. package/dist/resolution/index.js.map +1 -1
  181. package/dist/resolution/name-matcher.d.ts +5 -0
  182. package/dist/resolution/name-matcher.d.ts.map +1 -1
  183. package/dist/resolution/name-matcher.js +148 -8
  184. package/dist/resolution/name-matcher.js.map +1 -1
  185. package/dist/resolution/types.d.ts +1 -1
  186. package/dist/resolution/types.d.ts.map +1 -1
  187. package/dist/search/query-utils.d.ts +26 -1
  188. package/dist/search/query-utils.d.ts.map +1 -1
  189. package/dist/search/query-utils.js +209 -9
  190. package/dist/search/query-utils.js.map +1 -1
  191. package/dist/sync/index.d.ts +2 -4
  192. package/dist/sync/index.d.ts.map +1 -1
  193. package/dist/sync/index.js +4 -3
  194. package/dist/sync/index.js.map +1 -1
  195. package/dist/sync/watcher.d.ts +81 -0
  196. package/dist/sync/watcher.d.ts.map +1 -0
  197. package/dist/sync/watcher.js +184 -0
  198. package/dist/sync/watcher.js.map +1 -0
  199. package/dist/types.d.ts +2 -2
  200. package/dist/types.d.ts.map +1 -1
  201. package/dist/types.js +0 -1
  202. package/dist/types.js.map +1 -1
  203. package/dist/ui/shimmer-progress.d.ts +11 -0
  204. package/dist/ui/shimmer-progress.d.ts.map +1 -0
  205. package/dist/ui/shimmer-progress.js +90 -0
  206. package/dist/ui/shimmer-progress.js.map +1 -0
  207. package/dist/ui/shimmer-worker.d.ts +2 -0
  208. package/dist/ui/shimmer-worker.d.ts.map +1 -0
  209. package/dist/ui/shimmer-worker.js +112 -0
  210. package/dist/ui/shimmer-worker.js.map +1 -0
  211. package/dist/ui/types.d.ts +17 -0
  212. package/dist/ui/types.d.ts.map +1 -0
  213. package/dist/ui/types.js +3 -0
  214. package/dist/ui/types.js.map +1 -0
  215. package/dist/vectors/embedder.js +1 -1
  216. package/dist/vectors/embedder.js.map +1 -1
  217. package/dist/visualizer/server.d.ts.map +1 -1
  218. package/dist/visualizer/server.js +3 -11
  219. package/dist/visualizer/server.js.map +1 -1
  220. package/package.json +7 -12
  221. package/scripts/postinstall.js +0 -68
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  <div align="center">
2
2
 
3
- # 🔮 CodeGraph
3
+ # CodeGraph
4
4
 
5
5
  ### Supercharge Claude Code with Semantic Code Intelligence
6
6
 
7
- **30% fewer tokens 25% fewer tool calls 100% local**
7
+ **94% fewer tool calls · 77% faster exploration · 100% local**
8
8
 
9
9
  [![npm version](https://img.shields.io/npm/v/@colbymchenry/codegraph.svg)](https://www.npmjs.com/package/@colbymchenry/codegraph)
10
10
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
@@ -28,132 +28,88 @@ npx @colbymchenry/codegraph
28
28
 
29
29
  ---
30
30
 
31
- ## 🚀 Why CodeGraph?
31
+ ## Why CodeGraph?
32
32
 
33
- When you ask Claude Code to work on a complex task, it spawns **Explore agents** that scan your codebase using grep, glob, and file reads. These agents consume tokens with every tool call.
33
+ When Claude Code explores a codebase, it spawns **Explore agents** that scan files with grep, glob, and Read consuming tokens on every tool call.
34
34
 
35
- **CodeGraph gives those agents a semantic knowledge graph** — pre-indexed symbol relationships, call graphs, and code structure. Instead of scanning files, agents query the graph instantly.
35
+ **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.
36
36
 
37
- ### 📊 Benchmark Results
37
+ ### Benchmark Results
38
38
 
39
- We ran the same complex task 3 times with and without CodeGraph:
39
+ Tested across 6 real-world codebases comparing Claude Code's Explore agent **with** and **without** CodeGraph:
40
40
 
41
- | Metric | Without CodeGraph | With CodeGraph | Improvement |
42
- |--------|-------------------|----------------|-------------|
43
- | **Explore tokens** | 157.8k | 111.7k | **29% fewer** |
44
- | **Per-agent tokens** | 74.0k | 46.4k | **37% fewer** |
45
- | **Tool calls** | 60 | 45 | **25% fewer** |
46
- | **Main context usage** | 28.7% | 24.0% | **4.7% less** |
41
+ > **Average: 92% fewer tool calls · 71% faster**
42
+
43
+ | Codebase | With CG | Without CG | Improvement |
44
+ |----------|---------|------------|-------------|
45
+ | **VS Code** · TypeScript | 3 calls, 17s | 52 calls, 1m 37s | **94% fewer · 82% faster** |
46
+ | **Excalidraw** · TypeScript | 3 calls, 29s | 47 calls, 1m 45s | **94% fewer · 72% faster** |
47
+ | **Claude Code** · Python + Rust | 3 calls, 39s | 40 calls, 1m 8s | **93% fewer · 43% faster** |
48
+ | **Claude Code** · Java | 1 call, 19s | 26 calls, 1m 22s | **96% fewer · 77% faster** |
49
+ | **Alamofire** · Swift | 3 calls, 22s | 32 calls, 1m 39s | **91% fewer · 78% faster** |
50
+ | **Swift Compiler** · Swift/C++ | 6 calls, 35s | 37 calls, 2m 8s | **84% fewer · 73% faster** |
47
51
 
48
52
  <details>
49
- <summary><strong>Full benchmark data</strong></summary>
50
-
51
- **With CodeGraph:**
52
- | Test | Agents | Tool Uses | Explore Tokens | Plan Tokens | Time |
53
- |------|--------|-----------|----------------|-------------|------|
54
- | 1 | 3 | 54 | 149.7k | 76.4k | 1m 43s |
55
- | 2 | 2 | 41 | 102.1k | 74.8k | 1m 29s |
56
- | 3 | 2 | 40 | 83.3k | 63.3k | 1m 25s |
57
- | **Avg** | **2.3** | **45** | **111.7k** | **71.5k** | **1m 32s** |
58
-
59
- **Without CodeGraph:**
60
- | Test | Agents | Tool Uses | Explore Tokens | Plan Tokens | Time |
61
- |------|--------|-----------|----------------|-------------|------|
62
- | 1 | 3 | 74 | 177.3k | 80.5k | 1m 54s |
63
- | 2 | 2 | 55 | 149.3k | 64.0k | 1m 27s |
64
- | 3 | 2 | 51 | 146.7k | 62.3k | 1m 17s |
65
- | **Avg** | **2.3** | **60** | **157.8k** | **68.9k** | **1m 33s** |
53
+ <summary><strong>Full benchmark details</strong></summary>
54
+
55
+ All 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.
56
+
57
+ **Queries used:**
58
+ | Codebase | Query |
59
+ |----------|-------|
60
+ | VS Code | "How does the extension host communicate with the main process?" |
61
+ | Excalidraw | "How does collaborative editing and real-time sync work?" |
62
+ | Claude Code (Python+Rust) | "How does tool execution work end to end?" |
63
+ | Claude Code (Java) | "How does tool execution work end to end?" |
64
+ | Alamofire | "Trace how a request flows from Session.request() through to the URLSession layer" |
65
+ | Swift Compiler | "How does the Swift compiler handle error diagnostics?" |
66
+
67
+ **With CodeGraph the agent uses `codegraph_explore` and stops:**
68
+ | Codebase | Files Indexed | Nodes | Tool Uses | Tokens | Time | File Reads |
69
+ |----------|--------------|-------|-----------|--------|------|------------|
70
+ | VS Code (TypeScript) | 4,002 | 59,377 | 3 | 56.6k | 17s | 0 |
71
+ | Excalidraw (TypeScript) | 626 | 9,859 | 3 | 57.1k | 29s | 0 |
72
+ | Claude Code (Python+Rust) | 115 | 3,080 | 3 | 67.1k | 39s | 0 |
73
+ | Claude Code (Java) | — | — | 1 | 40.8k | 19s | 0 |
74
+ | Alamofire (Swift) | 102 | 2,624 | 3 | 57.3k | 22s | 0 |
75
+ | Swift Compiler (Swift/C++) | 25,874 | 272,898 | 6 | 77.4k | 35s | 0 |
76
+
77
+ **Without CodeGraph — the agent uses grep, find, ls, and Read extensively:**
78
+ | Codebase | Tool Uses | Tokens | Time | File Reads |
79
+ |----------|-----------|--------|------|------------|
80
+ | VS Code (TypeScript) | 52 | 89.4k | 1m 37s | ~15 |
81
+ | Excalidraw (TypeScript) | 47 | 77.9k | 1m 45s | ~20 |
82
+ | Claude Code (Python+Rust) | 40 | 69.3k | 1m 8s | ~15 |
83
+ | Claude Code (Java) | 26 | 73.3k | 1m 22s | ~15 |
84
+ | Alamofire (Swift) | 32 | 52.4k | 1m 39s | ~10 |
85
+ | Swift Compiler (Swift/C++) | 37 | 99.1k | 2m 8s | ~20 |
86
+
87
+ **Key observations:**
88
+ - With CodeGraph, the agent **never fell back to reading files** — it trusted the codegraph_explore results completely
89
+ - Without CodeGraph, agents spent most of their time on discovery (find, ls, grep) before they could even start reading relevant code
90
+ - The Java codebase needed only **1 codegraph_explore call** to answer the entire question
91
+ - Cross-language queries (Python+Rust) worked seamlessly — CodeGraph's graph traversal found connections across language boundaries
92
+ - 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
93
+ - 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
66
94
 
67
95
  </details>
68
96
 
69
- ### 🔄 How It Works
70
-
71
- ```
72
- ┌─────────────────────────────────────────────────────────────────┐
73
- │ Claude Code │
74
- │ │
75
- │ "Implement user authentication" │
76
- │ │ │
77
- │ ▼ │
78
- │ ┌─────────────────┐ ┌─────────────────┐ │
79
- │ │ Explore Agent │ ──── │ Explore Agent │ │
80
- │ └────────┬────────┘ └────────┬────────┘ │
81
- │ │ │ │
82
- └───────────┼────────────────────────┼─────────────────────────────┘
83
- │ │
84
- ▼ ▼
85
- ┌───────────────────────────────────────────────────────────────────┐
86
- │ CodeGraph MCP Server │
87
- │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
88
- │ │ Search │ │ Callers │ │ Context │ │
89
- │ │ "auth" │ │ "login()" │ │ for task │ │
90
- │ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │
91
- │ │ │ │ │
92
- │ └────────────────┼────────────────┘ │
93
- │ ▼ │
94
- │ ┌───────────────────────┐ │
95
- │ │ SQLite Graph DB │ │
96
- │ │ • 387 symbols │ │
97
- │ │ • 1,204 edges │ │
98
- │ │ • Instant lookups │ │
99
- │ └───────────────────────┘ │
100
- └───────────────────────────────────────────────────────────────────┘
101
- ```
102
-
103
- **Without CodeGraph:** Explore agents use `grep`, `glob`, and `Read` to scan files → many API calls, high token usage
104
-
105
- **With CodeGraph:** Explore agents query the graph via MCP tools → instant results, local processing, fewer tokens
106
-
107
97
  ---
108
98
 
109
- ## Key Features
110
-
111
- <table>
112
- <tr>
113
- <td width="33%" valign="top">
114
-
115
- ### 🧠 Smart Context Building
116
- One tool call returns everything Claude needs—entry points, related symbols, and code snippets. No more expensive exploration agents.
117
-
118
- </td>
119
- <td width="33%" valign="top">
120
-
121
- ### 🔍 Semantic Search
122
- Find code by meaning, not just text. Search for "authentication" and find `login`, `validateToken`, `AuthService`—even with different naming conventions.
123
-
124
- </td>
125
- <td width="33%" valign="top">
126
-
127
- ### 📈 Impact Analysis
128
- Know exactly what breaks before you change it. Trace callers, callees, and the full impact radius of any symbol.
99
+ ## Key Features
129
100
 
130
- </td>
131
- </tr>
132
- <tr>
133
- <td width="33%" valign="top">
134
-
135
- ### 🌍 19+ Languages
136
- TypeScript, JavaScript, Python, Go, Rust, Java, C#, PHP, Ruby, C, C++, Swift, Kotlin, Dart, Svelte, Liquid, Pascal/Delphi—all with the same API.
137
-
138
- </td>
139
- <td width="33%" valign="top">
140
-
141
- ### 🔒 100% Local
142
- No data leaves your machine. No API keys. No external services. Everything runs on your local SQLite database.
143
-
144
- </td>
145
- <td width="33%" valign="top">
146
-
147
- ### ⚡ Always Fresh
148
- Claude Code hooks automatically sync the index as you work. Your code intelligence is always up to date.
149
-
150
- </td>
151
- </tr>
152
- </table>
101
+ | | |
102
+ |---|---|
103
+ | **Smart Context Building** | One tool call returns entry points, related symbols, and code snippets — no expensive exploration agents |
104
+ | **Full-Text Search** | Find code by name instantly across your entire codebase, powered by FTS5 |
105
+ | **Impact Analysis** | Trace callers, callees, and the full impact radius of any symbol before making changes |
106
+ | **Always Fresh** | File watcher uses native OS events (FSEvents/inotify/ReadDirectoryChangesW) with debounced auto-sync — the graph stays current as you code, zero config |
107
+ | **19+ Languages** | TypeScript, JavaScript, Python, Go, Rust, Java, C#, PHP, Ruby, C, C++, Swift, Kotlin, Dart, Svelte, Liquid, Pascal/Delphi |
108
+ | **100% Local** | No data leaves your machine. No API keys. No external services. SQLite database only |
153
109
 
154
110
  ---
155
111
 
156
- ## 🎯 Quick Start
112
+ ## Quick Start
157
113
 
158
114
  ### 1. Run the Installer
159
115
 
@@ -161,13 +117,11 @@ Claude Code hooks automatically sync the index as you work. Your code intelligen
161
117
  npx @colbymchenry/codegraph
162
118
  ```
163
119
 
164
- The interactive installer will:
165
- - Prompt to install `codegraph` globally (needed for hooks & MCP server to work)
120
+ The installer will:
121
+ - Prompt to install `codegraph` globally (needed for the MCP server)
166
122
  - Configure the MCP server in `~/.claude.json`
167
123
  - Set up auto-allow permissions for CodeGraph tools
168
- - Ask about [anonymous error reporting](#-telemetry) (opt-out available)
169
- - Add global instructions to `~/.claude/CLAUDE.md` (teaches Claude how to use CodeGraph)
170
- - Install Claude Code hooks for automatic index syncing
124
+ - Add global instructions to `~/.claude/CLAUDE.md`
171
125
  - Optionally initialize your current project
172
126
 
173
127
  ### 2. Restart Claude Code
@@ -176,20 +130,16 @@ Restart Claude Code for the MCP server to load.
176
130
 
177
131
  ### 3. Initialize Projects
178
132
 
179
- For each project you want to use CodeGraph with:
180
-
181
133
  ```bash
182
134
  cd your-project
183
135
  codegraph init -i
184
136
  ```
185
137
 
186
- That's it! Claude Code will now use CodeGraph tools automatically when a `.codegraph/` directory exists.
138
+ That's it! Claude Code will use CodeGraph tools automatically when a `.codegraph/` directory exists.
187
139
 
188
140
  <details>
189
141
  <summary><strong>Manual Setup (Alternative)</strong></summary>
190
142
 
191
- If you prefer manual configuration:
192
-
193
143
  **Install globally:**
194
144
  ```bash
195
145
  npm install -g @colbymchenry/codegraph
@@ -231,7 +181,7 @@ npm install -g @colbymchenry/codegraph
231
181
  <details>
232
182
  <summary><strong>Global Instructions Reference</strong></summary>
233
183
 
234
- The installer automatically adds these instructions to `~/.claude/CLAUDE.md`. This is provided here for reference:
184
+ The installer automatically adds these instructions to `~/.claude/CLAUDE.md`:
235
185
 
236
186
  ```markdown
237
187
  ## CodeGraph
@@ -240,26 +190,25 @@ CodeGraph builds a semantic knowledge graph of codebases for faster, smarter cod
240
190
 
241
191
  ### If `.codegraph/` exists in the project
242
192
 
243
- **Use codegraph tools for faster exploration.** These tools provide instant lookups via the code graph instead of scanning files:
193
+ **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?").
244
194
 
245
- | Tool | Use For |
246
- |------|---------|
247
- | `codegraph_search` | Find symbols by name (functions, classes, types) |
248
- | `codegraph_context` | Get relevant code context for a task |
249
- | `codegraph_callers` | Find what calls a function |
250
- | `codegraph_callees` | Find what a function calls |
251
- | `codegraph_impact` | See what's affected by changing a symbol |
252
- | `codegraph_node` | Get details + source code for a symbol |
253
- | `codegraph_files` | Get project file structure from the index |
195
+ **When spawning Explore agents**, include this instruction in the prompt:
254
196
 
255
- **When spawning Explore agents in a codegraph-enabled project:**
197
+ > This project has CodeGraph initialized (.codegraph/ exists). Use `codegraph_explore` as your PRIMARY tool — it returns full source code sections from all relevant files in one call.
198
+ >
199
+ > **Rules:**
200
+ > 1. Follow the explore call budget in the `codegraph_explore` tool description — it scales automatically based on project size.
201
+ > 2. Do NOT re-read files that codegraph_explore already returned source code for. The source sections are complete and authoritative.
202
+ > 3. Only fall back to grep/glob/read for files listed under "Additional relevant files" if you need more detail, or if codegraph returned no results.
256
203
 
257
- Tell the Explore agent to use codegraph tools for faster exploration.
204
+ **The main session may only use these lightweight tools directly** (for targeted lookups before making edits, not for exploration):
258
205
 
259
- **For quick lookups in the main session:**
260
- - Use `codegraph_search` instead of grep for finding symbols
261
- - Use `codegraph_callers`/`codegraph_callees` to trace code flow
262
- - Use `codegraph_impact` before making changes to see what's affected
206
+ | Tool | Use For |
207
+ |------|---------|
208
+ | `codegraph_search` | Find symbols by name |
209
+ | `codegraph_callers` / `codegraph_callees` | Trace call flow |
210
+ | `codegraph_impact` | Check what's affected before editing |
211
+ | `codegraph_node` | Get a single symbol's details |
263
212
 
264
213
  ### If `.codegraph/` does NOT exist
265
214
 
@@ -272,399 +221,164 @@ At the start of a session, ask the user if they'd like to initialize CodeGraph:
272
221
 
273
222
  ---
274
223
 
275
- ## 📋 Requirements
276
-
277
- - Node.js >= 18.0.0
278
-
279
- ---
280
-
281
- ## 💻 CLI Usage
282
-
283
- ```bash
284
- codegraph # Run interactive installer
285
- codegraph install # Run interactive installer (explicit)
286
- codegraph init [path] # Initialize in a project
287
- codegraph uninit [path] # Remove CodeGraph from a project
288
- codegraph index [path] # Full index
289
- codegraph sync [path] # Incremental update
290
- codegraph status [path] # Show statistics
291
- codegraph query <search> # Search symbols
292
- codegraph files [path] # Show project file structure
293
- codegraph context <task> # Build context for AI
294
- codegraph affected [files] # Find test files affected by changes
295
- codegraph serve --mcp # Start MCP server
296
- ```
297
-
298
- ## 📖 CLI Commands
299
-
300
- ### `codegraph` / `codegraph install`
301
-
302
- Run the interactive installer for Claude Code integration. Configures MCP server and permissions automatically.
303
-
304
- ```bash
305
- codegraph # Run installer (when no args)
306
- codegraph install # Run installer (explicit)
307
- npx @colbymchenry/codegraph # Run via npx (no global install needed)
308
- ```
309
-
310
- The installer will:
311
- 1. Prompt to install `codegraph` globally (needed for hooks & MCP server)
312
- 2. Ask for installation location (global `~/.claude` or local `./.claude`)
313
- 3. Optionally set up auto-allow permissions
314
- 4. Ask about [anonymous error reporting](#-telemetry) (opt-out available)
315
- 5. Configure the MCP server in `claude.json`
316
- 6. Add global instructions to `~/.claude/CLAUDE.md` (teaches Claude how to use CodeGraph)
317
- 7. Install Claude Code hooks for automatic index syncing
318
- 8. For local installs: initialize and index the current project
319
-
320
- ### `codegraph init [path]`
321
-
322
- Initialize CodeGraph in a project directory. Creates a `.codegraph/` directory with the database and configuration.
323
-
324
- ```bash
325
- codegraph init # Initialize in current directory
326
- codegraph init /path/to/project # Initialize in specific directory
327
- codegraph init --index # Initialize and immediately index
328
- ```
329
-
330
- ### `codegraph uninit [path]`
224
+ ## How It Works
331
225
 
332
- Remove CodeGraph from a project. Deletes the `.codegraph/` directory and all indexed data.
333
-
334
- ```bash
335
- codegraph uninit # Remove from current directory
336
- codegraph uninit --force # Skip confirmation prompt
337
226
  ```
338
-
339
- ### `codegraph index [path]`
340
-
341
- Index all files in the project. Extracts functions, classes, methods, and their relationships.
342
-
343
- ```bash
344
- codegraph index # Index current directory
345
- codegraph index --force # Force full re-index
346
- codegraph index --quiet # Suppress progress output
347
- ```
348
-
349
- ### `codegraph sync [path]`
350
-
351
- Incrementally sync changes since the last index. Only processes added, modified, or removed files.
352
-
353
- ```bash
354
- codegraph sync # Sync current directory
355
- codegraph sync --quiet # Suppress output
356
- ```
357
-
358
- ### `codegraph status [path]`
359
-
360
- Show index status and statistics.
361
-
362
- ```bash
363
- codegraph status
227
+ ┌─────────────────────────────────────────────────────────────────┐
228
+ │ Claude Code │
229
+ │ │
230
+ │ "Implement user authentication" │
231
+ │ │ │
232
+ │ ▼ │
233
+ │ ┌─────────────────┐ ┌─────────────────┐
234
+ │ │ Explore Agent │ ──── │ Explore Agent │ │
235
+ │ └────────┬────────┘ └────────┬────────┘ │
236
+ │ │ │ │
237
+ └───────────┼────────────────────────┼─────────────────────────────┘
238
+ │ │
239
+ ▼ ▼
240
+ ┌───────────────────────────────────────────────────────────────────┐
241
+ │ CodeGraph MCP Server │
242
+ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
243
+ │ │ Search │ │ Callers │ │ Context │ │
244
+ │ │ "auth" │ │ "login()" │ │ for task │ │
245
+ │ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │
246
+ │ │ │ │ │
247
+ │ └────────────────┼────────────────┘ │
248
+ │ ▼ │
249
+ │ ┌───────────────────────┐ │
250
+ │ │ SQLite Graph DB │ │
251
+ │ │ • 387 symbols │ │
252
+ │ │ • 1,204 edges │ │
253
+ │ │ • Instant lookups │ │
254
+ │ └───────────────────────┘ │
255
+ └───────────────────────────────────────────────────────────────────┘
364
256
  ```
365
257
 
366
- Output includes:
367
- - Files indexed, nodes, edges
368
- - Nodes by kind (functions, classes, methods, etc.)
369
- - Files by language
370
- - Pending changes (if any)
371
-
372
- ### `codegraph query <search>`
258
+ 1. **Extraction** — [tree-sitter](https://tree-sitter.github.io/) parses source code into ASTs. Language-specific queries extract nodes (functions, classes, methods) and edges (calls, imports, extends, implements).
373
259
 
374
- Search for symbols in the codebase by name.
260
+ 2. **Storage** Everything goes into a local SQLite database (`.codegraph/codegraph.db`) with FTS5 full-text search.
375
261
 
376
- ```bash
377
- codegraph query "authenticate" # Search for symbols
378
- codegraph query "User" --kind class # Filter by kind
379
- codegraph query "process" --limit 20 # Limit results
380
- codegraph query "validate" --json # Output as JSON
381
- ```
262
+ 3. **Resolution** — After extraction, references are resolved: function calls → definitions, imports → source files, class inheritance, and framework-specific patterns.
382
263
 
383
- ### `codegraph files [path]`
264
+ 4. **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.
384
265
 
385
- Show the project file structure from the index. Faster than filesystem scanning since it reads from the indexed data.
386
-
387
- ```bash
388
- codegraph files # Show file tree
389
- codegraph files --format flat # Simple list
390
- codegraph files --format grouped # Group by language
391
- codegraph files --filter src/components # Filter by directory
392
- codegraph files --pattern "*.test.ts" # Filter by glob pattern
393
- codegraph files --max-depth 2 # Limit tree depth
394
- codegraph files --no-metadata # Hide language/symbol counts
395
- codegraph files --json # Output as JSON
396
- ```
397
-
398
- ### `codegraph context <task>`
266
+ ---
399
267
 
400
- Build relevant code context for a task. Uses semantic search to find entry points, then expands through the graph to find related code.
268
+ ## CLI Reference
401
269
 
402
270
  ```bash
403
- codegraph context "fix checkout bug"
404
- codegraph context "add user authentication" --format json
405
- codegraph context "refactor payment service" --max-nodes 30
271
+ codegraph # Run interactive installer
272
+ codegraph install # Run installer (explicit)
273
+ codegraph init [path] # Initialize in a project (--index to also index)
274
+ codegraph uninit [path] # Remove CodeGraph from a project (--force to skip prompt)
275
+ codegraph index [path] # Full index (--force to re-index, --quiet for less output)
276
+ codegraph sync [path] # Incremental update
277
+ codegraph status [path] # Show statistics
278
+ codegraph query <search> # Search symbols (--kind, --limit, --json)
279
+ codegraph files [path] # Show file structure (--format, --filter, --max-depth, --json)
280
+ codegraph context <task> # Build context for AI (--format, --max-nodes)
281
+ codegraph affected [files...] # Find test files affected by changes (see below)
282
+ codegraph serve --mcp # Start MCP server
406
283
  ```
407
284
 
408
- ### `codegraph affected [files...]`
285
+ ### `codegraph affected`
409
286
 
410
- Find test files affected by changed source files. Traces import dependencies transitively through the graph to discover which test files depend on the code you changed. Works with any test framework and any language CodeGraph supports.
287
+ Traces import dependencies transitively to find which test files are affected by changed source files.
411
288
 
412
289
  ```bash
413
290
  codegraph affected src/utils.ts src/api.ts # Pass files as arguments
414
291
  git diff --name-only | codegraph affected --stdin # Pipe from git diff
415
- codegraph affected --stdin --json < changed.txt # JSON output
416
292
  codegraph affected src/auth.ts --filter "e2e/*" # Custom test file pattern
417
- codegraph affected src/lib.ts --depth 3 --quiet # Shallow search, paths only
418
293
  ```
419
294
 
420
- **Options:**
421
-
422
295
  | Option | Description | Default |
423
296
  |--------|-------------|---------|
424
- | `--stdin` | Read file list from stdin (one per line) | `false` |
297
+ | `--stdin` | Read file list from stdin | `false` |
425
298
  | `-d, --depth <n>` | Max dependency traversal depth | `5` |
426
299
  | `-f, --filter <glob>` | Custom glob to identify test files | auto-detect |
427
300
  | `-j, --json` | Output as JSON | `false` |
428
- | `-q, --quiet` | Output file paths only, no decoration | `false` |
429
- | `-p, --path <path>` | Project path | auto-detect |
430
-
431
- **How it works:**
432
-
433
- 1. For each changed file, BFS-traverses its transitive dependents (files that import from it, directly or indirectly)
434
- 2. Filters results to test files using common conventions (`*.spec.*`, `*.test.*`, `e2e/`, `tests/`, `__tests__/`) or a custom `--filter` glob
435
- 3. Changed files that are themselves test files are always included
301
+ | `-q, --quiet` | Output file paths only | `false` |
436
302
 
437
- **Example: CI/hook integration**
303
+ **CI/hook example:**
438
304
 
439
305
  ```bash
440
306
  #!/usr/bin/env bash
441
- # In a pre-commit hook or CI step:
442
307
  AFFECTED=$(git diff --name-only HEAD | codegraph affected --stdin --quiet)
443
308
  if [ -n "$AFFECTED" ]; then
444
- echo "Running affected tests..."
445
309
  npx vitest run $AFFECTED
446
310
  fi
447
311
  ```
448
312
 
449
- ### `codegraph serve`
450
-
451
- Start CodeGraph as an MCP server for AI assistants.
452
-
453
- ```bash
454
- codegraph serve # Show MCP configuration help
455
- codegraph serve --mcp # Start MCP server (stdio)
456
- codegraph serve --mcp --path /project # Specify project path
457
- ```
458
-
459
- ## 🔌 MCP Tools Reference
460
-
461
- When running as an MCP server, CodeGraph exposes these tools to AI assistants. **These tools are designed to be used by Claude's Explore agents** for faster, more efficient codebase exploration.
462
-
463
- ### `codegraph_context`
464
-
465
- Build context for a specific task. Good for focused queries.
466
-
467
- ```
468
- codegraph_context(task: "fix checkout validation bug", maxNodes: 20)
469
- ```
470
-
471
- ### `codegraph_search`
472
-
473
- Quick symbol search by name. Returns locations only.
474
-
475
- ```
476
- codegraph_search(query: "UserService", kind: "class", limit: 10)
477
- ```
478
-
479
- ### `codegraph_callers` / `codegraph_callees`
480
-
481
- Find what calls a function, or what a function calls.
482
-
483
- ```
484
- codegraph_callers(symbol: "validatePayment", limit: 20)
485
- codegraph_callees(symbol: "processOrder", limit: 20)
486
- ```
487
-
488
- ### `codegraph_impact`
489
-
490
- Analyze what code would be affected by changing a symbol.
491
-
492
- ```
493
- codegraph_impact(symbol: "UserService", depth: 2)
494
- ```
495
-
496
- ### `codegraph_node`
497
-
498
- Get details about a specific symbol. Use `includeCode: true` only when needed.
499
-
500
- ```
501
- codegraph_node(symbol: "authenticate", includeCode: true)
502
- ```
503
-
504
- ### `codegraph_files`
505
-
506
- Get the project file structure from the index. Faster than filesystem scanning.
507
-
508
- ```
509
- codegraph_files(path: "src/components", format: "tree", includeMetadata: true)
510
- ```
511
-
512
- ### `codegraph_status`
513
-
514
- Check index health and statistics.
515
-
516
- ### How It Works With Claude Code
313
+ ---
517
314
 
518
- Claude's **Explore agents** use these tools instead of grep/glob/Read for faster exploration:
315
+ ## MCP Tools
519
316
 
520
- | Without CodeGraph | With CodeGraph | Benefit |
521
- |-------------------|----------------|---------|
522
- | `grep -r "auth"` | `codegraph_search("auth")` | Instant symbol lookup |
523
- | Multiple `Read` calls | `codegraph_context(task)` | Related code in one call |
524
- | Manual file tracing | `codegraph_callers/callees` | Call graph traversal |
525
- | Guessing impact | `codegraph_impact(symbol)` | Know what breaks |
526
- | `Glob`/`find` scanning | `codegraph_files(path)` | Indexed file structure |
317
+ When running as an MCP server, CodeGraph exposes these tools to Claude Code:
527
318
 
528
- This hybrid approach gives you **~30% fewer tokens** and **~25% fewer tool calls** while letting Claude's native agents handle synthesis.
319
+ | Tool | Purpose |
320
+ |------|---------|
321
+ | `codegraph_search` | Find symbols by name across the codebase |
322
+ | `codegraph_context` | Build relevant code context for a task |
323
+ | `codegraph_callers` | Find what calls a function |
324
+ | `codegraph_callees` | Find what a function calls |
325
+ | `codegraph_impact` | Analyze what code is affected by changing a symbol |
326
+ | `codegraph_node` | Get details about a specific symbol (optionally with source code) |
327
+ | `codegraph_files` | Get indexed file structure (faster than filesystem scanning) |
328
+ | `codegraph_status` | Check index health and statistics |
529
329
 
530
- ## 📚 Library Usage
330
+ ---
531
331
 
532
- CodeGraph can also be used as a library in your Node.js applications:
332
+ ## Library Usage
533
333
 
534
334
  ```typescript
535
335
  import CodeGraph from '@colbymchenry/codegraph';
536
336
 
537
- // Initialize a new project
538
337
  const cg = await CodeGraph.init('/path/to/project');
338
+ // Or: const cg = await CodeGraph.open('/path/to/project');
539
339
 
540
- // Or open an existing one
541
- const cg = await CodeGraph.open('/path/to/project');
542
-
543
- // Index with progress callback
544
340
  await cg.indexAll({
545
- onProgress: (progress) => {
546
- console.log(`${progress.phase}: ${progress.current}/${progress.total}`);
547
- }
341
+ onProgress: (p) => console.log(`${p.phase}: ${p.current}/${p.total}`)
548
342
  });
549
343
 
550
- // Search for symbols
551
344
  const results = cg.searchNodes('UserService');
345
+ const callers = cg.getCallers(results[0].node.id);
346
+ const context = await cg.buildContext('fix login bug', { maxNodes: 20, includeCode: true, format: 'markdown' });
347
+ const impact = cg.getImpactRadius(results[0].node.id, 2);
552
348
 
553
- // Get callers of a function
554
- const node = results[0].node;
555
- const callers = cg.getCallers(node.id);
556
-
557
- // Build context for a task
558
- const context = await cg.buildContext('fix login bug', {
559
- maxNodes: 20,
560
- includeCode: true,
561
- format: 'markdown'
562
- });
563
-
564
- // Get impact radius
565
- const impact = cg.getImpactRadius(node.id, 2);
566
-
567
- // Sync changes
568
- const syncResult = await cg.sync();
569
-
570
- // Clean up
349
+ cg.watch(); // auto-sync on file changes
350
+ cg.unwatch(); // stop watching
571
351
  cg.close();
572
352
  ```
573
353
 
574
- ## ⚙️ How It Works
575
-
576
- ### 1. Extraction
577
-
578
- CodeGraph uses [tree-sitter](https://tree-sitter.github.io/) to parse source code into ASTs. Language-specific queries (`.scm` files) extract:
579
-
580
- - **Nodes**: Functions, methods, classes, interfaces, types, variables
581
- - **Edges**: Calls, imports, extends, implements, returns_type
582
-
583
- Each node gets a unique ID based on its kind, file path, name, and line number.
584
-
585
- ### 2. Storage
586
-
587
- All data is stored in a local SQLite database (`.codegraph/codegraph.db`):
588
-
589
- - **nodes** table: All code entities with metadata
590
- - **edges** table: Relationships between nodes
591
- - **files** table: File tracking for incremental updates
592
- - **unresolved_refs** table: References pending resolution
593
- - **vectors** table: Embeddings stored as BLOBs for semantic search
594
- - **nodes_fts**: FTS5 virtual table for full-text search
595
- - **schema_versions** table: Schema version tracking
596
- - **project_metadata** table: Project-level key-value metadata
597
-
598
- ### 3. Reference Resolution
599
-
600
- After extraction, CodeGraph resolves references:
601
-
602
- 1. Match function calls to function definitions
603
- 2. Resolve imports to their source files
604
- 3. Link class inheritance and interface implementations
605
- 4. Apply framework-specific patterns (Express routes, etc.)
606
-
607
- ### 4. Semantic Search
608
-
609
- CodeGraph uses local embeddings (via [@xenova/transformers](https://github.com/xenova/transformers.js)) to enable semantic search:
610
-
611
- 1. Code symbols are embedded using a transformer model
612
- 2. Queries are embedded and compared using cosine similarity
613
- 3. Results are ranked by relevance
614
-
615
- ### 5. Graph Queries
616
-
617
- The graph structure enables powerful queries:
618
-
619
- - **Callers/Callees**: Direct call relationships
620
- - **Impact Radius**: BFS traversal to find all potentially affected code
621
- - **Dependencies**: What a symbol depends on
622
- - **Dependents**: What depends on a symbol
623
-
624
- ### 6. Context Building
625
-
626
- When you request context for a task:
627
-
628
- 1. Semantic search finds relevant entry points
629
- 2. Graph traversal expands to related code
630
- 3. Code snippets are extracted
631
- 4. Results are formatted for AI consumption
354
+ ---
632
355
 
633
- ## ⚙️ Configuration
356
+ ## Configuration
634
357
 
635
- The `.codegraph/config.json` file controls indexing behavior:
358
+ The `.codegraph/config.json` file controls indexing:
636
359
 
637
360
  ```json
638
361
  {
639
362
  "version": 1,
640
363
  "languages": ["typescript", "javascript"],
641
- "exclude": [
642
- "node_modules/**",
643
- "dist/**",
644
- "build/**",
645
- "*.min.js"
646
- ],
364
+ "exclude": ["node_modules/**", "dist/**", "build/**", "*.min.js"],
647
365
  "frameworks": [],
648
366
  "maxFileSize": 1048576,
649
367
  "extractDocstrings": true,
650
- "trackCallSites": true,
651
- "enableEmbeddings": false
368
+ "trackCallSites": true
652
369
  }
653
370
  ```
654
371
 
655
- ### Options
656
-
657
372
  | Option | Description | Default |
658
373
  |--------|-------------|---------|
659
374
  | `languages` | Languages to index (auto-detected if empty) | `[]` |
660
375
  | `exclude` | Glob patterns to ignore | `["node_modules/**", ...]` |
661
376
  | `frameworks` | Framework hints for better resolution | `[]` |
662
377
  | `maxFileSize` | Skip files larger than this (bytes) | `1048576` (1MB) |
663
- | `extractDocstrings` | Whether to extract docstrings from code | `true` |
664
- | `trackCallSites` | Whether to track call site locations | `true` |
665
- | `enableEmbeddings` | Enable semantic search embeddings | `false` |
378
+ | `extractDocstrings` | Extract docstrings from code | `true` |
379
+ | `trackCallSites` | Track call site locations | `true` |
666
380
 
667
- ## 🌐 Supported Languages
381
+ ## Supported Languages
668
382
 
669
383
  | Language | Extension | Status |
670
384
  |----------|-----------|--------|
@@ -679,60 +393,24 @@ The `.codegraph/config.json` file controls indexing behavior:
679
393
  | Ruby | `.rb` | Full support |
680
394
  | C | `.c`, `.h` | Full support |
681
395
  | C++ | `.cpp`, `.hpp`, `.cc` | Full support |
682
- | Swift | `.swift` | Basic support |
683
- | Kotlin | `.kt`, `.kts` | Basic support |
396
+ | Swift | `.swift` | Full support |
397
+ | Kotlin | `.kt`, `.kts` | Full support |
684
398
  | Dart | `.dart` | Full support |
685
399
  | Svelte | `.svelte` | Full support (script extraction, Svelte 5 runes, SvelteKit routes) |
686
400
  | Liquid | `.liquid` | Full support |
687
401
  | Pascal / Delphi | `.pas`, `.dpr`, `.dpk`, `.lpr` | Full support (classes, records, interfaces, enums, DFM/FMX form files) |
688
402
 
689
- ## 🔧 Troubleshooting
690
-
691
- ### "CodeGraph not initialized"
403
+ ## Troubleshooting
692
404
 
693
- Run `codegraph init` in your project directory first.
405
+ **"CodeGraph not initialized"** — Run `codegraph init` in your project directory first.
694
406
 
695
- ### Indexing is slow
407
+ **Indexing is slow** — Check that `node_modules` and other large directories are excluded. Use `--quiet` to reduce output overhead.
696
408
 
697
- - Check if `node_modules` or other large directories are excluded
698
- - Use `--quiet` flag to reduce console output overhead
699
- - Consider increasing `maxFileSize` if you have large files to skip
409
+ **MCP server not connecting** — Ensure the project is initialized/indexed, verify the path in your MCP config, and check that `codegraph serve --mcp` works from the command line.
700
410
 
701
- ### MCP server not connecting
702
-
703
- 1. Ensure the project is initialized and indexed
704
- 2. Check the path in your MCP configuration is correct
705
- 3. Verify `codegraph serve --mcp` works from the command line
706
- 4. Check Claude Code logs for connection errors
707
-
708
- ### Missing symbols in search
709
-
710
- - Run `codegraph sync` to pick up recent changes
711
- - Check if the file's language is supported
712
- - Verify the file isn't excluded by config patterns
713
-
714
- ## 📡 Telemetry
715
-
716
- CodeGraph collects anonymous error reports via [Sentry](https://sentry.io) to help diagnose and fix bugs. This is **enabled by default** in production environments (disabled in development/test).
717
-
718
- **What is collected:**
719
- - Error type, message, and stack trace (includes local file paths in the trace)
720
- - CodeGraph version and process name (CLI or MCP server)
721
-
722
- **What is NOT collected:**
723
- - Source code contents
724
- - File contents or repository data
725
- - Personal information or environment variables
726
-
727
- **To opt out**, set the environment variable before running CodeGraph:
728
-
729
- ```bash
730
- export CODEGRAPH_TELEMETRY=off
731
- ```
732
-
733
- ---
411
+ **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.
734
412
 
735
- ## 📄 License
413
+ ## License
736
414
 
737
415
  MIT
738
416
 
@@ -740,7 +418,7 @@ MIT
740
418
 
741
419
  <div align="center">
742
420
 
743
- **Made for the Claude Code community** 🤖
421
+ **Made for the Claude Code community**
744
422
 
745
423
  [Report Bug](https://github.com/colbymchenry/codegraph/issues) · [Request Feature](https://github.com/colbymchenry/codegraph/issues)
746
424