@stupidloud/codegraph 0.8.1 → 0.9.9

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 (341) hide show
  1. package/README.md +319 -152
  2. package/dist/bin/codegraph.d.ts +4 -0
  3. package/dist/bin/codegraph.d.ts.map +1 -1
  4. package/dist/bin/codegraph.js +354 -90
  5. package/dist/bin/codegraph.js.map +1 -1
  6. package/dist/bin/node-version-check.d.ts +17 -0
  7. package/dist/bin/node-version-check.d.ts.map +1 -1
  8. package/dist/bin/node-version-check.js +37 -0
  9. package/dist/bin/node-version-check.js.map +1 -1
  10. package/dist/config.d.ts.map +1 -1
  11. package/dist/config.js +1 -11
  12. package/dist/config.js.map +1 -1
  13. package/dist/context/formatter.d.ts.map +1 -1
  14. package/dist/context/formatter.js +25 -6
  15. package/dist/context/formatter.js.map +1 -1
  16. package/dist/context/index.d.ts +22 -0
  17. package/dist/context/index.d.ts.map +1 -1
  18. package/dist/context/index.js +257 -6
  19. package/dist/context/index.js.map +1 -1
  20. package/dist/context/markers.d.ts +19 -0
  21. package/dist/context/markers.d.ts.map +1 -0
  22. package/dist/context/markers.js +22 -0
  23. package/dist/context/markers.js.map +1 -0
  24. package/dist/db/index.d.ts +30 -1
  25. package/dist/db/index.d.ts.map +1 -1
  26. package/dist/db/index.js +75 -25
  27. package/dist/db/index.js.map +1 -1
  28. package/dist/db/queries.d.ts +104 -0
  29. package/dist/db/queries.d.ts.map +1 -1
  30. package/dist/db/queries.js +328 -31
  31. package/dist/db/queries.js.map +1 -1
  32. package/dist/db/sqlite-adapter.d.ts +24 -23
  33. package/dist/db/sqlite-adapter.d.ts.map +1 -1
  34. package/dist/db/sqlite-adapter.js +54 -174
  35. package/dist/db/sqlite-adapter.js.map +1 -1
  36. package/dist/directory.d.ts.map +1 -1
  37. package/dist/directory.js +6 -20
  38. package/dist/directory.js.map +1 -1
  39. package/dist/extraction/generated-detection.d.ts +30 -0
  40. package/dist/extraction/generated-detection.d.ts.map +1 -0
  41. package/dist/extraction/generated-detection.js +80 -0
  42. package/dist/extraction/generated-detection.js.map +1 -0
  43. package/dist/extraction/grammars.d.ts +23 -1
  44. package/dist/extraction/grammars.d.ts.map +1 -1
  45. package/dist/extraction/grammars.js +107 -3
  46. package/dist/extraction/grammars.js.map +1 -1
  47. package/dist/extraction/index.d.ts +22 -14
  48. package/dist/extraction/index.d.ts.map +1 -1
  49. package/dist/extraction/index.js +272 -183
  50. package/dist/extraction/index.js.map +1 -1
  51. package/dist/extraction/languages/c-cpp.d.ts.map +1 -1
  52. package/dist/extraction/languages/c-cpp.js +45 -0
  53. package/dist/extraction/languages/c-cpp.js.map +1 -1
  54. package/dist/extraction/languages/csharp.d.ts.map +1 -1
  55. package/dist/extraction/languages/csharp.js +2 -1
  56. package/dist/extraction/languages/csharp.js.map +1 -1
  57. package/dist/extraction/languages/go.d.ts.map +1 -1
  58. package/dist/extraction/languages/go.js +18 -2
  59. package/dist/extraction/languages/go.js.map +1 -1
  60. package/dist/extraction/languages/index.d.ts.map +1 -1
  61. package/dist/extraction/languages/index.js +6 -0
  62. package/dist/extraction/languages/index.js.map +1 -1
  63. package/dist/extraction/languages/java.d.ts.map +1 -1
  64. package/dist/extraction/languages/java.js +6 -0
  65. package/dist/extraction/languages/java.js.map +1 -1
  66. package/dist/extraction/languages/kotlin.d.ts.map +1 -1
  67. package/dist/extraction/languages/kotlin.js +6 -0
  68. package/dist/extraction/languages/kotlin.js.map +1 -1
  69. package/dist/extraction/languages/lua.d.ts +3 -0
  70. package/dist/extraction/languages/lua.d.ts.map +1 -0
  71. package/dist/extraction/languages/lua.js +150 -0
  72. package/dist/extraction/languages/lua.js.map +1 -0
  73. package/dist/extraction/languages/luau.d.ts +3 -0
  74. package/dist/extraction/languages/luau.d.ts.map +1 -0
  75. package/dist/extraction/languages/luau.js +37 -0
  76. package/dist/extraction/languages/luau.js.map +1 -0
  77. package/dist/extraction/languages/objc.d.ts +3 -0
  78. package/dist/extraction/languages/objc.d.ts.map +1 -0
  79. package/dist/extraction/languages/objc.js +133 -0
  80. package/dist/extraction/languages/objc.js.map +1 -0
  81. package/dist/extraction/mybatis-extractor.d.ts +48 -0
  82. package/dist/extraction/mybatis-extractor.d.ts.map +1 -0
  83. package/dist/extraction/mybatis-extractor.js +198 -0
  84. package/dist/extraction/mybatis-extractor.js.map +1 -0
  85. package/dist/extraction/tree-sitter-types.d.ts +14 -0
  86. package/dist/extraction/tree-sitter-types.d.ts.map +1 -1
  87. package/dist/extraction/tree-sitter.d.ts +84 -0
  88. package/dist/extraction/tree-sitter.d.ts.map +1 -1
  89. package/dist/extraction/tree-sitter.js +715 -16
  90. package/dist/extraction/tree-sitter.js.map +1 -1
  91. package/dist/extraction/vue-extractor.d.ts +15 -0
  92. package/dist/extraction/vue-extractor.d.ts.map +1 -1
  93. package/dist/extraction/vue-extractor.js +88 -0
  94. package/dist/extraction/vue-extractor.js.map +1 -1
  95. package/dist/extraction/wasm/tree-sitter-lua.wasm +0 -0
  96. package/dist/extraction/wasm/tree-sitter-luau.wasm +0 -0
  97. package/dist/extraction/wasm-runtime-flags.d.ts +38 -0
  98. package/dist/extraction/wasm-runtime-flags.d.ts.map +1 -0
  99. package/dist/extraction/wasm-runtime-flags.js +106 -0
  100. package/dist/extraction/wasm-runtime-flags.js.map +1 -0
  101. package/dist/graph/traversal.d.ts.map +1 -1
  102. package/dist/graph/traversal.js +76 -38
  103. package/dist/graph/traversal.js.map +1 -1
  104. package/dist/index.d.ts +77 -8
  105. package/dist/index.d.ts.map +1 -1
  106. package/dist/index.js +133 -19
  107. package/dist/index.js.map +1 -1
  108. package/dist/installer/config-writer.d.ts +7 -8
  109. package/dist/installer/config-writer.d.ts.map +1 -1
  110. package/dist/installer/config-writer.js +7 -27
  111. package/dist/installer/config-writer.js.map +1 -1
  112. package/dist/installer/index.d.ts +51 -16
  113. package/dist/installer/index.d.ts.map +1 -1
  114. package/dist/installer/index.js +120 -29
  115. package/dist/installer/index.js.map +1 -1
  116. package/dist/installer/instructions-template.d.ts +11 -21
  117. package/dist/installer/instructions-template.d.ts.map +1 -1
  118. package/dist/installer/instructions-template.js +12 -56
  119. package/dist/installer/instructions-template.js.map +1 -1
  120. package/dist/installer/targets/antigravity.d.ts +57 -0
  121. package/dist/installer/targets/antigravity.d.ts.map +1 -0
  122. package/dist/installer/targets/antigravity.js +308 -0
  123. package/dist/installer/targets/antigravity.js.map +1 -0
  124. package/dist/installer/targets/claude.d.ts +26 -1
  125. package/dist/installer/targets/claude.d.ts.map +1 -1
  126. package/dist/installer/targets/claude.js +118 -40
  127. package/dist/installer/targets/claude.js.map +1 -1
  128. package/dist/installer/targets/codex.d.ts.map +1 -1
  129. package/dist/installer/targets/codex.js +15 -13
  130. package/dist/installer/targets/codex.js.map +1 -1
  131. package/dist/installer/targets/cursor.d.ts.map +1 -1
  132. package/dist/installer/targets/cursor.js +61 -36
  133. package/dist/installer/targets/cursor.js.map +1 -1
  134. package/dist/installer/targets/gemini.d.ts +26 -0
  135. package/dist/installer/targets/gemini.d.ts.map +1 -0
  136. package/dist/installer/targets/gemini.js +167 -0
  137. package/dist/installer/targets/gemini.js.map +1 -0
  138. package/dist/installer/targets/hermes.d.ts +18 -0
  139. package/dist/installer/targets/hermes.d.ts.map +1 -0
  140. package/dist/installer/targets/hermes.js +359 -0
  141. package/dist/installer/targets/hermes.js.map +1 -0
  142. package/dist/installer/targets/kiro.d.ts +27 -0
  143. package/dist/installer/targets/kiro.d.ts.map +1 -0
  144. package/dist/installer/targets/kiro.js +178 -0
  145. package/dist/installer/targets/kiro.js.map +1 -0
  146. package/dist/installer/targets/opencode.d.ts.map +1 -1
  147. package/dist/installer/targets/opencode.js +15 -13
  148. package/dist/installer/targets/opencode.js.map +1 -1
  149. package/dist/installer/targets/registry.d.ts.map +1 -1
  150. package/dist/installer/targets/registry.js +8 -0
  151. package/dist/installer/targets/registry.js.map +1 -1
  152. package/dist/installer/targets/shared.d.ts.map +1 -1
  153. package/dist/installer/targets/shared.js +3 -2
  154. package/dist/installer/targets/shared.js.map +1 -1
  155. package/dist/installer/targets/types.d.ts +1 -16
  156. package/dist/installer/targets/types.d.ts.map +1 -1
  157. package/dist/mcp/daemon-paths.d.ts +46 -0
  158. package/dist/mcp/daemon-paths.d.ts.map +1 -0
  159. package/dist/mcp/daemon-paths.js +125 -0
  160. package/dist/mcp/daemon-paths.js.map +1 -0
  161. package/dist/mcp/daemon.d.ts +161 -0
  162. package/dist/mcp/daemon.d.ts.map +1 -0
  163. package/dist/mcp/daemon.js +403 -0
  164. package/dist/mcp/daemon.js.map +1 -0
  165. package/dist/mcp/engine.d.ts +105 -0
  166. package/dist/mcp/engine.d.ts.map +1 -0
  167. package/dist/mcp/engine.js +270 -0
  168. package/dist/mcp/engine.js.map +1 -0
  169. package/dist/mcp/index.d.ts +70 -52
  170. package/dist/mcp/index.d.ts.map +1 -1
  171. package/dist/mcp/index.js +355 -331
  172. package/dist/mcp/index.js.map +1 -1
  173. package/dist/mcp/proxy.d.ts +81 -0
  174. package/dist/mcp/proxy.d.ts.map +1 -0
  175. package/dist/mcp/proxy.js +510 -0
  176. package/dist/mcp/proxy.js.map +1 -0
  177. package/dist/mcp/server-instructions.d.ts +1 -1
  178. package/dist/mcp/server-instructions.d.ts.map +1 -1
  179. package/dist/mcp/server-instructions.js +21 -21
  180. package/dist/mcp/session.d.ts +77 -0
  181. package/dist/mcp/session.d.ts.map +1 -0
  182. package/dist/mcp/session.js +294 -0
  183. package/dist/mcp/session.js.map +1 -0
  184. package/dist/mcp/tools.d.ts +171 -15
  185. package/dist/mcp/tools.d.ts.map +1 -1
  186. package/dist/mcp/tools.js +1714 -298
  187. package/dist/mcp/tools.js.map +1 -1
  188. package/dist/mcp/transport.d.ts +111 -29
  189. package/dist/mcp/transport.d.ts.map +1 -1
  190. package/dist/mcp/transport.js +181 -71
  191. package/dist/mcp/transport.js.map +1 -1
  192. package/dist/mcp/version.d.ts +19 -0
  193. package/dist/mcp/version.d.ts.map +1 -0
  194. package/dist/mcp/version.js +71 -0
  195. package/dist/mcp/version.js.map +1 -0
  196. package/dist/resolution/callback-synthesizer.d.ts +10 -0
  197. package/dist/resolution/callback-synthesizer.d.ts.map +1 -0
  198. package/dist/resolution/callback-synthesizer.js +1300 -0
  199. package/dist/resolution/callback-synthesizer.js.map +1 -0
  200. package/dist/resolution/frameworks/csharp.d.ts.map +1 -1
  201. package/dist/resolution/frameworks/csharp.js +36 -8
  202. package/dist/resolution/frameworks/csharp.js.map +1 -1
  203. package/dist/resolution/frameworks/drupal.d.ts +51 -0
  204. package/dist/resolution/frameworks/drupal.d.ts.map +1 -0
  205. package/dist/resolution/frameworks/drupal.js +367 -0
  206. package/dist/resolution/frameworks/drupal.js.map +1 -0
  207. package/dist/resolution/frameworks/expo-modules.d.ts +3 -0
  208. package/dist/resolution/frameworks/expo-modules.d.ts.map +1 -0
  209. package/dist/resolution/frameworks/expo-modules.js +143 -0
  210. package/dist/resolution/frameworks/expo-modules.js.map +1 -0
  211. package/dist/resolution/frameworks/express.d.ts.map +1 -1
  212. package/dist/resolution/frameworks/express.js +102 -19
  213. package/dist/resolution/frameworks/express.js.map +1 -1
  214. package/dist/resolution/frameworks/fabric.d.ts +3 -0
  215. package/dist/resolution/frameworks/fabric.d.ts.map +1 -0
  216. package/dist/resolution/frameworks/fabric.js +354 -0
  217. package/dist/resolution/frameworks/fabric.js.map +1 -0
  218. package/dist/resolution/frameworks/go.d.ts.map +1 -1
  219. package/dist/resolution/frameworks/go.js +6 -3
  220. package/dist/resolution/frameworks/go.js.map +1 -1
  221. package/dist/resolution/frameworks/index.d.ts +6 -0
  222. package/dist/resolution/frameworks/index.d.ts.map +1 -1
  223. package/dist/resolution/frameworks/index.js +29 -1
  224. package/dist/resolution/frameworks/index.js.map +1 -1
  225. package/dist/resolution/frameworks/java.d.ts.map +1 -1
  226. package/dist/resolution/frameworks/java.js +339 -12
  227. package/dist/resolution/frameworks/java.js.map +1 -1
  228. package/dist/resolution/frameworks/laravel.d.ts.map +1 -1
  229. package/dist/resolution/frameworks/laravel.js +17 -8
  230. package/dist/resolution/frameworks/laravel.js.map +1 -1
  231. package/dist/resolution/frameworks/nestjs.d.ts.map +1 -1
  232. package/dist/resolution/frameworks/nestjs.js +324 -0
  233. package/dist/resolution/frameworks/nestjs.js.map +1 -1
  234. package/dist/resolution/frameworks/play.d.ts +19 -0
  235. package/dist/resolution/frameworks/play.d.ts.map +1 -0
  236. package/dist/resolution/frameworks/play.js +111 -0
  237. package/dist/resolution/frameworks/play.js.map +1 -0
  238. package/dist/resolution/frameworks/python.d.ts.map +1 -1
  239. package/dist/resolution/frameworks/python.js +134 -16
  240. package/dist/resolution/frameworks/python.js.map +1 -1
  241. package/dist/resolution/frameworks/react-native.d.ts +3 -0
  242. package/dist/resolution/frameworks/react-native.d.ts.map +1 -0
  243. package/dist/resolution/frameworks/react-native.js +360 -0
  244. package/dist/resolution/frameworks/react-native.js.map +1 -0
  245. package/dist/resolution/frameworks/react.d.ts.map +1 -1
  246. package/dist/resolution/frameworks/react.js +96 -3
  247. package/dist/resolution/frameworks/react.js.map +1 -1
  248. package/dist/resolution/frameworks/ruby.d.ts.map +1 -1
  249. package/dist/resolution/frameworks/ruby.js +106 -2
  250. package/dist/resolution/frameworks/ruby.js.map +1 -1
  251. package/dist/resolution/frameworks/rust.d.ts.map +1 -1
  252. package/dist/resolution/frameworks/rust.js +102 -5
  253. package/dist/resolution/frameworks/rust.js.map +1 -1
  254. package/dist/resolution/frameworks/swift-objc.d.ts +37 -0
  255. package/dist/resolution/frameworks/swift-objc.d.ts.map +1 -0
  256. package/dist/resolution/frameworks/swift-objc.js +252 -0
  257. package/dist/resolution/frameworks/swift-objc.js.map +1 -0
  258. package/dist/resolution/frameworks/swift.d.ts.map +1 -1
  259. package/dist/resolution/frameworks/swift.js +30 -6
  260. package/dist/resolution/frameworks/swift.js.map +1 -1
  261. package/dist/resolution/go-module.d.ts +26 -0
  262. package/dist/resolution/go-module.d.ts.map +1 -0
  263. package/dist/resolution/go-module.js +78 -0
  264. package/dist/resolution/go-module.js.map +1 -0
  265. package/dist/resolution/import-resolver.d.ts +28 -0
  266. package/dist/resolution/import-resolver.d.ts.map +1 -1
  267. package/dist/resolution/import-resolver.js +617 -5
  268. package/dist/resolution/import-resolver.js.map +1 -1
  269. package/dist/resolution/index.d.ts +11 -0
  270. package/dist/resolution/index.d.ts.map +1 -1
  271. package/dist/resolution/index.js +196 -10
  272. package/dist/resolution/index.js.map +1 -1
  273. package/dist/resolution/lru-cache.d.ts +24 -0
  274. package/dist/resolution/lru-cache.d.ts.map +1 -0
  275. package/dist/resolution/lru-cache.js +62 -0
  276. package/dist/resolution/lru-cache.js.map +1 -0
  277. package/dist/resolution/name-matcher.d.ts.map +1 -1
  278. package/dist/resolution/name-matcher.js +212 -0
  279. package/dist/resolution/name-matcher.js.map +1 -1
  280. package/dist/resolution/swift-objc-bridge.d.ts +134 -0
  281. package/dist/resolution/swift-objc-bridge.d.ts.map +1 -0
  282. package/dist/resolution/swift-objc-bridge.js +256 -0
  283. package/dist/resolution/swift-objc-bridge.js.map +1 -0
  284. package/dist/resolution/types.d.ts +44 -0
  285. package/dist/resolution/types.d.ts.map +1 -1
  286. package/dist/resolution/workspace-packages.d.ts +48 -0
  287. package/dist/resolution/workspace-packages.d.ts.map +1 -0
  288. package/dist/resolution/workspace-packages.js +208 -0
  289. package/dist/resolution/workspace-packages.js.map +1 -0
  290. package/dist/search/query-utils.d.ts +18 -0
  291. package/dist/search/query-utils.d.ts.map +1 -1
  292. package/dist/search/query-utils.js +30 -0
  293. package/dist/search/query-utils.js.map +1 -1
  294. package/dist/sync/git-hooks.d.ts.map +1 -1
  295. package/dist/sync/git-hooks.js +2 -0
  296. package/dist/sync/git-hooks.js.map +1 -1
  297. package/dist/sync/index.d.ts +3 -1
  298. package/dist/sync/index.d.ts.map +1 -1
  299. package/dist/sync/index.js +8 -1
  300. package/dist/sync/index.js.map +1 -1
  301. package/dist/sync/watcher.d.ts +214 -12
  302. package/dist/sync/watcher.d.ts.map +1 -1
  303. package/dist/sync/watcher.js +467 -55
  304. package/dist/sync/watcher.js.map +1 -1
  305. package/dist/sync/worktree.d.ts +54 -0
  306. package/dist/sync/worktree.d.ts.map +1 -0
  307. package/dist/sync/worktree.js +137 -0
  308. package/dist/sync/worktree.js.map +1 -0
  309. package/dist/types.d.ts +9 -1
  310. package/dist/types.d.ts.map +1 -1
  311. package/dist/types.js +14 -0
  312. package/dist/types.js.map +1 -1
  313. package/dist/utils.js +1 -1
  314. package/package.json +2 -2
  315. package/scripts/add-lang/bench.sh +60 -0
  316. package/scripts/add-lang/check-grammar.mjs +75 -0
  317. package/scripts/add-lang/dump-ast.mjs +103 -0
  318. package/scripts/add-lang/verify-extraction.mjs +70 -0
  319. package/scripts/agent-eval/arms-F.sh +21 -0
  320. package/scripts/agent-eval/arms-matrix.sh +37 -0
  321. package/scripts/agent-eval/bench-readme.sh +28 -0
  322. package/scripts/agent-eval/bench-why-repo.sh +22 -0
  323. package/scripts/agent-eval/block-read-hook.sh +19 -0
  324. package/scripts/agent-eval/hook-settings.json +15 -0
  325. package/scripts/agent-eval/itrun.sh +24 -11
  326. package/scripts/agent-eval/parse-arms.mjs +116 -0
  327. package/scripts/agent-eval/parse-bench-readme.mjs +84 -0
  328. package/scripts/agent-eval/probe-context.mjs +21 -0
  329. package/scripts/agent-eval/probe-explore.mjs +40 -0
  330. package/scripts/agent-eval/probe-node.mjs +20 -0
  331. package/scripts/agent-eval/probe-sweep.mjs +119 -0
  332. package/scripts/agent-eval/probe-trace.mjs +20 -0
  333. package/scripts/agent-eval/run-arms.sh +56 -0
  334. package/scripts/agent-eval/seq-matrix.mjs +137 -0
  335. package/scripts/build-bundle.sh +118 -0
  336. package/scripts/npm-sdk.js +75 -0
  337. package/scripts/npm-shim.js +246 -0
  338. package/scripts/pack-npm.sh +119 -0
  339. package/scripts/prepare-release.mjs +270 -0
  340. package/scripts/patch-tree-sitter-dart.js +0 -112
  341. package/scripts/release.sh +0 -68
package/README.md CHANGED
@@ -2,45 +2,95 @@
2
2
 
3
3
  # CodeGraph
4
4
 
5
- ### Supercharge Claude Code, Cursor, Codex, and OpenCode with Semantic Code Intelligence
5
+ ### Supercharge Claude Code, Cursor, Codex, OpenCode, Hermes Agent, Gemini, Antigravity, and Kiro with Semantic Code Intelligence
6
6
 
7
- **~35% cheaper · ~70% fewer tool calls · 100% local**
7
+ **~16% cheaper · ~58% fewer tool calls · 100% local**
8
+
9
+ ### [Documentation & Website →](https://colbymchenry.github.io/codegraph/)
8
10
 
9
11
  [![npm version](https://img.shields.io/npm/v/@stupidloud/codegraph.svg)](https://www.npmjs.com/package/@stupidloud/codegraph)
10
12
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
11
- [![Node.js](https://img.shields.io/badge/Node.js-20--24-green.svg)](https://nodejs.org/)
13
+ [![Self-contained](https://img.shields.io/badge/Node.js-bundled%20%C2%B7%20none%20required-brightgreen.svg)](https://nodejs.org/)
14
+
15
+ [![Windows](https://img.shields.io/badge/Windows-supported-blue.svg)](#supported-platforms)
16
+ [![macOS](https://img.shields.io/badge/macOS-supported-blue.svg)](#supported-platforms)
17
+ [![Linux](https://img.shields.io/badge/Linux-supported-blue.svg)](#supported-platforms)
18
+
19
+ [![Claude Code](https://img.shields.io/badge/Claude_Code-supported-blueviolet.svg)](#supported-agents)
20
+ [![Cursor](https://img.shields.io/badge/Cursor-supported-blueviolet.svg)](#supported-agents)
21
+ [![Codex](https://img.shields.io/badge/Codex-supported-blueviolet.svg)](#supported-agents)
22
+ [![opencode](https://img.shields.io/badge/opencode-supported-blueviolet.svg)](#supported-agents)
23
+ [![Hermes Agent](https://img.shields.io/badge/Hermes_Agent-supported-blueviolet.svg)](#supported-agents)
24
+ [![Gemini](https://img.shields.io/badge/Gemini-supported-blueviolet.svg)](#supported-agents)
25
+ [![Antigravity](https://img.shields.io/badge/Antigravity-supported-blueviolet.svg)](#supported-agents)
26
+ [![Kiro](https://img.shields.io/badge/Kiro-supported-blueviolet.svg)](#supported-agents)
27
+
28
+ <br>
29
+
30
+ **The CodeGraph platform is coming** — for every PR, know exactly what to test, what could break, which flows are affected, and whether business logic is compromised.
31
+
32
+ <a href="https://getcodegraph.com"><img alt="Join the waitlist for early beta access" src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/waitlist.svg" height="44"></a>
12
33
 
13
- [![Windows](https://img.shields.io/badge/Windows-supported-blue.svg)](#)
14
- [![macOS](https://img.shields.io/badge/macOS-supported-blue.svg)](#)
15
- [![Linux](https://img.shields.io/badge/Linux-supported-blue.svg)](#)
16
- [![Claude Code](https://img.shields.io/badge/Claude_Code-supported-blueviolet.svg)](#)
17
- [![Cursor](https://img.shields.io/badge/Cursor-supported-blueviolet.svg)](#)
18
- [![Codex CLI](https://img.shields.io/badge/Codex_CLI-supported-blueviolet.svg)](#)
19
- [![opencode](https://img.shields.io/badge/opencode-supported-blueviolet.svg)](#)
34
+ <sub>Get <b>early beta access</b> to the hosted product · <a href="https://getcodegraph.com">getcodegraph.com</a></sub>
20
35
 
21
36
  [English](./README.md) · [简体中文](./README.zh-CN.md)
22
37
 
23
- <br />
38
+ </div>
39
+
40
+ ## Get Started
41
+
42
+ ### 1. Install the CLI
24
43
 
25
- ### Get Started
44
+ **No Node.js required** — one command grabs the right build for your OS:
26
45
 
27
46
  ```bash
28
47
  npx @stupidloud/codegraph
29
48
  ```
30
49
 
31
- <sub>Interactive installer auto-configures your agent(s) Claude Code, Cursor, Codex CLI, opencode</sub>
50
+ Already have Node? Use npm instead (works on any version):
51
+
52
+ ```bash
53
+ npx @stupidloud/codegraph # zero-install, or:
54
+ npm i -g @stupidloud/codegraph
55
+ ```
32
56
 
33
- #### Initialize Projects
57
+ <sub>CodeGraph bundles its own runtime — nothing to compile, no native build, works the same everywhere. The installer puts `codegraph` on your PATH but **doesn't change your current shell** — open a new terminal before the next step so the command resolves.</sub>
58
+
59
+ ### 2. Wire up your agent(s)
60
+
61
+ In a **new terminal**, run the installer to connect CodeGraph to the agents you use:
62
+
63
+ ```bash
64
+ codegraph install
65
+ ```
66
+
67
+ <sub>Detects and auto-configures Claude Code, Cursor, Codex CLI, opencode, Hermes Agent, Gemini CLI, Antigravity IDE, and Kiro — wiring the CodeGraph MCP server into each. **This is the step that connects CodeGraph to your agent;** installing the CLI in step 1 does not do it on its own. (Shortcut: `npx @colbymchenry/codegraph` downloads and runs this in one go.)</sub>
68
+
69
+ ### 3. Initialize each project
34
70
 
35
71
  ```bash
36
72
  cd your-project
37
73
  codegraph init -i
38
74
  ```
39
75
 
76
+ <sub>`codegraph init` just creates the local `.codegraph/` index directory; adding `-i` (`--index`) also builds the initial graph in the same step. Without `-i`, run `codegraph index` afterwards to populate it.</sub>
77
+
78
+ <div align="center">
79
+
40
80
  ![1_C_VYnhpys0UHrOuOgpgoyw](https://github.com/user-attachments/assets/f168182f-4d9a-44e0-94d7-08d018cc8a3a)
41
81
 
42
82
  </div>
43
83
 
84
+ ### Uninstall
85
+
86
+ Changed your mind? One command removes CodeGraph from every agent it configured:
87
+
88
+ ```bash
89
+ codegraph uninstall
90
+ ```
91
+
92
+ <sub>Reverses the installer — strips CodeGraph's MCP server config, instructions, and permissions from each configured agent. Your project indexes (`.codegraph/`) are left untouched; remove those per-project with `codegraph uninit`. Use `--target` to remove from specific agents, or `--yes` to run non-interactively.</sub>
93
+
44
94
  ---
45
95
 
46
96
  ## Why CodeGraph?
@@ -51,26 +101,101 @@ When Claude Code explores a codebase, it spawns **Explore agents** that scan fil
51
101
 
52
102
  ### Benchmark Results
53
103
 
54
- Tested across **7 real-world open-source codebases** spanning 7 languages, comparing an agent (Claude Code, headless) answering one architecture question **with** and **without** CodeGraph. Each cell is the savings at the **median of 4 runs per arm**.
104
+ Tested across **7 real-world open-source codebases** spanning 7 languages, comparing an agent (Claude Code, headless) answering one architecture question **with** and **without** CodeGraph. Each cell is the savings at the **median of 4 runs per arm**. _Re-validated on Opus 4.8 (2026-06-02), on the current build (`codegraph_explore` as the primary tool)._
55
105
 
56
- > **Average: 35% cheaper · 59% fewer tokens · 49% faster · 70% fewer tool calls**
106
+ > **Average: 16% cheaper · 47% fewer tokens · 22% faster · 58% fewer tool calls**
57
107
 
58
108
  | Codebase | Language | Cost | Tokens | Time | Tool calls |
59
109
  |----------|----------|------|--------|------|------------|
60
- | **VS Code** | TypeScript · ~10k files | 35% cheaper | 73% fewer | 41% faster | 72% fewer |
61
- | **Excalidraw** | TypeScript · ~600 | 47% cheaper | 73% fewer | 60% faster | 86% fewer |
62
- | **Django** | Python · ~2.7k | 34% cheaper | 64% fewer | 59% faster | 81% fewer |
63
- | **Tokio** | Rust · ~700 | 52% cheaper | 81% fewer | 63% faster | 89% fewer |
64
- | **OkHttp** | Java · ~640 | 17% cheaper | 41% fewer | 36% faster | 64% fewer |
65
- | **Gin** | Go · ~150 | 22% cheaper | 23% fewer | 34% faster | 19% fewer |
66
- | **Alamofire** | Swift · ~100 | 38% cheaper | 59% fewer | 51% faster | 77% fewer |
110
+ | **VS Code** | TypeScript · ~10k files | 18% cheaper | 64% fewer | 11% faster | 81% fewer |
111
+ | **Excalidraw** | TypeScript · ~640 | even | 25% fewer | 27% faster | 40% fewer |
112
+ | **Django** | Python · ~3k | 8% cheaper | 60% fewer | 13% faster | 77% fewer |
113
+ | **Tokio** | Rust · ~790 | even | 38% fewer | 18% faster | 57% fewer |
114
+ | **OkHttp** | Java · ~645 | 25% cheaper | 54% fewer | 31% faster | 50% fewer |
115
+ | **Gin** | Go · ~110 | 19% cheaper | 23% fewer | 24% faster | 44% fewer |
116
+ | **Alamofire** | Swift · ~110 | 40% cheaper | 64% fewer | 33% faster | 58% fewer |
117
+
118
+ CodeGraph cuts **tokens, tool calls, and wall-clock time on every repo** — across small, medium, and large codebases — and answers them with **near-zero file reads**, while the no-CodeGraph agent spends its budget on grep/find/Read discovery. `codegraph_explore` shows the answer in full — the mechanism plus the exact methods you asked about, even when they're buried in a multi-thousand-line file — while collapsing redundant interchangeable implementations to signatures, so the response is sized to the *answer* rather than the file count. **Cost stays flat-to-cheaper everywhere** — largest on the small repos (Alamofire, OkHttp), roughly break-even on the most response-heavy ones (Excalidraw, Tokio), where CodeGraph trades the no-CodeGraph agent's many small grep/read round-trips for a few large, cache-heavy tool responses.
67
119
 
68
- The gains scale with codebase size: on large repos the agent answers from the index in a handful of calls with **zero file reads**, while the no-CodeGraph agent fans out across grep/find/Read (and the sub-agents it spawns). On a small repo like Gin (~150 files) native search is already cheap, so the margin narrows.
120
+ <details>
121
+ <summary><strong>Per-repo breakdown — WITH vs WITHOUT (median of 4)</strong></summary>
122
+
123
+ **VS Code** · ~10k files
124
+ | Metric | WITH cg | WITHOUT cg | Δ |
125
+ |---|---|---|---|
126
+ | Time | 1m 59s | 2m 13s | 11% faster |
127
+ | File Reads | 0 | 9 | −9 |
128
+ | Grep/Bash | 0 | 11 | −11 |
129
+ | Tool calls | 4 | 21 | 81% fewer |
130
+ | Total tokens | 640k | 1.79M | 64% fewer |
131
+ | Cost | $0.68 | $0.83 | 18% cheaper |
132
+
133
+ **Excalidraw** · ~640 files
134
+ | Metric | WITH cg | WITHOUT cg | Δ |
135
+ |---|---|---|---|
136
+ | Time | 1m 32s | 2m 6s | 27% faster |
137
+ | File Reads | 0 | 7 | −7 |
138
+ | Grep/Bash | 1 | 8 | −7 |
139
+ | Tool calls | 9 | 15 | 40% fewer |
140
+ | Total tokens | 1.27M | 1.69M | 25% fewer |
141
+ | Cost | $0.78 | $0.78 | even |
142
+
143
+ **Django** · ~3k files
144
+ | Metric | WITH cg | WITHOUT cg | Δ |
145
+ |---|---|---|---|
146
+ | Time | 1m 43s | 1m 58s | 13% faster |
147
+ | File Reads | 0 | 9 | −9 |
148
+ | Grep/Bash | 0 | 5 | −5 |
149
+ | Tool calls | 3 | 13 | 77% fewer |
150
+ | Total tokens | 559k | 1.41M | 60% fewer |
151
+ | Cost | $0.57 | $0.62 | 8% cheaper |
152
+
153
+ **Tokio** · ~790 files
154
+ | Metric | WITH cg | WITHOUT cg | Δ |
155
+ |---|---|---|---|
156
+ | Time | 1m 55s | 2m 20s | 18% faster |
157
+ | File Reads | 0 | 8 | −8 |
158
+ | Grep/Bash | 0 | 6 | −6 |
159
+ | Tool calls | 6 | 14 | 57% fewer |
160
+ | Total tokens | 1.08M | 1.73M | 38% fewer |
161
+ | Cost | $0.82 | $0.82 | even |
162
+
163
+ **OkHttp** · ~645 files
164
+ | Metric | WITH cg | WITHOUT cg | Δ |
165
+ |---|---|---|---|
166
+ | Time | 1m 1s | 1m 29s | 31% faster |
167
+ | File Reads | 0 | 4 | −4 |
168
+ | Grep/Bash | 2 | 6 | −4 |
169
+ | Tool calls | 5 | 10 | 50% fewer |
170
+ | Total tokens | 502k | 1.10M | 54% fewer |
171
+ | Cost | $0.41 | $0.55 | 25% cheaper |
172
+
173
+ **Gin** · ~110 files
174
+ | Metric | WITH cg | WITHOUT cg | Δ |
175
+ |---|---|---|---|
176
+ | Time | 1m 14s | 1m 37s | 24% faster |
177
+ | File Reads | 1 | 6 | −5 |
178
+ | Grep/Bash | 1 | 2 | −1 |
179
+ | Tool calls | 5 | 9 | 44% fewer |
180
+ | Total tokens | 651k | 847k | 23% fewer |
181
+ | Cost | $0.46 | $0.57 | 19% cheaper |
182
+
183
+ **Alamofire** · ~110 files
184
+ | Metric | WITH cg | WITHOUT cg | Δ |
185
+ |---|---|---|---|
186
+ | Time | 1m 35s | 2m 21s | 33% faster |
187
+ | File Reads | 0 | 9 | −9 |
188
+ | Grep/Bash | 0 | 4 | −4 |
189
+ | Tool calls | 5 | 12 | 58% fewer |
190
+ | Total tokens | 766k | 2.10M | 64% fewer |
191
+ | Cost | $0.57 | $0.95 | 40% cheaper |
192
+
193
+ </details>
69
194
 
70
195
  <details>
71
196
  <summary><strong>Full benchmark details</strong></summary>
72
197
 
73
- **Methodology.** Each arm is `claude -p` (Claude Opus 4.7, Claude Code v2.1.145) run headlessly against the repo with `--strict-mcp-config`: **WITH** = CodeGraph's MCP server enabled, **WITHOUT** = an empty MCP config. Built-in Read/Grep/Bash stay available to both. Same question per repo, **4 runs per arm, median reported**. Cost = the run's `total_cost_usd`; Tokens = total tokens processed (input incl. cached + output); Time = wall-clock; Tool calls = every tool invocation, including those inside any sub-agents the model spawns. Repos cloned at `--depth 1` and indexed by the same CodeGraph build that served them.
198
+ **Methodology.** Each arm is `claude -p` (Claude Opus 4.8) run headlessly against the repo with `--strict-mcp-config`: **WITH** = CodeGraph's MCP server enabled, **WITHOUT** = an empty MCP config. Built-in Read/Grep/Bash stay available to both. Same question per repo, **4 runs per arm, median reported**. Cost = the run's `total_cost_usd`; Tokens = total tokens processed (input incl. cached + output); Time = wall-clock; Tool calls = every tool invocation, including those inside any sub-agents the model spawns. Repos cloned at `--depth 1` and indexed by the same CodeGraph build that served them. Re-validated 2026-06-02 on the current build. These numbers are lower than the prior Opus 4.7 validation — not a CodeGraph regression but a stronger native baseline: Opus 4.8 greps/reads efficiently on the main thread instead of fanning out into large Explore-subagent sweeps, so the no-CodeGraph arm is leaner than it used to be. Per-repo numbers move run-to-run with how hard the without-arm thrashes (the median-of-4 smooths it, but tails remain — e.g. Django's without-arm hit $2.71/14m one batch).
74
199
 
75
200
  **Queries:**
76
201
  | Codebase | Query |
@@ -83,18 +208,7 @@ The gains scale with codebase size: on large repos the agent answers from the in
83
208
  | Gin | "How does gin route requests through its middleware chain?" |
84
209
  | Alamofire | "How does Alamofire build, send, and validate a request?" |
85
210
 
86
- **Raw mediansWITH WITHOUT:**
87
- | Codebase | Cost | Tokens | Time | Tool calls |
88
- |----------|------|--------|------|------------|
89
- | VS Code | $0.42 → $0.64 | 393k → 1.4M | 1m 0s → 1m 43s | 7 → 23 |
90
- | Excalidraw | $0.54 → $1.02 | 851k → 3.2M | 1m 17s → 3m 14s | 12 → 83 |
91
- | Django | $0.41 → $0.62 | 499k → 1.4M | 1m 0s → 2m 25s | 9 → 48 |
92
- | Tokio | $0.50 → $1.04 | 657k → 3.4M | 1m 5s → 2m 56s | 9 → 75 |
93
- | OkHttp | $0.36 → $0.44 | 352k → 596k | 45s → 1m 11s | 5 → 14 |
94
- | Gin | $0.36 → $0.46 | 431k → 562k | 47s → 1m 11s | 7 → 8 |
95
- | Alamofire | $0.61 → $0.99 | 1.1M → 2.6M | 1m 19s → 2m 41s | 15 → 64 |
96
-
97
- **Why CodeGraph wins:** with the index available, the agent answers directly — `codegraph_context` to map the area, then one `codegraph_explore` for the relevant source — and stops, usually with zero file reads. Without it, the agent (and the Explore sub-agents it spawns) spends most of its budget on discovery (find/ls/grep) before reading the right code. CodeGraph only helps when queried *directly*, so its instructions steer agents to answer directly rather than delegate exploration to file-reading sub-agents — otherwise a sub-agent reads files regardless and CodeGraph becomes overhead.
211
+ **Why CodeGraph wins:** with the index available, the agent answers directly usually one `codegraph_explore` returns the relevant source — and stops, usually with zero file reads. Without it, the agent spends most of its budget on discovery (find/ls/grep) before reading the right code. CodeGraph only helps when queried *directly*, so its instructions steer agents to answer directly rather than delegate exploration to file-reading sub-agents — otherwise a sub-agent reads files regardless and CodeGraph becomes overhead.
98
212
 
99
213
  </details>
100
214
 
@@ -108,10 +222,38 @@ The gains scale with codebase size: on large repos the agent answers from the in
108
222
  | **Full-Text Search** | Find code by name instantly across your entire codebase, powered by FTS5 |
109
223
  | **Impact Analysis** | Trace callers, callees, and the full impact radius of any symbol before making changes |
110
224
  | **Always Fresh** | File watcher uses native OS events (FSEvents/inotify/ReadDirectoryChangesW) with debounced auto-sync — the graph stays current as you code, zero config |
111
- | **19+ Languages** | TypeScript, JavaScript, Python, Go, Rust, Java, C#, PHP, Ruby, C, C++, Swift, Kotlin, Dart, Svelte, Liquid, Pascal/Delphi |
112
- | **Framework-aware Routes** | Recognizes web-framework routing files and links URL patterns to their handlers across 13 frameworks |
225
+ | **20+ Languages** | TypeScript, JavaScript, Python, Go, Rust, Java, C#, PHP, Ruby, C, C++, Objective-C, Swift, Kotlin, Dart, Lua, Luau, Svelte, Liquid, Pascal/Delphi |
226
+ | **Framework-aware Routes** | Recognizes web-framework routing files and links URL patterns to their handlers across 14 frameworks |
227
+ | **Mixed iOS / React Native / Expo** | Closes cross-language flows that static parsing misses: Swift ↔ ObjC bridging, React Native legacy bridge + TurboModules + Fabric view components, native → JS event emitters, Expo Modules |
113
228
  | **100% Local** | No data leaves your machine. No API keys. No external services. SQLite database only |
114
229
 
230
+ <details>
231
+ <summary><strong>How auto-syncing works — and why you don't need to run <code>codegraph sync</code> manually</strong></summary>
232
+
233
+ When your agent (Claude Code, Cursor, Codex, opencode) launches `codegraph serve --mcp`, three layers keep the index in step with your code — and make sure the agent never gets a silent wrong answer in the brief window between an edit and the next sync:
234
+
235
+ 1. **File watcher with debounced auto-sync.** A native FSEvents / inotify / ReadDirectoryChangesW watcher captures every source-file create / modify / delete and triggers a re-index after a debounce window (default `2000ms`, tunable via `CODEGRAPH_WATCH_DEBOUNCE_MS`, clamped to `[100ms, 60s]`). Bursts of edits collapse into a single sync.
236
+
237
+ 2. **Per-file staleness banner.** During the brief debounce window, MCP tool responses that would reference a still-pending file prepend a `⚠️` banner naming it and telling the agent to `Read` it directly. Pending files NOT referenced by the response surface as a small footer instead. Either way, the agent gets an explicit signal — validated with Claude Code, where the agent literally says "Reading the file directly for the live content" before opening it.
238
+
239
+ 3. **Connect-time catch-up.** When the MCP server (re)connects, codegraph runs a fast `(size, mtime)` + content-hash reconciliation against the working tree before answering the first query — so edits made while no MCP server was running (a `git pull` from the terminal, edits from another editor, a previous agent session that exited) get absorbed on the next session's first tool call.
240
+
241
+ ```
242
+ agent writes src/Widget.ts
243
+ → watcher fires (<100ms)
244
+ → debounce (default 2s)
245
+ → sync; Widget.ts is in the index
246
+ → next agent query sees it
247
+ ```
248
+
249
+ **Verify any time** with `codegraph_status` (via MCP) or `codegraph status` (CLI). If anything is pending, you'll see a `### Pending sync:` section naming the files and their edit age.
250
+
251
+ The handful of cases where manual `codegraph sync` makes sense: the watcher is disabled (sandboxed environments, or `CODEGRAPH_NO_DAEMON=1`), or you're scripting against the index outside an agent session and want a pre-flight sync at the start of your script.
252
+
253
+ → Full deep-dive in [Guides → Indexing a Project](https://colbymchenry.github.io/codegraph/guides/indexing/#stay-fresh-automatically).
254
+
255
+ </details>
256
+
115
257
  ---
116
258
 
117
259
  ## Framework-aware Routes
@@ -126,6 +268,7 @@ CodeGraph detects web-framework routing files and emits `route` nodes linked by
126
268
  | **Express** | `app.get(...)`, `router.post(...)` with middleware chains |
127
269
  | **NestJS** | `@Controller` + `@Get/@Post/...`, GraphQL `@Resolver` + `@Query/@Mutation`, `@MessagePattern`/`@EventPattern`, `@SubscribeMessage` |
128
270
  | **Laravel** | `Route::get()`, `Route::resource()`, `Controller@action`, tuple syntax |
271
+ | **Drupal** | `*.routing.yml` routes (`_controller`, `_form`, entity handlers); `hook_*` implementations in `.module`/`.theme`/`.install`/`.inc` |
129
272
  | **Rails** | `get '/x', to: 'users#index'`, hash-rocket `=>` syntax |
130
273
  | **Spring** | `@GetMapping`, `@PostMapping`, `@RequestMapping` on methods |
131
274
  | **Gin / chi / gorilla / mux** | `r.GET(...)`, `router.HandleFunc(...)` |
@@ -136,6 +279,35 @@ CodeGraph detects web-framework routing files and emits `route` nodes linked by
136
279
 
137
280
  ---
138
281
 
282
+ ## Mixed iOS / React Native / Expo bridging
283
+
284
+ Real iOS and React Native codebases live across multiple languages — a Swift caller invokes an Objective-C selector that's been auto-bridged, a JS file calls into a native module via the React Native bridge, a JSX component delegates to a native view manager. Static tree-sitter extraction stops at each language boundary. CodeGraph bridges them so `trace`, `callers`, `callees`, and `impact` connect end-to-end across the gap.
285
+
286
+ | Boundary | JS / Swift side | Native side | How |
287
+ |---|---|---|---|
288
+ | **Swift → ObjC** | Swift `obj.foo(bar:)` | ObjC selector `-fooWithBar:` | `@objc` auto-bridging rules (including init/property/protocol forms) + Cocoa preposition prefixes (`With`/`For`/`By`/`In`/`On`/`At`/…) |
289
+ | **ObjC → Swift** | ObjC `[obj fooWithBar:]` | Swift `@objc func foo(bar:)` | Reverse-bridge name candidates; verifies `@objc` exposure from source |
290
+ | **React Native legacy bridge** | JS `NativeModules.X.fn(...)` | ObjC `RCT_EXPORT_METHOD` / `RCT_REMAP_METHOD` · Java/Kotlin `@ReactMethod` | Parses macro/annotation declarations to build a JS-name → native-method map |
291
+ | **React Native TurboModules** | JS `import M from './NativeM'; M.fn(...)` | Native impl matching the Codegen spec | Treats the `Native<X>.ts` spec interface as ground truth |
292
+ | **RN native → JS events** | JS `new NativeEventEmitter(...).addListener('e', cb)` | ObjC `[self sendEventWithName:@"e" body:...]` · Swift `sendEvent(withName: "e", ...)` · Java/Kotlin `.emit("e", ...)` | Synthesized cross-language event channel keyed by literal event name |
293
+ | **Expo Modules** | JS `requireNativeModule('X').fn(...)` | Swift / Kotlin `Module { Name("X"); AsyncFunction("fn") { ... } }` | Parses the Expo DSL literals; synthetic method nodes resolve via existing name-match |
294
+ | **Fabric view components** | JSX `<MyView prop={v}/>` | TS Codegen spec + native impl class | Spec → `component` node; convention-based name+suffix lookup (`View`/`ComponentView`/`Manager`/`ViewManager`) bridges to native |
295
+ | **Legacy Paper view managers** | JSX `<MyView prop={v}/>` | ObjC `RCT_EXPORT_VIEW_PROPERTY` · Java/Kotlin `@ReactProp` | Same as Fabric — Paper-era declarations also produce `component` + `property` nodes |
296
+
297
+ **Validated on real codebases** (small + medium + large for each bridge):
298
+
299
+ | Bridge | Small | Medium | Large |
300
+ |---|---|---|---|
301
+ | Swift ↔ ObjC | [Charts](https://github.com/danielgindi/Charts) | [realm-swift](https://github.com/realm/realm-swift) | [Wikipedia-iOS](https://github.com/wikimedia/wikipedia-ios) |
302
+ | RN legacy bridge | [AsyncStorage](https://github.com/react-native-async-storage/async-storage) | [react-native-svg](https://github.com/software-mansion/react-native-svg) | [react-native-firebase](https://github.com/invertase/react-native-firebase) |
303
+ | RN native → JS events | [RNGeolocation](https://github.com/Agontuk/react-native-geolocation-service) | — | react-native-firebase |
304
+ | Expo Modules | expo-haptics | expo-camera | expo SDK sweep (7 packages) |
305
+ | Fabric / Paper views | [react-native-segmented-control](https://github.com/react-native-segmented-control/segmented-control) | [react-native-screens](https://github.com/software-mansion/react-native-screens) | [react-native-skia](https://github.com/Shopify/react-native-skia) |
306
+
307
+ Each bridge emits edges tagged `provenance:'heuristic'` with `metadata.synthesizedBy:` set to a stable channel name (e.g. `swift-objc-bridge`, `rn-event-channel`, `fabric-native-impl`, `expo-module-extract`), so the agent can tell at a glance how a hop got into the graph.
308
+
309
+ ---
310
+
139
311
  ## Quick Start
140
312
 
141
313
  ### 1. Run the Installer
@@ -145,10 +317,10 @@ npx @stupidloud/codegraph
145
317
  ```
146
318
 
147
319
  The installer will:
148
- - Ask which agent(s) to configure — auto-detects installed ones from: **Claude Code**, **Cursor**, **Codex CLI**, **opencode**
320
+ - Ask which agent(s) to configure — auto-detects installed ones from: **Claude Code**, **Cursor**, **Codex CLI**, **opencode**, **Hermes Agent**, **Gemini CLI**, **Antigravity IDE**, **Kiro**
149
321
  - Prompt to install `codegraph` on your PATH (so agents can launch the MCP server)
150
322
  - Ask whether configs apply to all your projects or just this one
151
- - Write each chosen agent's MCP server config + an instructions file (e.g. `CLAUDE.md`, `.cursor/rules/codegraph.mdc`, `~/.codex/AGENTS.md`)
323
+ - Write each chosen agent's MCP server config (the codegraph usage guide is delivered by the MCP server itself, so no instructions file is added to `CLAUDE.md` / `AGENTS.md` / etc.)
152
324
  - Set up auto-allow permissions when Claude Code is one of the targets
153
325
  - Initialize your current project (local installs only)
154
326
 
@@ -171,7 +343,7 @@ codegraph install --print-config codex # print snippet, no file wr
171
343
 
172
344
  ### 2. Restart Your Agent
173
345
 
174
- Restart your agent (Claude Code / Cursor / Codex CLI / opencode) for the MCP server to load.
346
+ Restart your agent (Claude Code / Cursor / Codex CLI / opencode / Hermes Agent / Gemini CLI / Antigravity IDE / Kiro) for the MCP server to load.
175
347
 
176
348
  ### 3. Initialize Projects
177
349
 
@@ -180,7 +352,7 @@ cd your-project
180
352
  codegraph init -i
181
353
  ```
182
354
 
183
- Builds the per-project knowledge graph index. Also wires up any project-local agent surfaces (e.g. Cursor's `.cursor/rules/codegraph.mdc`) so a single global `codegraph install` works in every project you open — no need to re-run the installer per project.
355
+ Builds the per-project knowledge graph index. A single global `codegraph install` works in every project you open — no need to re-run the installer per project.
184
356
 
185
357
  That's it — your agent will use CodeGraph tools automatically when a `.codegraph/` directory exists.
186
358
 
@@ -211,7 +383,7 @@ npm install -g @stupidloud/codegraph
211
383
  "permissions": {
212
384
  "allow": [
213
385
  "mcp__codegraph__codegraph_search",
214
- "mcp__codegraph__codegraph_context",
386
+ "mcp__codegraph__codegraph_explore",
215
387
  "mcp__codegraph__codegraph_callers",
216
388
  "mcp__codegraph__codegraph_callees",
217
389
  "mcp__codegraph__codegraph_impact",
@@ -226,43 +398,16 @@ npm install -g @stupidloud/codegraph
226
398
  </details>
227
399
 
228
400
  <details>
229
- <summary><strong>Global Instructions Reference</strong></summary>
230
-
231
- The installer automatically adds these instructions to `~/.claude/CLAUDE.md`:
232
-
233
- ```markdown
234
- ## CodeGraph
235
-
236
- CodeGraph builds a semantic knowledge graph of codebases for faster, smarter code exploration.
401
+ <summary><strong>Agent Tool Guidance</strong></summary>
237
402
 
238
- ### If `.codegraph/` exists in the project
403
+ CodeGraph's MCP server delivers its usage guidance to your agent **automatically**, in the MCP `initialize` response — there's no instructions file to manage and nothing is added to your `CLAUDE.md` / `AGENTS.md` / `GEMINI.md`. In short, it tells the agent to:
239
404
 
240
- **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?").
405
+ - **Answer structural questions directly with CodeGraph** it *is* the pre-built index, so a grep/read loop just repeats work it already did. Treat the returned source as already read.
406
+ - **Pick the tool by intent:** `codegraph_explore` for almost anything — "how does X work", a flow/"how does X reach Y", or surveying an area (one call returns the relevant symbols' source grouped by file); `codegraph_search` to just locate a symbol; `codegraph_callers`/`codegraph_callees` to walk call flow; `codegraph_impact` before editing; `codegraph_node` for one specific symbol's full source (it returns every overload for an ambiguous name).
407
+ - **Trust the results — don't re-verify with grep**, and check the staleness banner after edits.
408
+ - If `.codegraph/` doesn't exist yet, offer to run `codegraph init -i`.
241
409
 
242
- **When spawning Explore agents**, include this instruction in the prompt:
243
-
244
- > 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.
245
- >
246
- > **Rules:**
247
- > 1. Follow the explore call budget in the `codegraph_explore` tool description — it scales automatically based on project size.
248
- > 2. Do NOT re-read files that codegraph_explore already returned source code for. The source sections are complete and authoritative.
249
- > 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.
250
-
251
- **The main session may only use these lightweight tools directly** (for targeted lookups before making edits, not for exploration):
252
-
253
- | Tool | Use For |
254
- |------|---------|
255
- | `codegraph_search` | Find symbols by name |
256
- | `codegraph_callers` / `codegraph_callees` | Trace call flow |
257
- | `codegraph_impact` | Check what's affected before editing |
258
- | `codegraph_node` | Get a single symbol's details |
259
-
260
- ### If `.codegraph/` does NOT exist
261
-
262
- At the start of a session, ask the user if they'd like to initialize CodeGraph:
263
-
264
- "I notice this project doesn't have CodeGraph initialized. Would you like me to run `codegraph init -i` to build a code knowledge graph?"
265
- ```
410
+ The exact text is `src/mcp/server-instructions.ts` the single source of truth.
266
411
 
267
412
  </details>
268
413
 
@@ -271,34 +416,23 @@ At the start of a session, ask the user if they'd like to initialize CodeGraph:
271
416
  ## How It Works
272
417
 
273
418
  ```
274
- ┌─────────────────────────────────────────────────────────────────┐
275
- │ Claude Code │
276
- │ │
277
- │ "Implement user authentication" │
278
- │ │ │
279
- │ ▼ │
280
- │ ┌─────────────────┐ ┌─────────────────┐ │
281
- │ │ Explore Agent │ ──── │ Explore Agent │ │
282
- │ └────────┬────────┘ └────────┬────────┘ │
283
- │ │ │ │
284
- └───────────┼────────────────────────┼─────────────────────────────┘
285
- │ │
286
- ▼ ▼
287
419
  ┌───────────────────────────────────────────────────────────────────┐
288
- CodeGraph MCP Server
289
- ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
290
- Search │ Callers │ │ Context │ │
291
- │ "auth" │ │ "login()" │ │ for task
292
- └──────┬──────┘ └──────┬──────┘ └──────┬──────┘
293
- │ │ │ │ │
294
- └────────────────┼────────────────┘ │
295
-
296
- │ ┌───────────────────────┐ │
297
- │ SQLite Graph DB
298
- • 387 symbols │ │
299
- │ • 1,204 edges
300
- • Instant lookups
301
- └───────────────────────┘
420
+ Claude Code
421
+
422
+ "How does a request reach the database?"
423
+ calls CodeGraph tools directly — no Explore sub-agent
424
+
425
+ └─────────────────────────────────┬─────────────────────────────────┘
426
+
427
+
428
+ ┌───────────────────────────────────────────────────────────────────┐
429
+ CodeGraph MCP Server
430
+
431
+ explore · search · callers · callees · impact · node
432
+
433
+
434
+ │ SQLite knowledge graph │
435
+ │ symbols · edges · files · FTS5 full-text search │
302
436
  └───────────────────────────────────────────────────────────────────┘
303
437
  ```
304
438
 
@@ -317,6 +451,7 @@ At the start of a session, ask the user if they'd like to initialize CodeGraph:
317
451
  ```bash
318
452
  codegraph # Run interactive installer
319
453
  codegraph install # Run installer (explicit)
454
+ codegraph uninstall # Remove CodeGraph from your agents (inverse of install)
320
455
  codegraph init [path] # Initialize in a project (--index to also index)
321
456
  codegraph uninit [path] # Remove CodeGraph from a project (--force to skip prompt)
322
457
  codegraph index [path] # Full index (--force to re-index, --quiet for less output)
@@ -324,7 +459,9 @@ codegraph sync [path] # Incremental update
324
459
  codegraph status [path] # Show statistics
325
460
  codegraph query <search> # Search symbols (--kind, --limit, --json)
326
461
  codegraph files [path] # Show file structure (--format, --filter, --max-depth, --json)
327
- codegraph context <task> # Build context for AI (--format, --max-nodes)
462
+ codegraph callers <symbol> # Find what calls a function/method (--limit, --json)
463
+ codegraph callees <symbol> # Find what a function/method calls (--limit, --json)
464
+ codegraph impact <symbol> # Analyze what code is affected by changing a symbol (--depth, --json)
328
465
  codegraph affected [files...] # Find test files affected by changes (see below)
329
466
  codegraph serve --mcp # Start MCP server
330
467
  ```
@@ -365,12 +502,12 @@ When running as an MCP server, CodeGraph exposes these tools to Claude Code:
365
502
 
366
503
  | Tool | Purpose |
367
504
  |------|---------|
505
+ | `codegraph_explore` | **Primary.** Answer almost any question in one call — "how does X work", a flow ("how does X reach Y"), or surveying an area — returning the relevant symbols' verbatim source grouped by file, plus a relationship map and blast radius. Surfaces dynamic-dispatch hops (callbacks, React re-render, interface→impl) grep can't follow. |
368
506
  | `codegraph_search` | Find symbols by name across the codebase |
369
- | `codegraph_context` | Build relevant code context for a task |
370
507
  | `codegraph_callers` | Find what calls a function |
371
508
  | `codegraph_callees` | Find what a function calls |
372
509
  | `codegraph_impact` | Analyze what code is affected by changing a symbol |
373
- | `codegraph_node` | Get details about a specific symbol (optionally with source code) |
510
+ | `codegraph_node` | Get one specific symbol's details + full source (returns every overload for an ambiguous name) |
374
511
  | `codegraph_files` | Get indexed file structure (faster than filesystem scanning) |
375
512
  | `codegraph_status` | Check index health and statistics |
376
513
 
@@ -378,8 +515,14 @@ When running as an MCP server, CodeGraph exposes these tools to Claude Code:
378
515
 
379
516
  ## Library Usage
380
517
 
518
+ CodeGraph can be embedded directly. The npm package re-exports its programmatic
519
+ API, so both `import` and `require` resolve the `CodeGraph` class in your own
520
+ process — handy for embedding it in an app (e.g. an Electron main process).
521
+
381
522
  ```typescript
382
523
  import CodeGraph from '@stupidloud/codegraph';
524
+ // CommonJS works too:
525
+ // const { CodeGraph } = require('@stupidloud/codegraph');
383
526
 
384
527
  const cg = await CodeGraph.init('/path/to/project');
385
528
  // Or: const cg = await CodeGraph.open('/path/to/project');
@@ -398,32 +541,72 @@ cg.unwatch(); // stop watching
398
541
  cg.close();
399
542
  ```
400
543
 
544
+ Lower-level building blocks are exported from the same entry point for callers
545
+ that drive the graph directly: `DatabaseConnection`, `QueryBuilder`,
546
+ `getDatabasePath`, `initGrammars` / `loadGrammarsForLanguages`, and `FileLock`.
547
+
548
+ **Embedding requirements**
549
+
550
+ - Install from npm (`npm i @colbymchenry/codegraph`) so the matching
551
+ per-platform package — which carries the compiled library and its
552
+ dependencies — is fetched alongside the shim.
553
+ - The API runs on **your** runtime, so it needs **Node 22.5+** for the built-in
554
+ `node:sqlite` (Electron qualifies when its bundled Node is 22.5+). The CLI and
555
+ MCP server are unaffected — they run on the self-contained bundled runtime.
556
+ - TypeScript types ship with the package. As with any Node-targeting library,
557
+ keep `@types/node` available and `skipLibCheck: true` (the common default).
558
+
401
559
  ---
402
560
 
403
561
  ## Configuration
404
562
 
405
- The `.codegraph/config.json` file controls indexing:
563
+ There isn't any — CodeGraph is zero-config, with **no config file** to write or
564
+ keep in sync. Language support is automatic from the file extension; there's
565
+ nothing to wire up per language.
406
566
 
407
- ```json
408
- {
409
- "version": 1,
410
- "languages": ["typescript", "javascript"],
411
- "exclude": ["node_modules/**", "dist/**", "build/**", "*.min.js"],
412
- "frameworks": [],
413
- "maxFileSize": 1048576,
414
- "extractDocstrings": true,
415
- "trackCallSites": true
416
- }
417
- ```
567
+ What it skips out of the box:
418
568
 
419
- | Option | Description | Default |
420
- |--------|-------------|---------|
421
- | `languages` | Languages to index (auto-detected if empty) | `[]` |
422
- | `exclude` | Glob patterns to ignore | `["node_modules/**", ...]` |
423
- | `frameworks` | Framework hints for better resolution | `[]` |
424
- | `maxFileSize` | Skip files larger than this (bytes) | `1048576` (1MB) |
425
- | `extractDocstrings` | Extract docstrings from code | `true` |
426
- | `trackCallSites` | Track call site locations | `true` |
569
+ - **Dependency, build, and cache directories** — `node_modules`, `vendor`,
570
+ `dist`, `build`, `target`, `.venv`, `Pods`, `.next`, and the like across every
571
+ [supported stack](#supported-languages) so the graph is your code, not
572
+ third-party noise. This holds even with no `.gitignore`.
573
+ - **Anything in your `.gitignore`** honored in git repos via git, and in
574
+ non-git projects by reading `.gitignore` directly (root and nested).
575
+ - **Files larger than 1 MB** generated bundles, minified JS, vendored blobs.
576
+
577
+ To keep something else out, add it to `.gitignore`. To pull a default-excluded
578
+ directory back **in** (say you really do want a vendored dependency indexed),
579
+ add a negation — `!vendor/`. The defaults apply uniformly, so committing a
580
+ dependency or build directory doesn't force it into the graph; the `.gitignore`
581
+ negation is the explicit opt-in.
582
+
583
+ ## Supported Platforms
584
+
585
+ Every release ships a self-contained build (bundled Node runtime — nothing to
586
+ compile) for all three desktop OSes, on both Intel/AMD (x64) and ARM (arm64):
587
+
588
+ | Platform | Architectures | Install |
589
+ |----------|---------------|---------|
590
+ | Windows | x64, arm64 | PowerShell installer or npm |
591
+ | macOS | x64, arm64 | shell installer or npm |
592
+ | Linux | x64, arm64 | shell installer or npm |
593
+
594
+ See [Get Started](#get-started) for the one-line install commands.
595
+
596
+ ## Supported Agents
597
+
598
+ The interactive installer auto-detects and configures each of these — wiring up
599
+ the MCP server (which delivers its own usage guidance, so no instructions file
600
+ is written):
601
+
602
+ - **Claude Code**
603
+ - **Cursor**
604
+ - **Codex CLI**
605
+ - **opencode**
606
+ - **Hermes Agent**
607
+ - **Gemini CLI**
608
+ - **Antigravity IDE**
609
+ - **Kiro**
427
610
 
428
611
  ## Supported Languages
429
612
 
@@ -440,6 +623,7 @@ The `.codegraph/config.json` file controls indexing:
440
623
  | Ruby | `.rb` | Full support |
441
624
  | C | `.c`, `.h` | Full support |
442
625
  | C++ | `.cpp`, `.hpp`, `.cc` | Full support |
626
+ | Objective-C | `.m`, `.mm`, `.h` | Partial support (classes, protocols, methods, `@property`, `#import`, message sends; `.mm` ObjC++ may parse incompletely) |
443
627
  | Swift | `.swift` | Full support |
444
628
  | Kotlin | `.kt`, `.kts` | Full support |
445
629
  | Scala | `.scala`, `.sc` | Full support (classes, traits, methods, type aliases, Scala 3 enums) |
@@ -448,6 +632,8 @@ The `.codegraph/config.json` file controls indexing:
448
632
  | Vue | `.vue` | Full support (script + script-setup extraction, Nuxt page/API/middleware routes) |
449
633
  | Liquid | `.liquid` | Full support |
450
634
  | Pascal / Delphi | `.pas`, `.dpr`, `.dpk`, `.lpr` | Full support (classes, records, interfaces, enums, DFM/FMX form files) |
635
+ | Lua | `.lua` | Full support (functions, methods with receivers, local variables, `require` imports, call edges) |
636
+ | Luau | `.luau` | Full support (everything in Lua, plus `type`/`export type` aliases, typed signatures, and Roblox instance-path `require`) |
451
637
 
452
638
  ## Troubleshooting
453
639
 
@@ -455,33 +641,14 @@ The `.codegraph/config.json` file controls indexing:
455
641
 
456
642
  **Indexing is slow** — Check that `node_modules` and other large directories are excluded. Use `--quiet` to reduce output overhead.
457
643
 
458
- **Indexing is slow / MCP `database is locked` / 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:
459
-
460
- - `Backend: native` — you're on the fast path, nothing to do.
461
- - `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:
462
-
463
- ```bash
464
- # macOS
465
- xcode-select --install # installs the C compiler
466
-
467
- # Linux (Debian / Ubuntu)
468
- sudo apt install build-essential python3 make
469
-
470
- # Linux (RHEL / Fedora)
471
- sudo yum groupinstall "Development Tools"
472
-
473
- # Then rebuild on any platform:
474
- npm rebuild better-sqlite3
475
-
476
- # Or force-include as a hard dep:
477
- npm install better-sqlite3 --save
478
- ```
644
+ **MCP hits `database is locked`**current builds shouldn't: CodeGraph bundles its own Node runtime and uses Node's built-in `node:sqlite` in WAL mode, where concurrent reads never block on a writer. If you still see it:
479
645
 
480
- After the fix, `codegraph status` should show `Backend: native`.
646
+ - **You're on an old (pre-0.9) install.** Reinstall to get the bundled runtime — `curl -fsSL https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.sh | sh` (macOS/Linux), `irm https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.ps1 | iex` (Windows), or `npm i -g @colbymchenry/codegraph@latest`.
647
+ - **`codegraph status` shows `Journal:` other than `wal`** — WAL couldn't be enabled on this filesystem (common on network shares and WSL2 `/mnt`), so reads can block on writes. Move the project (with its `.codegraph/` folder) onto a local disk.
481
648
 
482
649
  **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.
483
650
 
484
- **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.
651
+ **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 inside a `.gitignore`d or default-excluded directory (e.g. `node_modules`, `dist`).
485
652
 
486
653
  ## Star History
487
654
 
@@ -501,7 +668,7 @@ MIT
501
668
 
502
669
  <div align="center">
503
670
 
504
- **Made for AI coding agents — Claude Code, Cursor, Codex CLI, and opencode**
671
+ **Made for AI coding agents — Claude Code, Cursor, Codex CLI, opencode, Hermes Agent, Gemini CLI, Antigravity IDE, and Kiro**
505
672
 
506
673
  [Report Bug](https://github.com/colbymchenry/codegraph/issues) · [Request Feature](https://github.com/colbymchenry/codegraph/issues)
507
674