@saluzi/codegraph 0.1.0 → 0.2.1

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 (712) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +885 -0
  3. package/dist/bin/codegraph.d.ts +2 -1
  4. package/dist/bin/codegraph.d.ts.map +1 -0
  5. package/dist/bin/codegraph.js +2248 -0
  6. package/dist/bin/codegraph.js.map +1 -0
  7. package/dist/bin/command-supervision.d.ts +49 -0
  8. package/dist/bin/command-supervision.d.ts.map +1 -0
  9. package/dist/bin/command-supervision.js +95 -0
  10. package/dist/bin/command-supervision.js.map +1 -0
  11. package/dist/bin/fatal-handler.d.ts +20 -0
  12. package/dist/bin/fatal-handler.d.ts.map +1 -0
  13. package/dist/bin/fatal-handler.js +118 -0
  14. package/dist/bin/fatal-handler.js.map +1 -0
  15. package/dist/bin/node-version-check.d.ts.map +1 -0
  16. package/dist/bin/node-version-check.js +79 -0
  17. package/dist/bin/node-version-check.js.map +1 -0
  18. package/dist/bin/uninstall.d.ts.map +1 -0
  19. package/dist/bin/uninstall.js +36 -0
  20. package/dist/bin/uninstall.js.map +1 -0
  21. package/dist/context/formatter.d.ts +6 -9
  22. package/dist/context/formatter.d.ts.map +1 -0
  23. package/dist/context/formatter.js +25 -6
  24. package/dist/context/formatter.js.map +1 -0
  25. package/dist/context/index.d.ts +102 -100
  26. package/dist/context/index.d.ts.map +1 -0
  27. package/dist/context/index.js +252 -6
  28. package/dist/context/index.js.map +1 -0
  29. package/dist/context/markers.d.ts +19 -0
  30. package/dist/context/markers.d.ts.map +1 -0
  31. package/dist/context/markers.js +22 -0
  32. package/dist/context/markers.js.map +1 -0
  33. package/dist/db/index.d.ts +185 -85
  34. package/dist/db/index.d.ts.map +1 -0
  35. package/dist/db/index.js +257 -14
  36. package/dist/db/index.js.map +1 -0
  37. package/dist/db/migrations.d.ts +15 -18
  38. package/dist/db/migrations.d.ts.map +1 -0
  39. package/dist/db/migrations.js +82 -1
  40. package/dist/db/migrations.js.map +1 -0
  41. package/dist/db/queries.d.ts +503 -281
  42. package/dist/db/queries.d.ts.map +1 -0
  43. package/dist/db/queries.js +644 -107
  44. package/dist/db/queries.js.map +1 -0
  45. package/dist/db/schema.sql +69 -26
  46. package/dist/db/sqlite-adapter.d.ts +26 -22
  47. package/dist/db/sqlite-adapter.d.ts.map +1 -0
  48. package/dist/db/sqlite-adapter.js +11 -35
  49. package/dist/db/sqlite-adapter.js.map +1 -0
  50. package/dist/db/wal-valve.d.ts +106 -0
  51. package/dist/db/wal-valve.d.ts.map +1 -0
  52. package/dist/db/wal-valve.js +208 -0
  53. package/dist/db/wal-valve.js.map +1 -0
  54. package/dist/directory.d.ts +140 -19
  55. package/dist/directory.d.ts.map +1 -0
  56. package/dist/directory.js +568 -35
  57. package/dist/directory.js.map +1 -0
  58. package/dist/errors.d.ts +32 -45
  59. package/dist/errors.d.ts.map +1 -0
  60. package/dist/errors.js.map +1 -0
  61. package/dist/extraction/astro-extractor.d.ts +79 -0
  62. package/dist/extraction/astro-extractor.d.ts.map +1 -0
  63. package/dist/extraction/astro-extractor.js +320 -0
  64. package/dist/extraction/astro-extractor.js.map +1 -0
  65. package/dist/extraction/cfml-extractor.d.ts +107 -0
  66. package/dist/extraction/cfml-extractor.d.ts.map +1 -0
  67. package/dist/extraction/cfml-extractor.js +494 -0
  68. package/dist/extraction/cfml-extractor.js.map +1 -0
  69. package/dist/extraction/dfm-extractor.d.ts +17 -17
  70. package/dist/extraction/dfm-extractor.d.ts.map +1 -0
  71. package/dist/extraction/dfm-extractor.js.map +1 -0
  72. package/dist/extraction/extraction-version.d.ts +25 -0
  73. package/dist/extraction/extraction-version.d.ts.map +1 -0
  74. package/dist/extraction/extraction-version.js +28 -0
  75. package/dist/extraction/extraction-version.js.map +1 -0
  76. package/dist/extraction/function-ref.d.ts +118 -0
  77. package/dist/extraction/function-ref.d.ts.map +1 -0
  78. package/dist/extraction/function-ref.js +727 -0
  79. package/dist/extraction/function-ref.js.map +1 -0
  80. package/dist/extraction/generated-detection.d.ts +30 -0
  81. package/dist/extraction/generated-detection.d.ts.map +1 -0
  82. package/dist/extraction/generated-detection.js +83 -0
  83. package/dist/extraction/generated-detection.js.map +1 -0
  84. package/dist/extraction/grammars.d.ts +74 -30
  85. package/dist/extraction/grammars.d.ts.map +1 -0
  86. package/dist/extraction/grammars.js +289 -15
  87. package/dist/extraction/grammars.js.map +1 -0
  88. package/dist/extraction/index.d.ts +193 -109
  89. package/dist/extraction/index.d.ts.map +1 -0
  90. package/dist/extraction/index.js +1485 -362
  91. package/dist/extraction/index.js.map +1 -0
  92. package/dist/extraction/languages/arkts.d.ts +3 -0
  93. package/dist/extraction/languages/arkts.d.ts.map +1 -0
  94. package/dist/extraction/languages/arkts.js +127 -0
  95. package/dist/extraction/languages/arkts.js.map +1 -0
  96. package/dist/extraction/languages/c-cpp.d.ts +110 -4
  97. package/dist/extraction/languages/c-cpp.d.ts.map +1 -0
  98. package/dist/extraction/languages/c-cpp.js +713 -2
  99. package/dist/extraction/languages/c-cpp.js.map +1 -0
  100. package/dist/extraction/languages/cfquery.d.ts +12 -0
  101. package/dist/extraction/languages/cfquery.d.ts.map +1 -0
  102. package/dist/extraction/languages/cfquery.js +28 -0
  103. package/dist/extraction/languages/cfquery.js.map +1 -0
  104. package/dist/extraction/languages/cfscript.d.ts +3 -0
  105. package/dist/extraction/languages/cfscript.d.ts.map +1 -0
  106. package/dist/extraction/languages/cfscript.js +73 -0
  107. package/dist/extraction/languages/cfscript.js.map +1 -0
  108. package/dist/extraction/languages/cobol.d.ts +33 -0
  109. package/dist/extraction/languages/cobol.d.ts.map +1 -0
  110. package/dist/extraction/languages/cobol.js +499 -0
  111. package/dist/extraction/languages/cobol.js.map +1 -0
  112. package/dist/extraction/languages/csharp.d.ts +25 -3
  113. package/dist/extraction/languages/csharp.d.ts.map +1 -0
  114. package/dist/extraction/languages/csharp.js +106 -3
  115. package/dist/extraction/languages/csharp.js.map +1 -0
  116. package/dist/extraction/languages/dart.d.ts +3 -3
  117. package/dist/extraction/languages/dart.d.ts.map +1 -0
  118. package/dist/extraction/languages/dart.js +183 -1
  119. package/dist/extraction/languages/dart.js.map +1 -0
  120. package/dist/extraction/languages/erlang.d.ts +3 -0
  121. package/dist/extraction/languages/erlang.d.ts.map +1 -0
  122. package/dist/extraction/languages/erlang.js +350 -0
  123. package/dist/extraction/languages/erlang.js.map +1 -0
  124. package/dist/extraction/languages/go.d.ts +3 -3
  125. package/dist/extraction/languages/go.d.ts.map +1 -0
  126. package/dist/extraction/languages/go.js +55 -2
  127. package/dist/extraction/languages/go.js.map +1 -0
  128. package/dist/extraction/languages/index.d.ts +4 -4
  129. package/dist/extraction/languages/index.d.ts.map +1 -0
  130. package/dist/extraction/languages/index.js +22 -0
  131. package/dist/extraction/languages/index.js.map +1 -0
  132. package/dist/extraction/languages/java.d.ts +3 -3
  133. package/dist/extraction/languages/java.d.ts.map +1 -0
  134. package/dist/extraction/languages/java.js +252 -1
  135. package/dist/extraction/languages/java.js.map +1 -0
  136. package/dist/extraction/languages/javascript.d.ts +3 -3
  137. package/dist/extraction/languages/javascript.d.ts.map +1 -0
  138. package/dist/extraction/languages/javascript.js +16 -0
  139. package/dist/extraction/languages/javascript.js.map +1 -0
  140. package/dist/extraction/languages/kotlin.d.ts +3 -3
  141. package/dist/extraction/languages/kotlin.d.ts.map +1 -0
  142. package/dist/extraction/languages/kotlin.js +126 -0
  143. package/dist/extraction/languages/kotlin.js.map +1 -0
  144. package/dist/extraction/languages/lua.d.ts +3 -3
  145. package/dist/extraction/languages/lua.d.ts.map +1 -0
  146. package/dist/extraction/languages/lua.js.map +1 -0
  147. package/dist/extraction/languages/luau.d.ts +3 -3
  148. package/dist/extraction/languages/luau.d.ts.map +1 -0
  149. package/dist/extraction/languages/luau.js.map +1 -0
  150. package/dist/extraction/languages/nix.d.ts +3 -0
  151. package/dist/extraction/languages/nix.d.ts.map +1 -0
  152. package/dist/extraction/languages/nix.js +294 -0
  153. package/dist/extraction/languages/nix.js.map +1 -0
  154. package/dist/extraction/languages/objc.d.ts +3 -0
  155. package/dist/extraction/languages/objc.d.ts.map +1 -0
  156. package/dist/extraction/languages/objc.js +175 -0
  157. package/dist/extraction/languages/objc.js.map +1 -0
  158. package/dist/extraction/languages/pascal.d.ts +3 -3
  159. package/dist/extraction/languages/pascal.d.ts.map +1 -0
  160. package/dist/extraction/languages/pascal.js +11 -0
  161. package/dist/extraction/languages/pascal.js.map +1 -0
  162. package/dist/extraction/languages/php.d.ts +3 -3
  163. package/dist/extraction/languages/php.d.ts.map +1 -0
  164. package/dist/extraction/languages/php.js +90 -1
  165. package/dist/extraction/languages/php.js.map +1 -0
  166. package/dist/extraction/languages/python.d.ts +3 -3
  167. package/dist/extraction/languages/python.d.ts.map +1 -0
  168. package/dist/extraction/languages/python.js.map +1 -0
  169. package/dist/extraction/languages/r.d.ts +3 -0
  170. package/dist/extraction/languages/r.d.ts.map +1 -0
  171. package/dist/extraction/languages/r.js +314 -0
  172. package/dist/extraction/languages/r.js.map +1 -0
  173. package/dist/extraction/languages/ruby.d.ts +3 -3
  174. package/dist/extraction/languages/ruby.d.ts.map +1 -0
  175. package/dist/extraction/languages/ruby.js +35 -0
  176. package/dist/extraction/languages/ruby.js.map +1 -0
  177. package/dist/extraction/languages/rust.d.ts +3 -3
  178. package/dist/extraction/languages/rust.d.ts.map +1 -0
  179. package/dist/extraction/languages/rust.js +35 -2
  180. package/dist/extraction/languages/rust.js.map +1 -0
  181. package/dist/extraction/languages/scala.d.ts +3 -3
  182. package/dist/extraction/languages/scala.d.ts.map +1 -0
  183. package/dist/extraction/languages/scala.js +80 -10
  184. package/dist/extraction/languages/scala.js.map +1 -0
  185. package/dist/extraction/languages/solidity.d.ts +3 -0
  186. package/dist/extraction/languages/solidity.d.ts.map +1 -0
  187. package/dist/extraction/languages/solidity.js +293 -0
  188. package/dist/extraction/languages/solidity.js.map +1 -0
  189. package/dist/extraction/languages/swift.d.ts +3 -3
  190. package/dist/extraction/languages/swift.d.ts.map +1 -0
  191. package/dist/extraction/languages/swift.js +61 -0
  192. package/dist/extraction/languages/swift.js.map +1 -0
  193. package/dist/extraction/languages/terraform.d.ts +3 -0
  194. package/dist/extraction/languages/terraform.d.ts.map +1 -0
  195. package/dist/extraction/languages/terraform.js +641 -0
  196. package/dist/extraction/languages/terraform.js.map +1 -0
  197. package/dist/extraction/languages/typescript.d.ts +16 -3
  198. package/dist/extraction/languages/typescript.d.ts.map +1 -0
  199. package/dist/extraction/languages/typescript.js +38 -0
  200. package/dist/extraction/languages/typescript.js.map +1 -0
  201. package/dist/extraction/languages/vbnet.d.ts +11 -0
  202. package/dist/extraction/languages/vbnet.d.ts.map +1 -0
  203. package/dist/extraction/languages/vbnet.js +141 -0
  204. package/dist/extraction/languages/vbnet.js.map +1 -0
  205. package/dist/extraction/liquid-extractor.d.ts +48 -41
  206. package/dist/extraction/liquid-extractor.d.ts.map +1 -0
  207. package/dist/extraction/liquid-extractor.js +53 -9
  208. package/dist/extraction/liquid-extractor.js.map +1 -0
  209. package/dist/extraction/mybatis-extractor.d.ts +68 -0
  210. package/dist/extraction/mybatis-extractor.d.ts.map +1 -0
  211. package/dist/extraction/mybatis-extractor.js +300 -0
  212. package/dist/extraction/mybatis-extractor.js.map +1 -0
  213. package/dist/extraction/parse-pool.d.ts +152 -0
  214. package/dist/extraction/parse-pool.d.ts.map +1 -0
  215. package/dist/extraction/parse-pool.js +387 -0
  216. package/dist/extraction/parse-pool.js.map +1 -0
  217. package/dist/extraction/parse-worker.d.ts +2 -2
  218. package/dist/extraction/parse-worker.d.ts.map +1 -0
  219. package/dist/extraction/parse-worker.js +13 -3
  220. package/dist/extraction/parse-worker.js.map +1 -0
  221. package/dist/extraction/razor-extractor.d.ts +42 -0
  222. package/dist/extraction/razor-extractor.d.ts.map +1 -0
  223. package/dist/extraction/razor-extractor.js +285 -0
  224. package/dist/extraction/razor-extractor.js.map +1 -0
  225. package/dist/extraction/svelte-extractor.d.ts +42 -42
  226. package/dist/extraction/svelte-extractor.d.ts.map +1 -0
  227. package/dist/extraction/svelte-extractor.js +6 -3
  228. package/dist/extraction/svelte-extractor.js.map +1 -0
  229. package/dist/extraction/tree-sitter-helpers.d.ts +7 -18
  230. package/dist/extraction/tree-sitter-helpers.d.ts.map +1 -0
  231. package/dist/extraction/tree-sitter-helpers.js +60 -10
  232. package/dist/extraction/tree-sitter-helpers.js.map +1 -0
  233. package/dist/extraction/tree-sitter-types.d.ts +224 -157
  234. package/dist/extraction/tree-sitter-types.d.ts.map +1 -0
  235. package/dist/extraction/tree-sitter-types.js.map +1 -0
  236. package/dist/extraction/tree-sitter.d.ts +689 -221
  237. package/dist/extraction/tree-sitter.d.ts.map +1 -0
  238. package/dist/extraction/tree-sitter.js +4193 -117
  239. package/dist/extraction/tree-sitter.js.map +1 -0
  240. package/dist/extraction/vue-extractor.d.ts +40 -25
  241. package/dist/extraction/vue-extractor.d.ts.map +1 -0
  242. package/dist/extraction/vue-extractor.js +94 -3
  243. package/dist/extraction/vue-extractor.js.map +1 -0
  244. package/dist/extraction/wasm/tree-sitter-arkts.wasm +0 -0
  245. package/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
  246. package/dist/extraction/wasm/tree-sitter-cfml.wasm +0 -0
  247. package/dist/extraction/wasm/tree-sitter-cfquery.wasm +0 -0
  248. package/dist/extraction/wasm/tree-sitter-cfscript.wasm +0 -0
  249. package/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
  250. package/dist/extraction/wasm/tree-sitter-erlang.wasm +0 -0
  251. package/dist/extraction/wasm/tree-sitter-lua.wasm +0 -0
  252. package/dist/extraction/wasm/tree-sitter-nix.wasm +0 -0
  253. package/dist/extraction/wasm/tree-sitter-r.wasm +0 -0
  254. package/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
  255. package/dist/extraction/wasm/tree-sitter-terraform.wasm +0 -0
  256. package/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
  257. package/dist/extraction/wasm-runtime-flags.d.ts +6 -14
  258. package/dist/extraction/wasm-runtime-flags.d.ts.map +1 -0
  259. package/dist/extraction/wasm-runtime-flags.js +1 -0
  260. package/dist/extraction/wasm-runtime-flags.js.map +1 -0
  261. package/dist/graph/index.d.ts +3 -3
  262. package/dist/graph/index.d.ts.map +1 -0
  263. package/dist/graph/index.js.map +1 -0
  264. package/dist/graph/queries.d.ts +96 -99
  265. package/dist/graph/queries.d.ts.map +1 -0
  266. package/dist/graph/queries.js +13 -40
  267. package/dist/graph/queries.js.map +1 -0
  268. package/dist/graph/traversal.d.ts +117 -127
  269. package/dist/graph/traversal.d.ts.map +1 -0
  270. package/dist/graph/traversal.js +92 -21
  271. package/dist/graph/traversal.js.map +1 -0
  272. package/dist/index.d.ts +615 -481
  273. package/dist/index.d.ts.map +1 -0
  274. package/dist/index.js +709 -18
  275. package/dist/index.js.map +1 -0
  276. package/dist/installer/config-writer.d.ts +13 -14
  277. package/dist/installer/config-writer.d.ts.map +1 -0
  278. package/dist/installer/config-writer.js +91 -0
  279. package/dist/installer/config-writer.js.map +1 -0
  280. package/dist/installer/index.d.ts +84 -82
  281. package/dist/installer/index.d.ts.map +1 -0
  282. package/dist/installer/index.js +619 -0
  283. package/dist/installer/index.js.map +1 -0
  284. package/dist/installer/instructions-template.d.ts +35 -24
  285. package/dist/installer/instructions-template.d.ts.map +1 -0
  286. package/dist/installer/instructions-template.js +53 -0
  287. package/dist/installer/instructions-template.js.map +1 -0
  288. package/dist/installer/targets/antigravity.d.ts +57 -0
  289. package/dist/installer/targets/antigravity.d.ts.map +1 -0
  290. package/dist/installer/targets/antigravity.js +308 -0
  291. package/dist/installer/targets/antigravity.js.map +1 -0
  292. package/dist/installer/targets/claude.d.ts +34 -27
  293. package/dist/installer/targets/claude.d.ts.map +1 -0
  294. package/dist/installer/targets/claude.js +454 -0
  295. package/dist/installer/targets/claude.js.map +1 -0
  296. package/dist/installer/targets/codex.d.ts +3 -3
  297. package/dist/installer/targets/codex.d.ts.map +1 -0
  298. package/dist/installer/targets/codex.js +185 -0
  299. package/dist/installer/targets/codex.js.map +1 -0
  300. package/dist/installer/targets/cursor.d.ts +3 -3
  301. package/dist/installer/targets/cursor.d.ts.map +1 -0
  302. package/dist/installer/targets/cursor.js +254 -0
  303. package/dist/installer/targets/cursor.js.map +1 -0
  304. package/dist/installer/targets/gemini.d.ts +26 -0
  305. package/dist/installer/targets/gemini.d.ts.map +1 -0
  306. package/dist/installer/targets/gemini.js +165 -0
  307. package/dist/installer/targets/gemini.js.map +1 -0
  308. package/dist/installer/targets/hermes.d.ts +3 -3
  309. package/dist/installer/targets/hermes.d.ts.map +1 -0
  310. package/dist/installer/targets/hermes.js +359 -0
  311. package/dist/installer/targets/hermes.js.map +1 -0
  312. package/dist/installer/targets/kiro.d.ts +27 -0
  313. package/dist/installer/targets/kiro.d.ts.map +1 -0
  314. package/dist/installer/targets/kiro.js +178 -0
  315. package/dist/installer/targets/kiro.js.map +1 -0
  316. package/dist/installer/targets/opencode.d.ts +12 -4
  317. package/dist/installer/targets/opencode.d.ts.map +1 -0
  318. package/dist/installer/targets/opencode.js +288 -0
  319. package/dist/installer/targets/opencode.js.map +1 -0
  320. package/dist/installer/targets/registry.d.ts +9 -12
  321. package/dist/installer/targets/registry.d.ts.map +1 -0
  322. package/dist/installer/targets/registry.js +91 -0
  323. package/dist/installer/targets/registry.js.map +1 -0
  324. package/dist/installer/targets/shared.d.ts +38 -29
  325. package/dist/installer/targets/shared.d.ts.map +1 -0
  326. package/dist/installer/targets/shared.js +264 -0
  327. package/dist/installer/targets/shared.js.map +1 -0
  328. package/dist/installer/targets/toml.d.ts +11 -23
  329. package/dist/installer/targets/toml.d.ts.map +1 -0
  330. package/dist/installer/targets/toml.js +147 -0
  331. package/dist/installer/targets/toml.js.map +1 -0
  332. package/dist/installer/targets/types.d.ts +62 -76
  333. package/dist/installer/targets/types.d.ts.map +1 -0
  334. package/dist/installer/targets/types.js +16 -0
  335. package/dist/installer/targets/types.js.map +1 -0
  336. package/dist/mcp/daemon-manager.d.ts +42 -0
  337. package/dist/mcp/daemon-manager.d.ts.map +1 -0
  338. package/dist/mcp/daemon-manager.js +129 -0
  339. package/dist/mcp/daemon-manager.js.map +1 -0
  340. package/dist/mcp/daemon-paths.d.ts +73 -0
  341. package/dist/mcp/daemon-paths.d.ts.map +1 -0
  342. package/dist/mcp/daemon-paths.js +165 -0
  343. package/dist/mcp/daemon-paths.js.map +1 -0
  344. package/dist/mcp/daemon-registry.d.ts +47 -0
  345. package/dist/mcp/daemon-registry.d.ts.map +1 -0
  346. package/dist/mcp/daemon-registry.js +233 -0
  347. package/dist/mcp/daemon-registry.js.map +1 -0
  348. package/dist/mcp/daemon.d.ts +290 -0
  349. package/dist/mcp/daemon.d.ts.map +1 -0
  350. package/dist/mcp/daemon.js +862 -0
  351. package/dist/mcp/daemon.js.map +1 -0
  352. package/dist/mcp/dynamic-boundaries.d.ts +41 -0
  353. package/dist/mcp/dynamic-boundaries.d.ts.map +1 -0
  354. package/dist/mcp/dynamic-boundaries.js +360 -0
  355. package/dist/mcp/dynamic-boundaries.js.map +1 -0
  356. package/dist/mcp/early-ppid.d.ts +26 -0
  357. package/dist/mcp/early-ppid.d.ts.map +1 -0
  358. package/dist/mcp/early-ppid.js +29 -0
  359. package/dist/mcp/early-ppid.js.map +1 -0
  360. package/dist/mcp/engine.d.ts +122 -0
  361. package/dist/mcp/engine.d.ts.map +1 -0
  362. package/dist/mcp/engine.js +350 -0
  363. package/dist/mcp/engine.js.map +1 -0
  364. package/dist/mcp/index.d.ts +89 -74
  365. package/dist/mcp/index.d.ts.map +1 -0
  366. package/dist/mcp/index.js +506 -0
  367. package/dist/mcp/index.js.map +1 -0
  368. package/dist/mcp/liveness-watchdog.d.ts +35 -0
  369. package/dist/mcp/liveness-watchdog.d.ts.map +1 -0
  370. package/dist/mcp/liveness-watchdog.js +267 -0
  371. package/dist/mcp/liveness-watchdog.js.map +1 -0
  372. package/dist/mcp/ppid-watchdog.d.ts +62 -0
  373. package/dist/mcp/ppid-watchdog.d.ts.map +1 -0
  374. package/dist/mcp/ppid-watchdog.js +64 -0
  375. package/dist/mcp/ppid-watchdog.js.map +1 -0
  376. package/dist/mcp/proxy.d.ts +87 -0
  377. package/dist/mcp/proxy.d.ts.map +1 -0
  378. package/dist/mcp/proxy.js +667 -0
  379. package/dist/mcp/proxy.js.map +1 -0
  380. package/dist/mcp/query-pool.d.ts +108 -0
  381. package/dist/mcp/query-pool.d.ts.map +1 -0
  382. package/dist/mcp/query-pool.js +315 -0
  383. package/dist/mcp/query-pool.js.map +1 -0
  384. package/dist/mcp/query-worker.d.ts +24 -0
  385. package/dist/mcp/query-worker.d.ts.map +1 -0
  386. package/dist/mcp/query-worker.js +87 -0
  387. package/dist/mcp/query-worker.js.map +1 -0
  388. package/dist/mcp/server-instructions.d.ts +22 -8
  389. package/dist/mcp/server-instructions.d.ts.map +1 -0
  390. package/dist/mcp/server-instructions.js +106 -0
  391. package/dist/mcp/server-instructions.js.map +1 -0
  392. package/dist/mcp/session.d.ts +93 -0
  393. package/dist/mcp/session.d.ts.map +1 -0
  394. package/dist/mcp/session.js +357 -0
  395. package/dist/mcp/session.js.map +1 -0
  396. package/dist/mcp/startup-handshake.d.ts +44 -0
  397. package/dist/mcp/startup-handshake.d.ts.map +1 -0
  398. package/dist/mcp/startup-handshake.js +73 -0
  399. package/dist/mcp/startup-handshake.js.map +1 -0
  400. package/dist/mcp/stdin-teardown.d.ts +27 -0
  401. package/dist/mcp/stdin-teardown.d.ts.map +1 -0
  402. package/dist/mcp/stdin-teardown.js +49 -0
  403. package/dist/mcp/stdin-teardown.js.map +1 -0
  404. package/dist/mcp/tools.d.ts +557 -213
  405. package/dist/mcp/tools.d.ts.map +1 -0
  406. package/dist/mcp/tools.js +4477 -0
  407. package/dist/mcp/tools.js.map +1 -0
  408. package/dist/mcp/transport.d.ts +158 -87
  409. package/dist/mcp/transport.d.ts.map +1 -0
  410. package/dist/mcp/transport.js +377 -0
  411. package/dist/mcp/transport.js.map +1 -0
  412. package/dist/mcp/version.d.ts +19 -0
  413. package/dist/mcp/version.d.ts.map +1 -0
  414. package/dist/mcp/version.js +71 -0
  415. package/dist/mcp/version.js.map +1 -0
  416. package/dist/project-config.d.ts +94 -0
  417. package/dist/project-config.d.ts.map +1 -0
  418. package/dist/project-config.js +374 -0
  419. package/dist/project-config.js.map +1 -0
  420. package/dist/resolution/c-fnptr-synthesizer.d.ts +6 -0
  421. package/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -0
  422. package/dist/resolution/c-fnptr-synthesizer.js +1062 -0
  423. package/dist/resolution/c-fnptr-synthesizer.js.map +1 -0
  424. package/dist/resolution/callback-synthesizer.d.ts +15 -0
  425. package/dist/resolution/callback-synthesizer.d.ts.map +1 -0
  426. package/dist/resolution/callback-synthesizer.js +3938 -0
  427. package/dist/resolution/callback-synthesizer.js.map +1 -0
  428. package/dist/resolution/cooperative-yield.d.ts +32 -0
  429. package/dist/resolution/cooperative-yield.d.ts.map +1 -0
  430. package/dist/resolution/cooperative-yield.js +42 -0
  431. package/dist/resolution/cooperative-yield.js.map +1 -0
  432. package/dist/resolution/frameworks/astro.d.ts +9 -0
  433. package/dist/resolution/frameworks/astro.d.ts.map +1 -0
  434. package/dist/resolution/frameworks/astro.js +169 -0
  435. package/dist/resolution/frameworks/astro.js.map +1 -0
  436. package/dist/resolution/frameworks/cargo-workspace.d.ts +3 -5
  437. package/dist/resolution/frameworks/cargo-workspace.d.ts.map +1 -0
  438. package/dist/resolution/frameworks/cargo-workspace.js.map +1 -0
  439. package/dist/resolution/frameworks/cics.d.ts +20 -0
  440. package/dist/resolution/frameworks/cics.d.ts.map +1 -0
  441. package/dist/resolution/frameworks/cics.js +90 -0
  442. package/dist/resolution/frameworks/cics.js.map +1 -0
  443. package/dist/resolution/frameworks/csharp.d.ts +3 -3
  444. package/dist/resolution/frameworks/csharp.d.ts.map +1 -0
  445. package/dist/resolution/frameworks/csharp.js +36 -8
  446. package/dist/resolution/frameworks/csharp.js.map +1 -0
  447. package/dist/resolution/frameworks/drupal.d.ts +3 -3
  448. package/dist/resolution/frameworks/drupal.d.ts.map +1 -0
  449. package/dist/resolution/frameworks/drupal.js +44 -12
  450. package/dist/resolution/frameworks/drupal.js.map +1 -0
  451. package/dist/resolution/frameworks/expo-modules.d.ts +3 -0
  452. package/dist/resolution/frameworks/expo-modules.d.ts.map +1 -0
  453. package/dist/resolution/frameworks/expo-modules.js +148 -0
  454. package/dist/resolution/frameworks/expo-modules.js.map +1 -0
  455. package/dist/resolution/frameworks/express.d.ts +3 -3
  456. package/dist/resolution/frameworks/express.d.ts.map +1 -0
  457. package/dist/resolution/frameworks/express.js +102 -19
  458. package/dist/resolution/frameworks/express.js.map +1 -0
  459. package/dist/resolution/frameworks/fabric.d.ts +3 -0
  460. package/dist/resolution/frameworks/fabric.d.ts.map +1 -0
  461. package/dist/resolution/frameworks/fabric.js +354 -0
  462. package/dist/resolution/frameworks/fabric.js.map +1 -0
  463. package/dist/resolution/frameworks/go.d.ts +3 -3
  464. package/dist/resolution/frameworks/go.d.ts.map +1 -0
  465. package/dist/resolution/frameworks/go.js +6 -3
  466. package/dist/resolution/frameworks/go.js.map +1 -0
  467. package/dist/resolution/frameworks/goframe.d.ts +41 -0
  468. package/dist/resolution/frameworks/goframe.d.ts.map +1 -0
  469. package/dist/resolution/frameworks/goframe.js +112 -0
  470. package/dist/resolution/frameworks/goframe.js.map +1 -0
  471. package/dist/resolution/frameworks/index.d.ts +29 -31
  472. package/dist/resolution/frameworks/index.d.ts.map +1 -0
  473. package/dist/resolution/frameworks/index.js +39 -1
  474. package/dist/resolution/frameworks/index.js.map +1 -0
  475. package/dist/resolution/frameworks/java.d.ts +3 -3
  476. package/dist/resolution/frameworks/java.d.ts.map +1 -0
  477. package/dist/resolution/frameworks/java.js +352 -12
  478. package/dist/resolution/frameworks/java.js.map +1 -0
  479. package/dist/resolution/frameworks/laravel.d.ts +4 -4
  480. package/dist/resolution/frameworks/laravel.d.ts.map +1 -0
  481. package/dist/resolution/frameworks/laravel.js +17 -8
  482. package/dist/resolution/frameworks/laravel.js.map +1 -0
  483. package/dist/resolution/frameworks/nestjs.d.ts +3 -3
  484. package/dist/resolution/frameworks/nestjs.d.ts.map +1 -0
  485. package/dist/resolution/frameworks/nestjs.js +324 -0
  486. package/dist/resolution/frameworks/nestjs.js.map +1 -0
  487. package/dist/resolution/frameworks/play.d.ts +19 -0
  488. package/dist/resolution/frameworks/play.d.ts.map +1 -0
  489. package/dist/resolution/frameworks/play.js +111 -0
  490. package/dist/resolution/frameworks/play.js.map +1 -0
  491. package/dist/resolution/frameworks/python.d.ts +5 -5
  492. package/dist/resolution/frameworks/python.d.ts.map +1 -0
  493. package/dist/resolution/frameworks/python.js +138 -16
  494. package/dist/resolution/frameworks/python.js.map +1 -0
  495. package/dist/resolution/frameworks/react-native.d.ts +3 -0
  496. package/dist/resolution/frameworks/react-native.d.ts.map +1 -0
  497. package/dist/resolution/frameworks/react-native.js +410 -0
  498. package/dist/resolution/frameworks/react-native.js.map +1 -0
  499. package/dist/resolution/frameworks/react.d.ts +3 -3
  500. package/dist/resolution/frameworks/react.d.ts.map +1 -0
  501. package/dist/resolution/frameworks/react.js +122 -60
  502. package/dist/resolution/frameworks/react.js.map +1 -0
  503. package/dist/resolution/frameworks/ruby.d.ts +3 -3
  504. package/dist/resolution/frameworks/ruby.d.ts.map +1 -0
  505. package/dist/resolution/frameworks/ruby.js +106 -2
  506. package/dist/resolution/frameworks/ruby.js.map +1 -0
  507. package/dist/resolution/frameworks/rust.d.ts +3 -3
  508. package/dist/resolution/frameworks/rust.d.ts.map +1 -0
  509. package/dist/resolution/frameworks/rust.js +102 -5
  510. package/dist/resolution/frameworks/rust.js.map +1 -0
  511. package/dist/resolution/frameworks/svelte.d.ts +3 -3
  512. package/dist/resolution/frameworks/svelte.d.ts.map +1 -0
  513. package/dist/resolution/frameworks/svelte.js +5 -1
  514. package/dist/resolution/frameworks/svelte.js.map +1 -0
  515. package/dist/resolution/frameworks/swift-objc.d.ts +37 -0
  516. package/dist/resolution/frameworks/swift-objc.d.ts.map +1 -0
  517. package/dist/resolution/frameworks/swift-objc.js +252 -0
  518. package/dist/resolution/frameworks/swift-objc.js.map +1 -0
  519. package/dist/resolution/frameworks/swift.d.ts +5 -5
  520. package/dist/resolution/frameworks/swift.d.ts.map +1 -0
  521. package/dist/resolution/frameworks/swift.js +30 -6
  522. package/dist/resolution/frameworks/swift.js.map +1 -0
  523. package/dist/resolution/frameworks/terraform.d.ts +38 -0
  524. package/dist/resolution/frameworks/terraform.d.ts.map +1 -0
  525. package/dist/resolution/frameworks/terraform.js +277 -0
  526. package/dist/resolution/frameworks/terraform.js.map +1 -0
  527. package/dist/resolution/frameworks/vue.d.ts +3 -3
  528. package/dist/resolution/frameworks/vue.d.ts.map +1 -0
  529. package/dist/resolution/frameworks/vue.js +24 -27
  530. package/dist/resolution/frameworks/vue.js.map +1 -0
  531. package/dist/resolution/go-module.d.ts +26 -0
  532. package/dist/resolution/go-module.d.ts.map +1 -0
  533. package/dist/resolution/go-module.js +78 -0
  534. package/dist/resolution/go-module.js.map +1 -0
  535. package/dist/resolution/goframe-synthesizer.d.ts +29 -0
  536. package/dist/resolution/goframe-synthesizer.d.ts.map +1 -0
  537. package/dist/resolution/goframe-synthesizer.js +163 -0
  538. package/dist/resolution/goframe-synthesizer.js.map +1 -0
  539. package/dist/resolution/import-resolver.d.ts +53 -29
  540. package/dist/resolution/import-resolver.d.ts.map +1 -0
  541. package/dist/resolution/import-resolver.js +1319 -8
  542. package/dist/resolution/import-resolver.js.map +1 -0
  543. package/dist/resolution/index.d.ts +243 -103
  544. package/dist/resolution/index.d.ts.map +1 -0
  545. package/dist/resolution/index.js +1055 -53
  546. package/dist/resolution/index.js.map +1 -0
  547. package/dist/resolution/lru-cache.d.ts +9 -9
  548. package/dist/resolution/lru-cache.d.ts.map +1 -0
  549. package/dist/resolution/lru-cache.js.map +1 -0
  550. package/dist/resolution/name-matcher.d.ts +91 -29
  551. package/dist/resolution/name-matcher.d.ts.map +1 -0
  552. package/dist/resolution/name-matcher.js +1478 -32
  553. package/dist/resolution/name-matcher.js.map +1 -0
  554. package/dist/resolution/path-aliases.d.ts +23 -27
  555. package/dist/resolution/path-aliases.d.ts.map +1 -0
  556. package/dist/resolution/path-aliases.js.map +1 -0
  557. package/dist/resolution/strip-comments.d.ts +3 -16
  558. package/dist/resolution/strip-comments.d.ts.map +1 -0
  559. package/dist/resolution/strip-comments.js +51 -0
  560. package/dist/resolution/strip-comments.js.map +1 -0
  561. package/dist/resolution/swift-objc-bridge.d.ts +134 -0
  562. package/dist/resolution/swift-objc-bridge.d.ts.map +1 -0
  563. package/dist/resolution/swift-objc-bridge.js +256 -0
  564. package/dist/resolution/swift-objc-bridge.js.map +1 -0
  565. package/dist/resolution/types.d.ts +217 -136
  566. package/dist/resolution/types.d.ts.map +1 -0
  567. package/dist/resolution/types.js.map +1 -0
  568. package/dist/resolution/workspace-packages.d.ts +58 -0
  569. package/dist/resolution/workspace-packages.d.ts.map +1 -0
  570. package/dist/resolution/workspace-packages.js +346 -0
  571. package/dist/resolution/workspace-packages.js.map +1 -0
  572. package/dist/search/identifier-segments.d.ts +60 -0
  573. package/dist/search/identifier-segments.d.ts.map +1 -0
  574. package/dist/search/identifier-segments.js +176 -0
  575. package/dist/search/identifier-segments.js.map +1 -0
  576. package/dist/search/query-parser.d.ts +14 -18
  577. package/dist/search/query-parser.d.ts.map +1 -0
  578. package/dist/search/query-parser.js.map +1 -0
  579. package/dist/search/query-utils.d.ts +45 -17
  580. package/dist/search/query-utils.d.ts.map +1 -0
  581. package/dist/search/query-utils.js +113 -47
  582. package/dist/search/query-utils.js.map +1 -0
  583. package/dist/sync/git-hooks.d.ts +13 -22
  584. package/dist/sync/git-hooks.d.ts.map +1 -0
  585. package/dist/sync/git-hooks.js +4 -0
  586. package/dist/sync/git-hooks.js.map +1 -0
  587. package/dist/sync/index.d.ts +6 -12
  588. package/dist/sync/index.d.ts.map +1 -0
  589. package/dist/sync/index.js +8 -1
  590. package/dist/sync/index.js.map +1 -0
  591. package/dist/sync/watch-policy.d.ts +8 -11
  592. package/dist/sync/watch-policy.d.ts.map +1 -0
  593. package/dist/sync/watch-policy.js.map +1 -0
  594. package/dist/sync/watcher.d.ts +335 -63
  595. package/dist/sync/watcher.d.ts.map +1 -0
  596. package/dist/sync/watcher.js +709 -53
  597. package/dist/sync/watcher.js.map +1 -0
  598. package/dist/sync/worktree.d.ts +63 -0
  599. package/dist/sync/worktree.d.ts.map +1 -0
  600. package/dist/sync/worktree.js +182 -0
  601. package/dist/sync/worktree.js.map +1 -0
  602. package/dist/telemetry/index.d.ts +143 -0
  603. package/dist/telemetry/index.d.ts.map +1 -0
  604. package/dist/telemetry/index.js +541 -0
  605. package/dist/telemetry/index.js.map +1 -0
  606. package/dist/types.d.ts +308 -326
  607. package/dist/types.d.ts.map +1 -0
  608. package/dist/types.js +16 -0
  609. package/dist/types.js.map +1 -0
  610. package/dist/ui/glyphs.d.ts +20 -20
  611. package/dist/ui/glyphs.d.ts.map +1 -0
  612. package/dist/ui/glyphs.js +78 -0
  613. package/dist/ui/glyphs.js.map +1 -0
  614. package/dist/ui/shimmer-progress.d.ts +7 -7
  615. package/dist/ui/shimmer-progress.d.ts.map +1 -0
  616. package/dist/ui/shimmer-progress.js +90 -0
  617. package/dist/ui/shimmer-progress.js.map +1 -0
  618. package/dist/ui/shimmer-worker.d.ts +2 -2
  619. package/dist/ui/shimmer-worker.d.ts.map +1 -0
  620. package/dist/ui/shimmer-worker.js +118 -0
  621. package/dist/ui/shimmer-worker.js.map +1 -0
  622. package/dist/ui/types.d.ts +14 -17
  623. package/dist/ui/types.d.ts.map +1 -0
  624. package/dist/ui/types.js +3 -0
  625. package/dist/ui/types.js.map +1 -0
  626. package/dist/upgrade/index.d.ts +164 -0
  627. package/dist/upgrade/index.d.ts.map +1 -0
  628. package/dist/upgrade/index.js +646 -0
  629. package/dist/upgrade/index.js.map +1 -0
  630. package/dist/upgrade/remove-binary.d.ts +87 -0
  631. package/dist/upgrade/remove-binary.d.ts.map +1 -0
  632. package/dist/upgrade/remove-binary.js +289 -0
  633. package/dist/upgrade/remove-binary.js.map +1 -0
  634. package/dist/upgrade/update-check.d.ts +92 -0
  635. package/dist/upgrade/update-check.d.ts.map +1 -0
  636. package/dist/upgrade/update-check.js +258 -0
  637. package/dist/upgrade/update-check.js.map +1 -0
  638. package/dist/utils.d.ts +116 -123
  639. package/dist/utils.d.ts.map +1 -0
  640. package/dist/utils.js +83 -49
  641. package/dist/utils.js.map +1 -0
  642. package/package.json +42 -10
  643. package/scripts/add-lang/bench.sh +60 -0
  644. package/scripts/add-lang/check-grammar.mjs +75 -0
  645. package/scripts/add-lang/dump-ast.mjs +103 -0
  646. package/scripts/add-lang/verify-extraction.mjs +70 -0
  647. package/scripts/agent-eval/ab-adoption.sh +91 -0
  648. package/scripts/agent-eval/ab-hook.sh +86 -0
  649. package/scripts/agent-eval/ab-impl.sh +78 -0
  650. package/scripts/agent-eval/ab-new-vs-baseline.sh +102 -0
  651. package/scripts/agent-eval/ab-sufficiency.sh +78 -0
  652. package/scripts/agent-eval/arms-F.sh +21 -0
  653. package/scripts/agent-eval/arms-matrix.sh +37 -0
  654. package/scripts/agent-eval/audit.sh +68 -0
  655. package/scripts/agent-eval/bench-readme.sh +28 -0
  656. package/scripts/agent-eval/bench-why-repo.sh +22 -0
  657. package/scripts/agent-eval/block-read-hook.sh +19 -0
  658. package/scripts/agent-eval/hook-settings.json +15 -0
  659. package/scripts/agent-eval/itrun.sh +120 -0
  660. package/scripts/agent-eval/offload-eval-3arm.sh +72 -0
  661. package/scripts/agent-eval/offload-eval-cost.mjs +133 -0
  662. package/scripts/agent-eval/offload-eval-effort.mjs +108 -0
  663. package/scripts/agent-eval/offload-eval-frontload-matrix.sh +25 -0
  664. package/scripts/agent-eval/offload-eval-frontload.sh +47 -0
  665. package/scripts/agent-eval/offload-eval-ground-truth.json +18 -0
  666. package/scripts/agent-eval/offload-eval-hook.mjs +84 -0
  667. package/scripts/agent-eval/offload-eval-judge.mjs +103 -0
  668. package/scripts/agent-eval/offload-eval-matrix.sh +20 -0
  669. package/scripts/agent-eval/offload-eval-metrics.mjs +94 -0
  670. package/scripts/agent-eval/offload-eval-refs1.sh +50 -0
  671. package/scripts/agent-eval/offload-eval-setup.sh +24 -0
  672. package/scripts/agent-eval/offload-eval-styles.sh +72 -0
  673. package/scripts/agent-eval/offload-eval-summarize.mjs +68 -0
  674. package/scripts/agent-eval/offload-eval.md +76 -0
  675. package/scripts/agent-eval/parse-arms.mjs +116 -0
  676. package/scripts/agent-eval/parse-bench-readme.mjs +84 -0
  677. package/scripts/agent-eval/parse-run.mjs +45 -0
  678. package/scripts/agent-eval/parse-session.mjs +93 -0
  679. package/scripts/agent-eval/probe-context.mjs +21 -0
  680. package/scripts/agent-eval/probe-explore.mjs +40 -0
  681. package/scripts/agent-eval/probe-node.mjs +20 -0
  682. package/scripts/agent-eval/probe-sweep.mjs +119 -0
  683. package/scripts/agent-eval/probe-trace.mjs +20 -0
  684. package/scripts/agent-eval/redirect-read-hook.sh +38 -0
  685. package/scripts/agent-eval/repro-concurrent-explore.mjs +119 -0
  686. package/scripts/agent-eval/repro-daemon-clients.mjs +125 -0
  687. package/scripts/agent-eval/run-agent.sh +34 -0
  688. package/scripts/agent-eval/run-all.sh +75 -0
  689. package/scripts/agent-eval/run-arms.sh +56 -0
  690. package/scripts/agent-eval/seq-matrix.mjs +137 -0
  691. package/scripts/build-bundle.sh +123 -0
  692. package/scripts/extract-release-notes.mjs +130 -0
  693. package/scripts/local-install.sh +41 -0
  694. package/scripts/npm-sdk.js +75 -0
  695. package/scripts/npm-shim.js +275 -0
  696. package/scripts/pack-npm.sh +119 -0
  697. package/scripts/prepare-release.mjs +270 -0
  698. package/dist/extraction/wasm/tree-sitter-c.wasm +0 -0
  699. package/dist/extraction/wasm/tree-sitter-cpp.wasm +0 -0
  700. package/dist/extraction/wasm/tree-sitter-dart.wasm +0 -0
  701. package/dist/extraction/wasm/tree-sitter-go.wasm +0 -0
  702. package/dist/extraction/wasm/tree-sitter-java.wasm +0 -0
  703. package/dist/extraction/wasm/tree-sitter-javascript.wasm +0 -0
  704. package/dist/extraction/wasm/tree-sitter-kotlin.wasm +0 -0
  705. package/dist/extraction/wasm/tree-sitter-php.wasm +0 -0
  706. package/dist/extraction/wasm/tree-sitter-python.wasm +0 -0
  707. package/dist/extraction/wasm/tree-sitter-ruby.wasm +0 -0
  708. package/dist/extraction/wasm/tree-sitter-rust.wasm +0 -0
  709. package/dist/extraction/wasm/tree-sitter-swift.wasm +0 -0
  710. package/dist/extraction/wasm/tree-sitter-tsx.wasm +0 -0
  711. package/dist/extraction/wasm/tree-sitter-typescript.wasm +0 -0
  712. package/dist/installer/claude-md-template.d.ts +0 -19
package/README.md ADDED
@@ -0,0 +1,885 @@
1
+ <div align="center">
2
+
3
+ # CodeGraph
4
+
5
+ ## 🎉 1.0 Released!
6
+
7
+ Already installed? Run `codegraph upgrade`
8
+
9
+ Follow [@getcodegraph](https://x.com/getcodegraph) on X for updates.
10
+
11
+ ### Supercharge Claude Code, Cursor, Codex, OpenCode, Hermes Agent, Gemini, Antigravity, and Kiro with Semantic Code Intelligence
12
+
13
+ **Surgical context · fewer tool calls · faster answers · 100% local**
14
+
15
+ ### [Documentation & Website →](https://colbymchenry.github.io/codegraph/)
16
+
17
+ [![npm version](https://img.shields.io/npm/v/@colbymchenry/codegraph.svg)](https://www.npmjs.com/package/@colbymchenry/codegraph)
18
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
19
+ [![Self-contained](https://img.shields.io/badge/Node.js-bundled%20%C2%B7%20none%20required-brightgreen.svg)](https://nodejs.org/)
20
+
21
+ [![Windows](https://img.shields.io/badge/Windows-supported-blue.svg)](#supported-platforms)
22
+ [![macOS](https://img.shields.io/badge/macOS-supported-blue.svg)](#supported-platforms)
23
+ [![Linux](https://img.shields.io/badge/Linux-supported-blue.svg)](#supported-platforms)
24
+
25
+ [![Claude Code](https://img.shields.io/badge/Claude_Code-supported-blueviolet.svg)](#supported-agents)
26
+ [![Cursor](https://img.shields.io/badge/Cursor-supported-blueviolet.svg)](#supported-agents)
27
+ [![Codex](https://img.shields.io/badge/Codex-supported-blueviolet.svg)](#supported-agents)
28
+ [![opencode](https://img.shields.io/badge/opencode-supported-blueviolet.svg)](#supported-agents)
29
+ [![Hermes Agent](https://img.shields.io/badge/Hermes_Agent-supported-blueviolet.svg)](#supported-agents)
30
+ [![Gemini](https://img.shields.io/badge/Gemini-supported-blueviolet.svg)](#supported-agents)
31
+ [![Antigravity](https://img.shields.io/badge/Antigravity-supported-blueviolet.svg)](#supported-agents)
32
+ [![Kiro](https://img.shields.io/badge/Kiro-supported-blueviolet.svg)](#supported-agents)
33
+
34
+ <br>
35
+
36
+ **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.
37
+
38
+ <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?v=2" height="52"></a>
39
+
40
+ <sub>Get <b>early beta access</b> to the hosted product · <a href="https://getcodegraph.com">getcodegraph.com</a></sub>
41
+
42
+ </div>
43
+
44
+ ## Contents
45
+
46
+ - [Get Started](#get-started)
47
+ - [Language Support](#language-support)
48
+ - [Why CodeGraph?](#why-codegraph)
49
+ - [Key Features](#key-features)
50
+ - [Framework-aware Routes](#framework-aware-routes)
51
+ - [Mixed iOS / React Native / Expo bridging](#mixed-ios--react-native--expo-bridging)
52
+ - [Quick Start](#quick-start)
53
+ - [How It Works](#how-it-works)
54
+ - [CLI Reference](#cli-reference)
55
+ - [MCP Tools](#mcp-tools)
56
+ - [Library Usage](#library-usage)
57
+ - [Configuration](#configuration)
58
+ - [Telemetry](#telemetry)
59
+ - [Supported Platforms](#supported-platforms)
60
+ - [Supported Agents](#supported-agents)
61
+ - [Supported Languages](#supported-languages)
62
+ - [Measured cross-file coverage](#measured-cross-file-coverage)
63
+ - [Troubleshooting](#troubleshooting)
64
+ - [Star History](#star-history)
65
+ - [License](#license)
66
+
67
+ ## Get Started
68
+
69
+ ### 1. Install the CLI
70
+
71
+ **No Node.js required** — one command grabs the right build for your OS:
72
+
73
+ ```bash
74
+ # macOS / Linux
75
+ curl -fsSL https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.sh | sh
76
+
77
+ # Windows (PowerShell)
78
+ irm https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.ps1 | iex
79
+ ```
80
+
81
+ <details>
82
+ <summary><b>Already have Node? Use npm instead (works on any version)</b></summary>
83
+
84
+ ```bash
85
+ npm i -g @colbymchenry/codegraph
86
+ ```
87
+
88
+ <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>
89
+
90
+ <sub>**Upgrade any time** with `codegraph upgrade` — it detects how you installed (bundle, npm, or npx) and updates in place. Add `--check` to see if an update is available, or `codegraph upgrade <version>` to pin one.</sub>
91
+
92
+ </details>
93
+
94
+ ### 2. Wire up your agent(s)
95
+
96
+ In a **new terminal**, run the installer to connect CodeGraph to the agents you use:
97
+
98
+ ```bash
99
+ codegraph install
100
+ ```
101
+
102
+ <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. It only wires up your agent — it does **not** index any code; building each project's graph is the separate `codegraph init` in step 3. (Shortcut: `npx @colbymchenry/codegraph` downloads and runs this in one go.)</sub>
103
+
104
+ ### 3. Initialize each project
105
+
106
+ ```bash
107
+ cd your-project
108
+ codegraph init
109
+ ```
110
+
111
+ <sub>`codegraph init` creates the local `.codegraph/` directory and builds the full graph in the same step — one command, done.</sub>
112
+
113
+ <div align="center">
114
+
115
+ ![1_C_VYnhpys0UHrOuOgpgoyw](https://github.com/user-attachments/assets/f168182f-4d9a-44e0-94d7-08d018cc8a3a)
116
+
117
+ </div>
118
+
119
+ ### 4. No more syncing!
120
+
121
+ Auto-sync is enabled by default. CodeGraph watches the project and updates the graph on every file change — while your agent edits code, or you add, modify, or delete files. **The index is never stale, and there is nothing to re-run.**
122
+
123
+ ### Uninstall
124
+
125
+ Changed your mind? One command removes CodeGraph from every agent it configured **and** the CLI itself — every install it finds (standalone bundle, npm global package, launcher link), shown to you before anything is deleted:
126
+
127
+ ```bash
128
+ codegraph uninstall
129
+ ```
130
+
131
+ Pass `--keep-cli` to remove only the agent configurations and keep the CLI installed.
132
+
133
+ <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>
134
+
135
+ ---
136
+
137
+ ## Language Support
138
+
139
+ Every language below gets the same treatment — full structural extraction and cross-file resolution into one graph, no per-language setup:
140
+
141
+ <p align="center">
142
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/typescript.svg?v=1" width="104" height="104" alt="TypeScript" />
143
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/javascript.svg?v=1" width="104" height="104" alt="JavaScript" />
144
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/arkts.svg?v=1" width="104" height="104" alt="ArkTS" />
145
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/python.svg?v=1" width="104" height="104" alt="Python" />
146
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/go.svg?v=1" width="104" height="104" alt="Go" />
147
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/rust.svg?v=1" width="104" height="104" alt="Rust" />
148
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/java.svg?v=1" width="104" height="104" alt="Java" />
149
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/csharp.svg?v=1" width="104" height="104" alt="C#" />
150
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/php.svg?v=1" width="104" height="104" alt="PHP" />
151
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/ruby.svg?v=1" width="104" height="104" alt="Ruby" />
152
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/c.svg?v=1" width="104" height="104" alt="C" />
153
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/cpp.svg?v=1" width="104" height="104" alt="C++" />
154
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/objective-c.svg?v=1" width="104" height="104" alt="Objective-C" />
155
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/metal.svg?v=1" width="104" height="104" alt="Metal" />
156
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/cuda.svg?v=1" width="104" height="104" alt="CUDA" />
157
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/swift.svg?v=1" width="104" height="104" alt="Swift" />
158
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/kotlin.svg?v=1" width="104" height="104" alt="Kotlin" />
159
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/scala.svg?v=1" width="104" height="104" alt="Scala" />
160
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/dart.svg?v=1" width="104" height="104" alt="Dart" />
161
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/svelte.svg?v=1" width="104" height="104" alt="Svelte" />
162
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/vue.svg?v=1" width="104" height="104" alt="Vue" />
163
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/astro.svg?v=1" width="104" height="104" alt="Astro" />
164
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/liquid.svg?v=1" width="104" height="104" alt="Liquid" />
165
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/delphi.svg?v=1" width="104" height="104" alt="Pascal / Delphi" />
166
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/lua.svg?v=1" width="104" height="104" alt="Lua" />
167
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/r.svg?v=1" width="104" height="104" alt="R" />
168
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/luau.svg?v=1" width="104" height="104" alt="Luau" />
169
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/cfml.svg?v=1" width="104" height="104" alt="CFML" />
170
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/cobol.svg?v=1" width="104" height="104" alt="COBOL" />
171
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/vbnet.svg?v=1" width="104" height="104" alt="Visual Basic .NET" />
172
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/erlang.svg?v=1" width="104" height="104" alt="Erlang" />
173
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/solidity.svg?v=1" width="104" height="104" alt="Solidity" />
174
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/terraform.svg?v=1" width="104" height="104" alt="Terraform / OpenTofu" />
175
+ <img src="https://raw.githubusercontent.com/colbymchenry/codegraph/main/assets/languages/nix.svg?v=1" width="104" height="104" alt="Nix" />
176
+ </p>
177
+
178
+ <sub>Per-language details — extensions, frameworks, and what exactly gets extracted — in [Supported Languages](#supported-languages).</sub>
179
+
180
+ ---
181
+
182
+ ## Why CodeGraph?
183
+
184
+ When an AI agent needs to understand code — to answer a question or make a change — it discovers structure the slow way: grep, glob, and Read, one file at a time, rebuilding call paths and dependencies by hand. That's a pile of tool calls and round-trips before it even starts the real work.
185
+
186
+ **CodeGraph hands the agent the exact code it needs in one call.** It's a pre-built knowledge graph of every symbol, call edge, and dependency in your codebase — so instead of crawling files, the agent asks one question and gets back the relevant source, the call paths between those symbols (including dynamic-dispatch hops grep can't follow), and the blast radius of a change. **Surgical context, not a file-by-file search** — which means fewer tool calls and faster answers on every codebase, large or small.
187
+
188
+ <img width="1536" height="1024" alt="token-cost-savings-scale" src="https://github.com/user-attachments/assets/eb74a11a-a3ab-4b01-80a6-19f78352ae8e" />
189
+
190
+ > **A note on cost:** CodeGraph's win on *every* codebase is precision and speed — fewer tool calls, faster answers. It cuts token and dollar cost too, but those savings are **scale-dependent**: small and noisy on a modest codebase, and material only once a repo is large and tangled — at the scale of a Google or Microsoft monorepo, multiplied by a whole team's daily agent usage — for them to compound into a real line item. On a 500-file project, adopt CodeGraph for the speed; the cost savings show up when the codebase (and the team) gets big.
191
+
192
+ ### Benchmark Results
193
+
194
+ 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, 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)._
195
+
196
+ > **The universal win — every repo, every size: 58% fewer tool calls · 22% faster · file reads cut to ~zero.**
197
+
198
+ The reliable, universal payoff is **surgical context and speed**: CodeGraph collapses the agent's grep/find/Read crawl into a few direct queries — returning the exact methods you asked about even when they're buried in a multi-thousand-line file — so it answers with **near-zero file reads** while the no-CodeGraph agent spends its budget on discovery. The **Tokens** and **Cost** columns are real too, but — as noted above — they're **scale-dependent**: small and noisy per query, compounding into real money only at large-codebase, high-volume scale.
199
+
200
+ | Codebase | Language | Tool calls | Time | File reads | Tokens | Cost |
201
+ |----------|----------|------------|------|------------|--------|------|
202
+ | **VS Code** | TypeScript · ~10k files | 81% fewer | 11% faster | 0 vs 9 | 64% fewer | 18% cheaper |
203
+ | **Excalidraw** | TypeScript · ~640 | 40% fewer | 27% faster | 0 vs 7 | 25% fewer | even |
204
+ | **Django** | Python · ~3k | 77% fewer | 13% faster | 0 vs 9 | 60% fewer | 8% cheaper |
205
+ | **Tokio** | Rust · ~790 | 57% fewer | 18% faster | 0 vs 8 | 38% fewer | even |
206
+ | **OkHttp** | Java · ~645 | 50% fewer | 31% faster | 0 vs 4 | 54% fewer | 25% cheaper |
207
+ | **Gin** | Go · ~110 | 44% fewer | 24% faster | 1 vs 6 | 23% fewer | 19% cheaper |
208
+ | **Alamofire** | Swift · ~110 | 58% fewer | 33% faster | 0 vs 9 | 64% fewer | 40% cheaper |
209
+
210
+ <sub>**File reads** = median files the agent opened **with** vs **without** CodeGraph — the surgical-context win in one column. **Tokens** and **Cost** are the same with-vs-without deltas; they're directional (they move run-to-run) and, per query, small in absolute terms — which is why they only become a line item at scale. `codegraph_explore` also collapses redundant interchangeable implementations to signatures, so a response is sized to the *answer* rather than the file count.</sub>
211
+
212
+ <details>
213
+ <summary><strong>Per-repo breakdown — WITH vs WITHOUT (median of 4)</strong></summary>
214
+
215
+ **VS Code** · ~10k files
216
+ | Metric | WITH cg | WITHOUT cg | Δ |
217
+ |---|---|---|---|
218
+ | Time | 1m 59s | 2m 13s | 11% faster |
219
+ | File Reads | 0 | 9 | −9 |
220
+ | Grep/Bash | 0 | 11 | −11 |
221
+ | Tool calls | 4 | 21 | 81% fewer |
222
+ | Total tokens | 640k | 1.79M | 64% fewer |
223
+ | Cost | $0.68 | $0.83 | 18% cheaper |
224
+
225
+ **Excalidraw** · ~640 files
226
+ | Metric | WITH cg | WITHOUT cg | Δ |
227
+ |---|---|---|---|
228
+ | Time | 1m 32s | 2m 6s | 27% faster |
229
+ | File Reads | 0 | 7 | −7 |
230
+ | Grep/Bash | 1 | 8 | −7 |
231
+ | Tool calls | 9 | 15 | 40% fewer |
232
+ | Total tokens | 1.27M | 1.69M | 25% fewer |
233
+ | Cost | $0.78 | $0.78 | even |
234
+
235
+ **Django** · ~3k files
236
+ | Metric | WITH cg | WITHOUT cg | Δ |
237
+ |---|---|---|---|
238
+ | Time | 1m 43s | 1m 58s | 13% faster |
239
+ | File Reads | 0 | 9 | −9 |
240
+ | Grep/Bash | 0 | 5 | −5 |
241
+ | Tool calls | 3 | 13 | 77% fewer |
242
+ | Total tokens | 559k | 1.41M | 60% fewer |
243
+ | Cost | $0.57 | $0.62 | 8% cheaper |
244
+
245
+ **Tokio** · ~790 files
246
+ | Metric | WITH cg | WITHOUT cg | Δ |
247
+ |---|---|---|---|
248
+ | Time | 1m 55s | 2m 20s | 18% faster |
249
+ | File Reads | 0 | 8 | −8 |
250
+ | Grep/Bash | 0 | 6 | −6 |
251
+ | Tool calls | 6 | 14 | 57% fewer |
252
+ | Total tokens | 1.08M | 1.73M | 38% fewer |
253
+ | Cost | $0.82 | $0.82 | even |
254
+
255
+ **OkHttp** · ~645 files
256
+ | Metric | WITH cg | WITHOUT cg | Δ |
257
+ |---|---|---|---|
258
+ | Time | 1m 1s | 1m 29s | 31% faster |
259
+ | File Reads | 0 | 4 | −4 |
260
+ | Grep/Bash | 2 | 6 | −4 |
261
+ | Tool calls | 5 | 10 | 50% fewer |
262
+ | Total tokens | 502k | 1.10M | 54% fewer |
263
+ | Cost | $0.41 | $0.55 | 25% cheaper |
264
+
265
+ **Gin** · ~110 files
266
+ | Metric | WITH cg | WITHOUT cg | Δ |
267
+ |---|---|---|---|
268
+ | Time | 1m 14s | 1m 37s | 24% faster |
269
+ | File Reads | 1 | 6 | −5 |
270
+ | Grep/Bash | 1 | 2 | −1 |
271
+ | Tool calls | 5 | 9 | 44% fewer |
272
+ | Total tokens | 651k | 847k | 23% fewer |
273
+ | Cost | $0.46 | $0.57 | 19% cheaper |
274
+
275
+ **Alamofire** · ~110 files
276
+ | Metric | WITH cg | WITHOUT cg | Δ |
277
+ |---|---|---|---|
278
+ | Time | 1m 35s | 2m 21s | 33% faster |
279
+ | File Reads | 0 | 9 | −9 |
280
+ | Grep/Bash | 0 | 4 | −4 |
281
+ | Tool calls | 5 | 12 | 58% fewer |
282
+ | Total tokens | 766k | 2.10M | 64% fewer |
283
+ | Cost | $0.57 | $0.95 | 40% cheaper |
284
+
285
+ </details>
286
+
287
+ <details>
288
+ <summary><strong>Full benchmark details</strong></summary>
289
+
290
+ **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).
291
+
292
+ **Queries:**
293
+ | Codebase | Query |
294
+ |----------|-------|
295
+ | VS Code | "How does the extension host communicate with the main process?" |
296
+ | Excalidraw | "How does Excalidraw render and update canvas elements?" |
297
+ | Django | "How does Django's ORM build and execute a query from a QuerySet?" |
298
+ | Tokio | "How does tokio schedule and run async tasks on its runtime?" |
299
+ | OkHttp | "How does OkHttp process a request through its interceptor chain?" |
300
+ | Gin | "How does gin route requests through its middleware chain?" |
301
+ | Alamofire | "How does Alamofire build, send, and validate a request?" |
302
+
303
+ **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.
304
+
305
+ </details>
306
+
307
+ ---
308
+
309
+ ## Key Features
310
+
311
+ | | |
312
+ |---|---|
313
+ | **Surgical Context** | One tool call returns entry points, related symbols, and code snippets — no slow file-by-file exploration |
314
+ | **Full-Text Search** | Find code by name instantly across your entire codebase, powered by FTS5 |
315
+ | **Impact Analysis** | Trace callers, callees, and the full impact radius of any symbol before making changes |
316
+ | **Always Fresh** | File watcher uses native OS events (FSEvents/inotify/ReadDirectoryChangesW) with debounced auto-sync — the graph stays current as you code, zero config |
317
+ | **20+ Languages** | TypeScript, JavaScript, ArkTS, Python, Go, Rust, Java, C#, VB.NET, PHP, Ruby, C, C++, CUDA, Objective-C, Metal, Swift, Kotlin, Scala, Dart, Lua, Luau, R, Nix, Erlang, CFML, COBOL, Solidity, Terraform/OpenTofu, Svelte, Vue, Astro, Liquid, Pascal/Delphi |
318
+ | **Framework-aware Routes** | Recognizes web-framework routing files and links URL patterns to their handlers across 17 frameworks |
319
+ | **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 |
320
+ | **100% Local** | No data leaves your machine. No API keys. No external services. SQLite database only |
321
+
322
+ <details>
323
+ <summary><strong>How auto-syncing works — and why you don't need to run <code>codegraph sync</code> manually</strong></summary>
324
+
325
+ 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:
326
+
327
+ 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.
328
+
329
+ 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.
330
+
331
+ 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.
332
+
333
+ ```
334
+ agent writes src/Widget.ts
335
+ → watcher fires (<100ms)
336
+ → debounce (default 2s)
337
+ → sync; Widget.ts is in the index
338
+ → next agent query sees it
339
+ ```
340
+
341
+ **Verify any time** with `codegraph status` (CLI). If anything is pending, you'll see a `### Pending sync:` section naming the files and their edit age.
342
+
343
+ 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.
344
+
345
+ → Full deep-dive in [Guides → Indexing a Project](https://colbymchenry.github.io/codegraph/guides/indexing/#stay-fresh-automatically).
346
+
347
+ </details>
348
+
349
+ ---
350
+
351
+ ## Framework-aware Routes
352
+
353
+ CodeGraph detects web-framework routing files and emits `route` nodes linked by `references` edges to their handler classes or functions. Querying callers of a view/controller now surfaces the URL pattern that binds it.
354
+
355
+ | Framework | Shapes recognized |
356
+ |---|---|
357
+ | **Django** | `path()`, `re_path()`, `url()`, `include()` in `urls.py` (CBV `.as_view()`, dotted paths) |
358
+ | **Flask** | `@app.route('/path', methods=[...])`, blueprint routes |
359
+ | **FastAPI** | `@app.get(...)`, `@router.post(...)`, all standard methods |
360
+ | **Express** | `app.get(...)`, `router.post(...)` with middleware chains |
361
+ | **NestJS** | `@Controller` + `@Get/@Post/...`, GraphQL `@Resolver` + `@Query/@Mutation`, `@MessagePattern`/`@EventPattern`, `@SubscribeMessage` |
362
+ | **Laravel** | `Route::get()`, `Route::resource()`, `Controller@action`, tuple syntax |
363
+ | **Drupal** | `*.routing.yml` routes (`_controller`, `_form`, entity handlers); `hook_*` implementations in `.module`/`.theme`/`.install`/`.inc` |
364
+ | **Rails** | `get '/x', to: 'users#index'`, hash-rocket `=>` syntax |
365
+ | **Spring** | `@GetMapping`, `@PostMapping`, `@RequestMapping` on methods |
366
+ | **Play** | `GET`/`POST`/… verb routes in `conf/routes` → `Controller.method` actions (Scala + Java) |
367
+ | **Gin / chi / gorilla / mux** | `r.GET(...)`, `router.HandleFunc(...)` |
368
+ | **Axum / actix / Rocket** | `.route("/x", get(handler))` |
369
+ | **ASP.NET** | `[HttpGet("/x")]` attributes on action methods |
370
+ | **Vapor** | `app.get("x", use: handler)` |
371
+ | **React Router** / **SvelteKit** | Route component nodes |
372
+ | **Vue Router** / **Nuxt** | `pages/` file-based routes, `server/api/` endpoints, route middleware |
373
+ | **Astro** | `src/pages/` file-based routes (`.astro` pages + `.ts` endpoints, `[param]`/`[...rest]` syntax) |
374
+
375
+ ---
376
+
377
+ ## Mixed iOS / React Native / Expo bridging
378
+
379
+ 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 `codegraph_explore` connects the flow end-to-end across the gap — call paths and blast radius cross the boundary instead of stopping at it.
380
+
381
+ | Boundary | JS / Swift side | Native side | How |
382
+ |---|---|---|---|
383
+ | **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`/…) |
384
+ | **ObjC → Swift** | ObjC `[obj fooWithBar:]` | Swift `@objc func foo(bar:)` | Reverse-bridge name candidates; verifies `@objc` exposure from source |
385
+ | **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 |
386
+ | **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 |
387
+ | **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 |
388
+ | **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 |
389
+ | **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 |
390
+ | **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 |
391
+
392
+ **Validated on real codebases** (small + medium + large for each bridge):
393
+
394
+ | Bridge | Small | Medium | Large |
395
+ |---|---|---|---|
396
+ | Swift ↔ ObjC | [Charts](https://github.com/danielgindi/Charts) | [realm-swift](https://github.com/realm/realm-swift) | [Wikipedia-iOS](https://github.com/wikimedia/wikipedia-ios) |
397
+ | 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) |
398
+ | RN native → JS events | [RNGeolocation](https://github.com/Agontuk/react-native-geolocation-service) | — | react-native-firebase |
399
+ | Expo Modules | expo-haptics | expo-camera | expo SDK sweep (7 packages) |
400
+ | 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) |
401
+
402
+ 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.
403
+
404
+ ---
405
+
406
+ ## Quick Start
407
+
408
+ ### 1. Run the Installer
409
+
410
+ ```bash
411
+ npx @colbymchenry/codegraph
412
+ ```
413
+
414
+ The installer will:
415
+ - Ask which agent(s) to configure — auto-detects installed ones from: **Claude Code**, **Cursor**, **Codex CLI**, **opencode**, **Hermes Agent**, **Gemini CLI**, **Antigravity IDE**, **Kiro**
416
+ - Prompt to install `codegraph` on your PATH (so agents can launch the MCP server)
417
+ - Ask whether configs apply to all your projects or just this one
418
+ - Write each chosen agent's MCP server config, plus a small marker-fenced CodeGraph section in the agent's instructions file (`CLAUDE.md` / `AGENTS.md` / `GEMINI.md`) — that's how subagents and non-MCP agents learn the `codegraph explore` command, since the MCP server's own guidance only reaches the main agent. Removed cleanly by `codegraph uninstall`.
419
+ - Set up auto-allow permissions when Claude Code is one of the targets
420
+
421
+ The installer **wires up your agents only — it does not index your code.** After it finishes, build each project's graph yourself with `codegraph init` (step 3). One global `codegraph install` covers every project; you run `codegraph init` once per project.
422
+
423
+ **Non-interactive (scripting / CI):**
424
+
425
+ ```bash
426
+ codegraph install --yes # auto-detect agents, install global
427
+ codegraph install --target=cursor,claude --yes # explicit target list
428
+ codegraph install --target=auto --location=local # detected agents, project-local
429
+ codegraph install --print-config codex # print snippet, no file writes
430
+ ```
431
+
432
+ | Flag | Values | Default |
433
+ |---|---|---|
434
+ | `--target` | `auto`, `all`, `none`, or csv (`claude,cursor,...`) | prompt |
435
+ | `--location` | `global`, `local` | prompt |
436
+ | `--yes` | (boolean) | prompt every step |
437
+ | `--no-permissions` | (boolean) skip Claude auto-allow list | permissions on |
438
+ | `--print-config <id>` | dump snippet for one agent and exit | — |
439
+
440
+ ### 2. Restart Your Agent
441
+
442
+ Restart your agent (Claude Code / Cursor / Codex CLI / opencode / Hermes Agent / Gemini CLI / Antigravity IDE / Kiro) for the MCP server to load.
443
+
444
+ ### 3. Initialize Projects
445
+
446
+ ```bash
447
+ cd your-project
448
+ codegraph init
449
+ ```
450
+
451
+ Builds the per-project knowledge graph index, which then auto-syncs on every file change. A single global `codegraph install` works in every project you open — no need to re-run the installer per project.
452
+
453
+ That's it — your agent will use CodeGraph tools automatically when a `.codegraph/` directory exists.
454
+
455
+ <details>
456
+ <summary><strong>Manual Setup (Alternative)</strong></summary>
457
+
458
+ **Install globally:**
459
+ ```bash
460
+ npm install -g @colbymchenry/codegraph
461
+ ```
462
+
463
+ **Add to `~/.claude.json`:**
464
+ ```json
465
+ {
466
+ "mcpServers": {
467
+ "codegraph": {
468
+ "type": "stdio",
469
+ "command": "codegraph",
470
+ "args": ["serve", "--mcp"]
471
+ }
472
+ }
473
+ }
474
+ ```
475
+
476
+ **Add to `~/.claude/settings.json` (optional, for auto-allow):**
477
+ ```json
478
+ {
479
+ "permissions": {
480
+ "allow": [
481
+ "mcp__codegraph__*"
482
+ ]
483
+ }
484
+ }
485
+ ```
486
+
487
+ <sub>One wildcard auto-approves every CodeGraph tool — `codegraph_explore` is the only one listed by default, but if you re-enable others via `CODEGRAPH_MCP_TOOLS` they're already permitted, no prompt.</sub>
488
+
489
+ </details>
490
+
491
+ <details>
492
+ <summary><strong>Agent Tool Guidance</strong></summary>
493
+
494
+ CodeGraph's MCP server delivers its usage guidance to your agent **automatically**, in the MCP `initialize` response. In short, it tells the agent to:
495
+
496
+ - **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.
497
+ - **Reach for `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' verbatim source grouped by file, the call paths between them (dynamic-dispatch hops included), and a blast-radius summary. Name a file or symbol in the query to read its current line-numbered source.
498
+ - **Trust the results — don't re-verify with grep**, and check the staleness banner after edits.
499
+ - Works **per project**: query any project that has a `.codegraph/` index by passing `projectPath` — so a monorepo where only some services are indexed, or a second repo, works in one session. A path with no index returns clean guidance to use built-in tools; indexing stays your decision.
500
+
501
+ The exact text is `src/mcp/server-instructions.ts` — the single source of truth for the main agent. Because subagents and non-MCP harnesses never see the MCP guidance, the installer also writes a short marker-fenced section into the agent's instructions file pointing at the `codegraph explore` CLI equivalent.
502
+
503
+ </details>
504
+
505
+ ---
506
+
507
+ ## How It Works
508
+
509
+ ```
510
+ ┌───────────────────────────────────────────────────────────────────┐
511
+ │ Claude Code │
512
+ │ │
513
+ │ "How does a request reach the database?" │
514
+ │ calls CodeGraph tools directly — no Explore sub-agent │
515
+ │ │ │
516
+ └─────────────────────────────────┬─────────────────────────────────┘
517
+
518
+
519
+ ┌───────────────────────────────────────────────────────────────────┐
520
+ │ CodeGraph MCP Server │
521
+ │ │
522
+ │ explore · one call → verbatim source + call flow + blast radius │
523
+ │ │ │
524
+ │ ▼ │
525
+ │ SQLite knowledge graph │
526
+ │ symbols · edges · files · FTS5 full-text search │
527
+ └───────────────────────────────────────────────────────────────────┘
528
+ ```
529
+
530
+ 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).
531
+
532
+ 2. **Storage** — Everything goes into a local SQLite database (`.codegraph/codegraph.db`) with FTS5 full-text search.
533
+
534
+ 3. **Resolution** — After extraction, references are resolved: function calls → definitions, imports → source files, class inheritance, and framework-specific patterns.
535
+
536
+ 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.
537
+
538
+ ---
539
+
540
+ ## CLI Reference
541
+
542
+ ```bash
543
+ codegraph # Run interactive installer
544
+ codegraph install # Run installer (explicit)
545
+ codegraph uninstall # Remove CodeGraph from your agents AND the CLI (--keep-cli for configs only)
546
+ codegraph init [path] # Initialize a project + build its graph (one step)
547
+ codegraph uninit [path] # Remove CodeGraph from a project (--force to skip prompt)
548
+ codegraph index [path] # Full index (--force to re-index, --quiet for less output)
549
+ codegraph sync [path] # Incremental update
550
+ codegraph status [path] # Show statistics
551
+ codegraph unlock [path] # Remove a stale lock file that's blocking indexing
552
+ codegraph query <search> # Search symbols (--kind, --limit, --json)
553
+ codegraph explore <query> # Relevant symbols' source + call paths in one shot (same output as the codegraph_explore MCP tool)
554
+ codegraph node <symbol|file> # One symbol's source + callers, or read a file with line numbers (same output as codegraph_node)
555
+ codegraph files [path] # Show file structure (--format, --filter, --max-depth, --json)
556
+ codegraph callers <symbol> # Find what calls a function/method (--limit, --json)
557
+ codegraph callees <symbol> # Find what a function/method calls (--limit, --json)
558
+ codegraph impact <symbol> # Analyze what code is affected by changing a symbol (--depth, --json)
559
+ codegraph affected [files...] # Find test files affected by changes (see below)
560
+ codegraph daemon # Manage background daemons — pick one to stop (alias: daemons)
561
+ codegraph telemetry [on|off] # Show or change anonymous usage telemetry
562
+ codegraph upgrade [version] # Update to the latest release (--check, --force)
563
+ codegraph version # Print the installed version (also -v, --version)
564
+ codegraph help [command] # Show help, optionally for one command
565
+ ```
566
+
567
+ ### `codegraph affected`
568
+
569
+ Traces import dependencies transitively to find which test files are affected by changed source files.
570
+
571
+ ```bash
572
+ codegraph affected src/utils.ts src/api.ts # Pass files as arguments
573
+ git diff --name-only | codegraph affected --stdin # Pipe from git diff
574
+ codegraph affected src/auth.ts --filter "e2e/*" # Custom test file pattern
575
+ ```
576
+
577
+ | Option | Description | Default |
578
+ |--------|-------------|---------|
579
+ | `--stdin` | Read file list from stdin | `false` |
580
+ | `-d, --depth <n>` | Max dependency traversal depth | `5` |
581
+ | `-f, --filter <glob>` | Custom glob to identify test files | auto-detect |
582
+ | `-j, --json` | Output as JSON | `false` |
583
+ | `-q, --quiet` | Output file paths only | `false` |
584
+
585
+ **CI/hook example:**
586
+
587
+ ```bash
588
+ #!/usr/bin/env bash
589
+ AFFECTED=$(git diff --name-only HEAD | codegraph affected --stdin --quiet)
590
+ if [ -n "$AFFECTED" ]; then
591
+ npx vitest run $AFFECTED
592
+ fi
593
+ ```
594
+
595
+ ---
596
+
597
+ ## MCP Tools
598
+
599
+ When running as an MCP server, CodeGraph exposes a **single tool** — `codegraph_explore`. Measured agent behavior showed that one strong tool steers agents better than a menu of narrower ones — fewer mis-picks, and it saves context every session:
600
+
601
+ | Tool | Purpose |
602
+ |------|---------|
603
+ | `codegraph_explore` | 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 the call paths between them and a blast-radius summary. Surfaces dynamic-dispatch hops (callbacks, React re-render, interface→impl) grep can't follow. Name a file or symbol in the query to read its current line-numbered source, the same shape the Read tool gives you. |
604
+
605
+ The other tools (`codegraph_node`, `codegraph_search`, `codegraph_callers`, `codegraph_callees`, `codegraph_impact`, `codegraph_files`, `codegraph_status`) stay fully functional but **unlisted by default** — everything they return already arrives inline on `codegraph_explore` (its blast-radius section, the relationship map, a symbol's body as its callee list). Re-enable any of them for the MCP surface with the `CODEGRAPH_MCP_TOOLS` environment variable (e.g. `CODEGRAPH_MCP_TOOLS=explore,node,search,callers`), or use their CLI equivalents (`codegraph node` / `query` / `callers` / `callees` / `impact` / `files` / `status`).
606
+
607
+ Even when the server's own root has no `.codegraph/` index, the tools stay available: pass `projectPath` to query any indexed project — a sub-service in a monorepo, or a second repo — in the same session. A path that has no index returns clean guidance to use built-in tools instead, so nothing fails loudly, and indexing stays your decision.
608
+
609
+ ---
610
+
611
+ ## Library Usage
612
+
613
+ CodeGraph can be embedded directly. The npm package re-exports its programmatic
614
+ API, so both `import` and `require` resolve the `CodeGraph` class in your own
615
+ process — handy for embedding it in an app (e.g. an Electron main process).
616
+
617
+ ```typescript
618
+ import CodeGraph from '@colbymchenry/codegraph';
619
+ // CommonJS works too:
620
+ // const { CodeGraph } = require('@colbymchenry/codegraph');
621
+
622
+ const cg = await CodeGraph.init('/path/to/project');
623
+ // Or: const cg = await CodeGraph.open('/path/to/project');
624
+
625
+ await cg.indexAll({
626
+ onProgress: (p) => console.log(`${p.phase}: ${p.current}/${p.total}`)
627
+ });
628
+
629
+ const results = cg.searchNodes('UserService');
630
+ const callers = cg.getCallers(results[0].node.id);
631
+ const context = await cg.buildContext('fix login bug', { maxNodes: 20, includeCode: true, format: 'markdown' });
632
+ const impact = cg.getImpactRadius(results[0].node.id, 2);
633
+
634
+ cg.watch(); // auto-sync on file changes
635
+ cg.unwatch(); // stop watching
636
+ cg.close();
637
+ ```
638
+
639
+ Lower-level building blocks are exported from the same entry point for callers
640
+ that drive the graph directly: `DatabaseConnection`, `QueryBuilder`,
641
+ `getDatabasePath`, `initGrammars` / `loadGrammarsForLanguages`, and `FileLock`.
642
+
643
+ **Embedding requirements**
644
+
645
+ - Install from npm (`npm i @colbymchenry/codegraph`) so the matching
646
+ per-platform package — which carries the compiled library and its
647
+ dependencies — is fetched alongside the shim.
648
+ - The API runs on **your** runtime, so it needs **Node 22.5+** for the built-in
649
+ `node:sqlite` (Electron qualifies when its bundled Node is 22.5+). The CLI and
650
+ MCP server are unaffected — they run on the self-contained bundled runtime.
651
+ - TypeScript types ship with the package. As with any Node-targeting library,
652
+ keep `@types/node` available and `skipLibCheck: true` (the common default).
653
+
654
+ ---
655
+
656
+ ## Configuration
657
+
658
+ Next to none — CodeGraph is **zero-config by default**, with nothing to write or
659
+ keep in sync to get started. Language support is automatic from the file
660
+ extension; there's nothing to wire up per language. The one optional file is for
661
+ mapping [custom file extensions](#custom-file-extensions).
662
+
663
+ What it skips out of the box:
664
+
665
+ - **Dependency, build, and cache directories** — `node_modules`, `vendor`,
666
+ `dist`, `build`, `target`, `.venv`, `Pods`, `.next`, and the like across every
667
+ [supported stack](#supported-languages) — so the graph is your code, not
668
+ third-party noise. This holds even with no `.gitignore`.
669
+ - **Anything in your `.gitignore`** — honored in git repos via git, and in
670
+ non-git projects by reading `.gitignore` directly (root and nested).
671
+ - **Files larger than 1 MB** — generated bundles, minified JS, vendored blobs.
672
+
673
+ To keep something else out, add it to `.gitignore`. To pull a default-excluded
674
+ directory back **in** (say you really do want a vendored dependency indexed),
675
+ add a negation — `!vendor/`. The defaults apply uniformly, so committing a
676
+ dependency or build directory doesn't force it into the graph; the `.gitignore`
677
+ negation is the explicit opt-in.
678
+
679
+ `.gitignore` can't drop a directory you've **committed**, though. For a vendored
680
+ theme or SDK that's checked into the repo (e.g. a Metronic theme under
681
+ `static/`), list it under `exclude` in `codegraph.json` — gitignore-style
682
+ patterns, matched against repo-root-relative paths, honored on index, sync, and
683
+ watch:
684
+
685
+ ```json
686
+ {
687
+ "exclude": ["static/", "**/vendor/**"]
688
+ }
689
+ ```
690
+
691
+ Conversely, when real source is gitignored on purpose — a project under a second
692
+ VCS (SVN, Perforce) that `.gitignore`s its own source so it stays out of Git —
693
+ force it back in with `include` (the opposite of `exclude`; `includeIgnored`
694
+ only revives embedded git repos, not plain source):
695
+
696
+ ```json
697
+ {
698
+ "include": ["Tools/", "Local/typescript/"]
699
+ }
700
+ ```
701
+
702
+ CodeGraph discovers those files off disk, overriding `.gitignore`, on index,
703
+ sync, and watch. An explicit `exclude` still wins, and built-in skips
704
+ (`node_modules`, `dist`, `.git`) are never re-included.
705
+
706
+ ### Custom file extensions
707
+
708
+ If your project uses a non-standard extension for a [supported
709
+ language](#supported-languages) — say `.dota_lua` for Lua, or `.tpl` for PHP —
710
+ those files are skipped by default, because the extension isn't one CodeGraph
711
+ recognizes. Map them with an optional **`codegraph.json`** at your project root:
712
+
713
+ ```json
714
+ {
715
+ "extensions": {
716
+ ".dota_lua": "lua",
717
+ ".tpl": "php"
718
+ }
719
+ }
720
+ ```
721
+
722
+ Each value is a supported language id. The mappings merge on top of the built-in
723
+ defaults and win on conflict, so you can also re-point a built-in (e.g.
724
+ `".h": "cpp"`). Commit the file to share the mapping with your team. A typo'd
725
+ language or a malformed file is warned about and skipped — it never breaks
726
+ indexing — and a project with no `codegraph.json` behaves exactly as before.
727
+ Re-index (`codegraph index`) after adding or changing mappings.
728
+
729
+ ## Telemetry
730
+
731
+ CodeGraph collects **anonymous usage statistics** — which tools and commands get
732
+ used, which languages get indexed — to guide where language and agent support
733
+ work goes. **Never** any code, paths, file or symbol names, queries, or IP
734
+ addresses; usage is aggregated locally into daily totals before anything is
735
+ sent, and the ingest endpoint is [public code in this repo](telemetry-worker/)
736
+ that enforces the documented field list. The installer asks up front; turn it
737
+ off any time:
738
+
739
+ ```bash
740
+ codegraph telemetry off # or: CODEGRAPH_TELEMETRY=0, or DO_NOT_TRACK=1
741
+ ```
742
+
743
+ [`TELEMETRY.md`](TELEMETRY.md) lists every field, with the off-switches and the
744
+ full data-handling story.
745
+
746
+ ## Supported Platforms
747
+
748
+ Every release ships a self-contained build (bundled Node runtime — nothing to
749
+ compile) for all three desktop OSes, on both Intel/AMD (x64) and ARM (arm64):
750
+
751
+ | Platform | Architectures | Install |
752
+ |----------|---------------|---------|
753
+ | Windows | x64, arm64 | PowerShell installer or npm |
754
+ | macOS | x64, arm64 | shell installer or npm |
755
+ | Linux | x64, arm64 | shell installer or npm |
756
+
757
+ See [Get Started](#get-started) for the one-line install commands.
758
+
759
+ ## Supported Agents
760
+
761
+ The interactive installer auto-detects and configures each of these — wiring up
762
+ the MCP server (which delivers its own usage guidance, so no instructions file
763
+ is written):
764
+
765
+ - **Claude Code**
766
+ - **Cursor**
767
+ - **Codex CLI**
768
+ - **opencode**
769
+ - **Hermes Agent**
770
+ - **Gemini CLI**
771
+ - **Antigravity IDE**
772
+ - **Kiro**
773
+
774
+ ## Supported Languages
775
+
776
+ | Language | Extension | Status |
777
+ |----------|-----------|--------|
778
+ | TypeScript | `.ts`, `.tsx` | Full support |
779
+ | JavaScript | `.js`, `.jsx`, `.mjs` | Full support |
780
+ | ArkTS (HarmonyOS) | `.ets` | Full support (everything TypeScript has, plus `@Component`/`@ComponentV2` structs with their ArkUI decorators (`@State`/`@Prop`/`@Link`/`@Local`/`@Builder`/…), `build()` view trees — parent→child component edges, chained-attribute links to `@Extend`/`@Styles` functions, `.onClick(this.handler)` event bindings — dynamic-dispatch bridges for state→`build()` re-renders, `@ohos.events.emitter` emit→subscriber pairs (static event keys only), and `router.pushUrl` literal urls → the target page struct; ohpm workspace modules resolve bare `import { X } from "data"` through `oh-package.json5` `file:` dependencies, honoring each module's `main` entry) |
781
+ | Python | `.py` | Full support |
782
+ | Go | `.go` | Full support |
783
+ | Rust | `.rs` | Full support |
784
+ | Java | `.java` | Full support |
785
+ | C# | `.cs` | Full support |
786
+ | PHP | `.php` | Full support |
787
+ | Ruby | `.rb` | Full support |
788
+ | C | `.c`, `.h` | Full support |
789
+ | C++ | `.cpp`, `.hpp`, `.cc` | Full support |
790
+ | Objective-C | `.m`, `.mm`, `.h` | Partial support (classes, protocols, methods, `@property`, `#import`, message sends; `.mm` ObjC++ may parse incompletely) |
791
+ | Metal | `.metal` | Full support (vertex/fragment/kernel functions, structs, type aliases, call edges — MSL parses as C++, with `[[attribute]]` annotations handled) |
792
+ | CUDA | `.cu`, `.cuh` | Full support (kernels and device/host functions, structs, classes, host→kernel call edges through `<<<grid, block>>>` launch syntax — templated launches, function-pointer launches (`auto kernel = &fn<...>`), `dim3{...}` configs, and macro-defined kernels included; `__global__`/`__device__`/`__launch_bounds__` specifiers handled; CUDA in plain `.h`/`.hpp` headers recognized by content) |
793
+ | Swift | `.swift` | Full support |
794
+ | Kotlin | `.kt`, `.kts` | Full support |
795
+ | Scala | `.scala`, `.sc` | Full support (classes, traits, methods, type aliases, Scala 3 enums) |
796
+ | Dart | `.dart` | Full support |
797
+ | Svelte | `.svelte` | Full support (script extraction, Svelte 5 runes, SvelteKit routes) |
798
+ | Vue | `.vue` | Full support (script + script-setup extraction, Nuxt page/API/middleware routes) |
799
+ | Astro | `.astro` | Full support (frontmatter + script extraction, template component/call references, `src/pages/` routes) |
800
+ | Liquid | `.liquid` | Full support |
801
+ | Pascal / Delphi | `.pas`, `.dpr`, `.dpk`, `.lpr` | Full support (classes, records, interfaces, enums, DFM/FMX form files) |
802
+ | Lua | `.lua` | Full support (functions, methods with receivers, local variables, `require` imports, call edges) |
803
+ | R | `.R` `.r` | Full support (functions in every assignment form, S4/R5/R6 classes with methods, `library`/`require` imports, `source()` file references, call edges) |
804
+ | Luau | `.luau` | Full support (everything in Lua, plus `type`/`export type` aliases, typed signatures, and Roblox instance-path `require`) |
805
+ | CFML | `.cfc`, `.cfm`, `.cfs` | Full support (tag-based `<cfcomponent>`/`<cffunction>` and bare-script `component { ... }` styles, `extends`/`implements`, embedded `<cfscript>` delegation, call edges) |
806
+ | COBOL | `.cbl`, `.cob`, `.cpy` | Full support (programs, sections/paragraphs with PERFORM/GO TO call edges, CALL 'literal' cross-program calls, COPY copybook imports — including standalone `.cpy` files — DATA DIVISION records/fields/88-levels, EXEC CICS LINK/XCTL and EXEC SQL INCLUDE targets; fixed and free format) |
807
+ | Visual Basic .NET | `.vb` | Full support (classes, Modules, interfaces, structures, enums, properties, events, `Declare` P/Invoke, `Handles`/`WithEvents`, `Inherits`/`Implements` edges, call edges through VB's call/index paren ambiguity, `As New` instantiation, interpolated strings, LINQ, Unicode identifiers) |
808
+ | Erlang | `.erl`, `.hrl`, `.escript`, `.app.src`, `.app` | Full support (functions with multi-clause/multi-arity grouping, `-spec` signatures, records with fields, `-type`/`-opaque` aliases, `-define` macros, `-include`/`-include_lib`/`-import` edges, local and `mod:fn` remote call edges, `fun name/arity` references, `spawn`/`apply`/`proc_lib`/`timer`/`rpc` MFA-argument call edges, `gen_server:call/cast(?MODULE)` → own `handle_call`/`handle_cast` links, `-behaviour` links, `-export`-based visibility) |
809
+ | Solidity | `.sol` | Full support (contracts, libraries, interfaces, structs, enums, modifiers, events, errors, state variables, `import`/`using` directives, `emit`/`revert` calls) |
810
+ | Terraform / OpenTofu | `.tf`, `.tfvars`, `.tofu` | Full support (resources, data sources, modules, variables, outputs, providers incl. aliases, `locals`; `var.`/`local.`/`module.`/resource references with Terraform's per-directory scoping enforced; module calls bridged across the boundary — inputs to the child module's variables, `module.M.out` to the child's output, `source` to the module's files; cloudposse/atmos `remote-state` cross-component wiring when the component is statically named; `provider = aws.east` selections resolved up the module tree; `moved`/`import`/`removed`/`check` block references; `.tfvars` assignments linked to the variables they set) |
811
+ | Nix | `.nix` | Full support (functions with simple/destructured/curried params, `let`/attrset bindings, `inherit`, `import ./path` file edges — `./dir` resolving through `default.nix` — plus NixOS module `imports = [ ./x.nix ]` lists and `callPackage ./pkg.nix` file edges; call edges; module-system option wiring — a config write like `launchd.user.agents.x = { ... }` links to the module declaring `options.launchd.user.agents`, so option flows trace across modules) |
812
+
813
+ ## Measured cross-file coverage
814
+
815
+ Impact and blast-radius queries are only as good as the dependency graph behind them, so coverage is measured rather than asserted. **Fair coverage** = the share of symbol-bearing source files that have at least one *resolved cross-file dependent* — something that imports, calls, references, or (through a framework convention) routes to them — on a real-world benchmark repo per language. The residual is always a genuine static-analysis frontier (runtime dynamic dispatch, reflection / DI containers, framework-convention entry points, vendored third-party code), never hidden by gaming the denominator.
816
+
817
+ | Language | Benchmark repo | Coverage |
818
+ |---|---|---|
819
+ | TypeScript / JavaScript | this repo | 95.8% |
820
+ | Python | psf/requests | 100% |
821
+ | Go | gin-gonic/gin | 96.6% |
822
+ | Rust | BurntSushi/ripgrep | 86.7% |
823
+ | Java | google/gson | 93.3% |
824
+ | C# | jbogard/MediatR | 85.2% |
825
+ | PHP | guzzle/guzzle | 100% |
826
+ | Ruby | sidekiq/sidekiq | 100% |
827
+ | C | redis/redis | 92.2% |
828
+ | C++ | google/leveldb | 94.8% |
829
+ | Objective-C | SDWebImage | 91.6% |
830
+ | Swift | Alamofire | 95.3% |
831
+ | Kotlin | square/okhttp | 96.2% |
832
+ | Scala | gatling/gatling | 91.2% |
833
+ | Dart | flutter/packages | 92.4% |
834
+ | Svelte / SvelteKit | sveltejs/realworld | 100% |
835
+ | Vue / Nuxt | nuxt/movies | 93.5% |
836
+ | Astro | xingwangzhe/stalux | 93.0% |
837
+ | Lua | nvim-telescope/telescope.nvim | 84.2% |
838
+ | Luau | dphfox/Fusion | 92.2% |
839
+ | Liquid | Shopify/dawn | 73.8% |
840
+ | Pascal / Delphi | PascalCoin | 77.4% |
841
+
842
+ Framework routing is validated the same way, on a canonical app per framework: Express 100%, FastAPI 98%, Flask 100%, NestJS 96.8%, Gin 96.5%, Axum 100%, Rocket 93.8%, Vapor 100%, Laravel 92%, Rails 89.6%, React Router 100% — and the convention/reflection-heavy ones at their honest static-analysis ceiling: ASP.NET 83.9%, Spring 83.3%, Drupal 78.9%, Play 76.3%, Django 74.1%. SvelteKit, Vue/Nuxt, and Astro use file-based routing, so their page/endpoint coverage is the Svelte/SvelteKit (100%), Vue/Nuxt (93.5%), and Astro (93.0% — every `src/pages/` file maps to a route node on the two validation repos) figures in the table above.
843
+
844
+ ## Troubleshooting
845
+
846
+ **"CodeGraph not initialized"** — Run `codegraph init` in your project directory first.
847
+
848
+ **Indexing is slow** — Check that `node_modules` and other large directories are excluded. Use `--quiet` to reduce output overhead.
849
+
850
+ **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:
851
+
852
+ - **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`.
853
+ - **`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.
854
+
855
+ **MCP server not connecting** — Your agent starts the server itself, so you don't launch it by hand. Make sure the project is initialized and indexed (`codegraph status`) and that the path in your MCP config is correct. If it still won't connect, re-run `codegraph install` to rewrite the config.
856
+
857
+ **MCP tool calls fail with `Transport closed` while `codegraph status`/`sync` are healthy** — almost always WSL2 with the project on a Windows drive (a `/mnt/c` or `/mnt/d` path), where the local socket CodeGraph uses to share one background server across sessions is unreliable. CodeGraph now falls back to serving the session in-process instead of dropping the connection, but if you still hit it, set `CODEGRAPH_NO_DAEMON=1` in your MCP server's environment to skip the shared server entirely (each session runs in its own process). Moving the project onto the Linux-native filesystem (e.g. under `~/` instead of `/mnt/`) restores the shared server.
858
+
859
+ **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`).
860
+
861
+ **Sharing one checkout between Windows and WSL** — Don't point both at the same `.codegraph/`: the background-server lock and the SQLite index are tied to the OS that wrote them, and SQLite locking across the WSL2/Windows filesystem boundary is unreliable. Give each side its own index in the same tree by setting `CODEGRAPH_DIR` to a distinct name on one of them — e.g. `CODEGRAPH_DIR=.codegraph-win` on Windows, leaving WSL on the default `.codegraph`. CodeGraph skips any sibling `.codegraph-*` directory when indexing and watching, so the two never trip over each other.
862
+
863
+ ## Star History
864
+
865
+ <a href="https://www.star-history.com/?repos=colbymchenry%2Fcodegraph&type=date&legend=top-left">
866
+ <picture>
867
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=colbymchenry/codegraph&type=date&theme=dark&legend=top-left" />
868
+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=colbymchenry/codegraph&type=date&legend=top-left" />
869
+ <img alt="Star History Chart" src="https://api.star-history.com/chart?repos=colbymchenry/codegraph&type=date&legend=top-left" />
870
+ </picture>
871
+ </a>
872
+
873
+ ## License
874
+
875
+ MIT
876
+
877
+ ---
878
+
879
+ <div align="center">
880
+
881
+ **Made for AI coding agents — Claude Code, Cursor, Codex CLI, opencode, Hermes Agent, Gemini CLI, Antigravity IDE, and Kiro**
882
+
883
+ [Report Bug](https://github.com/colbymchenry/codegraph/issues) · [Request Feature](https://github.com/colbymchenry/codegraph/issues)
884
+
885
+ </div>