purecontext-mcp 1.1.8 → 1.5.0

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 (328) hide show
  1. package/AGENT_INSTRUCTIONS.md +113 -394
  2. package/AGENT_INSTRUCTIONS_SHORT.md +53 -0
  3. package/AGENT_REFERENCE.md +561 -0
  4. package/AST-SEARCH.md +274 -0
  5. package/CHANGELOG.md +233 -0
  6. package/CODE-INTELLIGENCE.md +369 -0
  7. package/FRAMEWORK-ADAPTERS.md +351 -0
  8. package/HEALTH-DASHBOARDS.md +241 -0
  9. package/LANGUAGE-SUPPORT.md +144 -0
  10. package/README.md +99 -12
  11. package/REFACTORING-SAFELY.md +279 -0
  12. package/UNDERSTANDING-RELATIONSHIPS.md +240 -0
  13. package/USER-GUIDE.md +22 -0
  14. package/VISUALIZING-CODE.md +199 -0
  15. package/WORKFLOW-TECH-DEBT.md +286 -0
  16. package/dist/cli/hooks.d.ts +28 -0
  17. package/dist/cli/hooks.d.ts.map +1 -0
  18. package/dist/cli/hooks.js +570 -0
  19. package/dist/cli/hooks.js.map +1 -0
  20. package/dist/cli/install-detect.d.ts +16 -0
  21. package/dist/cli/install-detect.d.ts.map +1 -0
  22. package/dist/cli/install-detect.js +70 -0
  23. package/dist/cli/install-detect.js.map +1 -0
  24. package/dist/cli/install-writers.d.ts +59 -0
  25. package/dist/cli/install-writers.d.ts.map +1 -0
  26. package/dist/cli/install-writers.js +292 -0
  27. package/dist/cli/install-writers.js.map +1 -0
  28. package/dist/cli/install.d.ts +14 -0
  29. package/dist/cli/install.d.ts.map +1 -0
  30. package/dist/cli/install.js +150 -0
  31. package/dist/cli/install.js.map +1 -0
  32. package/dist/config/config-loader.js +3 -0
  33. package/dist/config/config-loader.js.map +1 -1
  34. package/dist/config/config-schema.d.ts +11 -0
  35. package/dist/config/config-schema.d.ts.map +1 -1
  36. package/dist/config/config-schema.js +15 -0
  37. package/dist/config/config-schema.js.map +1 -1
  38. package/dist/core/db/dep-store.d.ts +75 -0
  39. package/dist/core/db/dep-store.d.ts.map +1 -1
  40. package/dist/core/db/dep-store.js +277 -0
  41. package/dist/core/db/dep-store.js.map +1 -1
  42. package/dist/core/db/schema.d.ts.map +1 -1
  43. package/dist/core/db/schema.js +12 -0
  44. package/dist/core/db/schema.js.map +1 -1
  45. package/dist/core/db/symbol-store.d.ts +1 -0
  46. package/dist/core/db/symbol-store.d.ts.map +1 -1
  47. package/dist/core/db/symbol-store.js +120 -6
  48. package/dist/core/db/symbol-store.js.map +1 -1
  49. package/dist/core/file-discovery.d.ts +6 -0
  50. package/dist/core/file-discovery.d.ts.map +1 -1
  51. package/dist/core/file-discovery.js +20 -13
  52. package/dist/core/file-discovery.js.map +1 -1
  53. package/dist/core/file-processor.d.ts.map +1 -1
  54. package/dist/core/file-processor.js +26 -1
  55. package/dist/core/file-processor.js.map +1 -1
  56. package/dist/core/git-log-reader.d.ts.map +1 -1
  57. package/dist/core/git-log-reader.js +21 -0
  58. package/dist/core/git-log-reader.js.map +1 -1
  59. package/dist/core/index-manager.d.ts.map +1 -1
  60. package/dist/core/index-manager.js +22 -8
  61. package/dist/core/index-manager.js.map +1 -1
  62. package/dist/core/indexing-worker.d.ts.map +1 -1
  63. package/dist/core/indexing-worker.js +14 -0
  64. package/dist/core/indexing-worker.js.map +1 -1
  65. package/dist/core/parse-dispatcher.d.ts.map +1 -1
  66. package/dist/core/parse-dispatcher.js +20 -5
  67. package/dist/core/parse-dispatcher.js.map +1 -1
  68. package/dist/core/search/query-preprocessor.d.ts +69 -3
  69. package/dist/core/search/query-preprocessor.d.ts.map +1 -1
  70. package/dist/core/search/query-preprocessor.js +450 -17
  71. package/dist/core/search/query-preprocessor.js.map +1 -1
  72. package/dist/core/search/relevance-ranker.d.ts +60 -5
  73. package/dist/core/search/relevance-ranker.d.ts.map +1 -1
  74. package/dist/core/search/relevance-ranker.js +931 -33
  75. package/dist/core/search/relevance-ranker.js.map +1 -1
  76. package/dist/core/test-mapper.d.ts.map +1 -1
  77. package/dist/core/test-mapper.js +7 -1
  78. package/dist/core/test-mapper.js.map +1 -1
  79. package/dist/core/types.d.ts +33 -1
  80. package/dist/core/types.d.ts.map +1 -1
  81. package/dist/graph/diagram-renderer.d.ts +83 -0
  82. package/dist/graph/diagram-renderer.d.ts.map +1 -0
  83. package/dist/graph/diagram-renderer.js +294 -0
  84. package/dist/graph/diagram-renderer.js.map +1 -0
  85. package/dist/graph/graph-traversal.d.ts +92 -0
  86. package/dist/graph/graph-traversal.d.ts.map +1 -1
  87. package/dist/graph/graph-traversal.js +440 -2
  88. package/dist/graph/graph-traversal.js.map +1 -1
  89. package/dist/handlers/angular-html.d.ts +3 -0
  90. package/dist/handlers/angular-html.d.ts.map +1 -0
  91. package/dist/handlers/angular-html.js +215 -0
  92. package/dist/handlers/angular-html.js.map +1 -0
  93. package/dist/handlers/c.d.ts.map +1 -1
  94. package/dist/handlers/c.js +19 -0
  95. package/dist/handlers/c.js.map +1 -1
  96. package/dist/handlers/cpp-macro-registry.d.ts +21 -0
  97. package/dist/handlers/cpp-macro-registry.d.ts.map +1 -0
  98. package/dist/handlers/cpp-macro-registry.js +44 -0
  99. package/dist/handlers/cpp-macro-registry.js.map +1 -0
  100. package/dist/handlers/cpp.d.ts.map +1 -1
  101. package/dist/handlers/cpp.js +579 -10
  102. package/dist/handlers/cpp.js.map +1 -1
  103. package/dist/handlers/csharp.d.ts.map +1 -1
  104. package/dist/handlers/csharp.js +39 -2
  105. package/dist/handlers/csharp.js.map +1 -1
  106. package/dist/handlers/css.d.ts +3 -0
  107. package/dist/handlers/css.d.ts.map +1 -0
  108. package/dist/handlers/css.js +154 -0
  109. package/dist/handlers/css.js.map +1 -0
  110. package/dist/handlers/erlang.d.ts.map +1 -1
  111. package/dist/handlers/erlang.js +8 -1
  112. package/dist/handlers/erlang.js.map +1 -1
  113. package/dist/handlers/fortran.js +1 -1
  114. package/dist/handlers/fortran.js.map +1 -1
  115. package/dist/handlers/go.d.ts.map +1 -1
  116. package/dist/handlers/go.js +87 -2
  117. package/dist/handlers/go.js.map +1 -1
  118. package/dist/handlers/handler-registry.d.ts.map +1 -1
  119. package/dist/handlers/handler-registry.js +4 -0
  120. package/dist/handlers/handler-registry.js.map +1 -1
  121. package/dist/handlers/hcl.d.ts +3 -0
  122. package/dist/handlers/hcl.d.ts.map +1 -0
  123. package/dist/handlers/hcl.js +193 -0
  124. package/dist/handlers/hcl.js.map +1 -0
  125. package/dist/handlers/java.d.ts.map +1 -1
  126. package/dist/handlers/java.js +33 -16
  127. package/dist/handlers/java.js.map +1 -1
  128. package/dist/handlers/kotlin.d.ts.map +1 -1
  129. package/dist/handlers/kotlin.js +48 -3
  130. package/dist/handlers/kotlin.js.map +1 -1
  131. package/dist/handlers/less.d.ts +3 -0
  132. package/dist/handlers/less.d.ts.map +1 -0
  133. package/dist/handlers/less.js +255 -0
  134. package/dist/handlers/less.js.map +1 -0
  135. package/dist/handlers/objective-c.d.ts.map +1 -1
  136. package/dist/handlers/objective-c.js +122 -64
  137. package/dist/handlers/objective-c.js.map +1 -1
  138. package/dist/handlers/openapi.d.ts.map +1 -1
  139. package/dist/handlers/openapi.js +30 -5
  140. package/dist/handlers/openapi.js.map +1 -1
  141. package/dist/handlers/php.d.ts.map +1 -1
  142. package/dist/handlers/php.js +287 -41
  143. package/dist/handlers/php.js.map +1 -1
  144. package/dist/handlers/protobuf.d.ts.map +1 -1
  145. package/dist/handlers/protobuf.js +1 -0
  146. package/dist/handlers/protobuf.js.map +1 -1
  147. package/dist/handlers/python.d.ts.map +1 -1
  148. package/dist/handlers/python.js +1 -3
  149. package/dist/handlers/python.js.map +1 -1
  150. package/dist/handlers/ruby-dsl.d.ts +23 -0
  151. package/dist/handlers/ruby-dsl.d.ts.map +1 -0
  152. package/dist/handlers/ruby-dsl.js +251 -0
  153. package/dist/handlers/ruby-dsl.js.map +1 -0
  154. package/dist/handlers/ruby.d.ts.map +1 -1
  155. package/dist/handlers/ruby.js +29 -4
  156. package/dist/handlers/ruby.js.map +1 -1
  157. package/dist/handlers/rust.d.ts.map +1 -1
  158. package/dist/handlers/rust.js +98 -2
  159. package/dist/handlers/rust.js.map +1 -1
  160. package/dist/handlers/scss.d.ts +3 -0
  161. package/dist/handlers/scss.d.ts.map +1 -0
  162. package/dist/handlers/scss.js +290 -0
  163. package/dist/handlers/scss.js.map +1 -0
  164. package/dist/handlers/sql.d.ts.map +1 -1
  165. package/dist/handlers/sql.js +37 -18
  166. package/dist/handlers/sql.js.map +1 -1
  167. package/dist/handlers/typescript.d.ts.map +1 -1
  168. package/dist/handlers/typescript.js +65 -17
  169. package/dist/handlers/typescript.js.map +1 -1
  170. package/dist/handlers/xml.d.ts.map +1 -1
  171. package/dist/handlers/xml.js +35 -2
  172. package/dist/handlers/xml.js.map +1 -1
  173. package/dist/index.d.ts.map +1 -1
  174. package/dist/index.js +91 -0
  175. package/dist/index.js.map +1 -1
  176. package/dist/server/mcp-server.d.ts.map +1 -1
  177. package/dist/server/mcp-server.js +155 -0
  178. package/dist/server/mcp-server.js.map +1 -1
  179. package/dist/server/tools/check-delete-safe.d.ts +50 -0
  180. package/dist/server/tools/check-delete-safe.d.ts.map +1 -0
  181. package/dist/server/tools/check-delete-safe.js +308 -0
  182. package/dist/server/tools/check-delete-safe.js.map +1 -0
  183. package/dist/server/tools/check-move-safe.d.ts +44 -0
  184. package/dist/server/tools/check-move-safe.d.ts.map +1 -0
  185. package/dist/server/tools/check-move-safe.js +266 -0
  186. package/dist/server/tools/check-move-safe.js.map +1 -0
  187. package/dist/server/tools/check-rename-safe.d.ts +48 -0
  188. package/dist/server/tools/check-rename-safe.d.ts.map +1 -0
  189. package/dist/server/tools/check-rename-safe.js +218 -0
  190. package/dist/server/tools/check-rename-safe.js.map +1 -0
  191. package/dist/server/tools/detect-antipatterns.d.ts +1 -1
  192. package/dist/server/tools/diff-health-radar.d.ts +44 -0
  193. package/dist/server/tools/diff-health-radar.d.ts.map +1 -0
  194. package/dist/server/tools/diff-health-radar.js +192 -0
  195. package/dist/server/tools/diff-health-radar.js.map +1 -0
  196. package/dist/server/tools/find-cycles.d.ts +31 -0
  197. package/dist/server/tools/find-cycles.d.ts.map +1 -0
  198. package/dist/server/tools/find-cycles.js +85 -0
  199. package/dist/server/tools/find-cycles.js.map +1 -0
  200. package/dist/server/tools/find-implementations.d.ts +47 -0
  201. package/dist/server/tools/find-implementations.d.ts.map +1 -0
  202. package/dist/server/tools/find-implementations.js +167 -0
  203. package/dist/server/tools/find-implementations.js.map +1 -0
  204. package/dist/server/tools/find-untested-symbols.d.ts +52 -0
  205. package/dist/server/tools/find-untested-symbols.d.ts.map +1 -0
  206. package/dist/server/tools/find-untested-symbols.js +308 -0
  207. package/dist/server/tools/find-untested-symbols.js.map +1 -0
  208. package/dist/server/tools/get-architecture-snapshot.d.ts +43 -0
  209. package/dist/server/tools/get-architecture-snapshot.d.ts.map +1 -0
  210. package/dist/server/tools/get-architecture-snapshot.js +292 -0
  211. package/dist/server/tools/get-architecture-snapshot.js.map +1 -0
  212. package/dist/server/tools/get-call-hierarchy.d.ts +43 -0
  213. package/dist/server/tools/get-call-hierarchy.d.ts.map +1 -0
  214. package/dist/server/tools/get-call-hierarchy.js +119 -0
  215. package/dist/server/tools/get-call-hierarchy.js.map +1 -0
  216. package/dist/server/tools/get-class-hierarchy.d.ts +36 -0
  217. package/dist/server/tools/get-class-hierarchy.d.ts.map +1 -0
  218. package/dist/server/tools/get-class-hierarchy.js +125 -0
  219. package/dist/server/tools/get-class-hierarchy.js.map +1 -0
  220. package/dist/server/tools/get-complexity-hotspots.d.ts +50 -0
  221. package/dist/server/tools/get-complexity-hotspots.d.ts.map +1 -0
  222. package/dist/server/tools/get-complexity-hotspots.js +282 -0
  223. package/dist/server/tools/get-complexity-hotspots.js.map +1 -0
  224. package/dist/server/tools/get-coupling-map.d.ts +39 -0
  225. package/dist/server/tools/get-coupling-map.d.ts.map +1 -0
  226. package/dist/server/tools/get-coupling-map.js +107 -0
  227. package/dist/server/tools/get-coupling-map.js.map +1 -0
  228. package/dist/server/tools/get-debt-report.d.ts +44 -0
  229. package/dist/server/tools/get-debt-report.d.ts.map +1 -0
  230. package/dist/server/tools/get-debt-report.js +606 -0
  231. package/dist/server/tools/get-debt-report.js.map +1 -0
  232. package/dist/server/tools/get-entry-points.d.ts +79 -0
  233. package/dist/server/tools/get-entry-points.d.ts.map +1 -0
  234. package/dist/server/tools/get-entry-points.js +362 -0
  235. package/dist/server/tools/get-entry-points.js.map +1 -0
  236. package/dist/server/tools/get-lexical-scope-matches.d.ts +54 -0
  237. package/dist/server/tools/get-lexical-scope-matches.d.ts.map +1 -0
  238. package/dist/server/tools/get-lexical-scope-matches.js +470 -0
  239. package/dist/server/tools/get-lexical-scope-matches.js.map +1 -0
  240. package/dist/server/tools/get-public-api.d.ts +53 -0
  241. package/dist/server/tools/get-public-api.d.ts.map +1 -0
  242. package/dist/server/tools/get-public-api.js +218 -0
  243. package/dist/server/tools/get-public-api.js.map +1 -0
  244. package/dist/server/tools/get-test-coverage-map.d.ts +66 -0
  245. package/dist/server/tools/get-test-coverage-map.d.ts.map +1 -0
  246. package/dist/server/tools/get-test-coverage-map.js +588 -0
  247. package/dist/server/tools/get-test-coverage-map.js.map +1 -0
  248. package/dist/server/tools/get-todos.d.ts +51 -0
  249. package/dist/server/tools/get-todos.d.ts.map +1 -0
  250. package/dist/server/tools/get-todos.js +180 -0
  251. package/dist/server/tools/get-todos.js.map +1 -0
  252. package/dist/server/tools/get-type-graph.d.ts +73 -0
  253. package/dist/server/tools/get-type-graph.d.ts.map +1 -0
  254. package/dist/server/tools/get-type-graph.js +437 -0
  255. package/dist/server/tools/get-type-graph.js.map +1 -0
  256. package/dist/server/tools/health-radar.d.ts +50 -0
  257. package/dist/server/tools/health-radar.d.ts.map +1 -0
  258. package/dist/server/tools/health-radar.js +426 -0
  259. package/dist/server/tools/health-radar.js.map +1 -0
  260. package/dist/server/tools/plan-refactoring.d.ts +74 -0
  261. package/dist/server/tools/plan-refactoring.d.ts.map +1 -0
  262. package/dist/server/tools/plan-refactoring.js +644 -0
  263. package/dist/server/tools/plan-refactoring.js.map +1 -0
  264. package/dist/server/tools/render-call-graph.d.ts +40 -0
  265. package/dist/server/tools/render-call-graph.d.ts.map +1 -0
  266. package/dist/server/tools/render-call-graph.js +215 -0
  267. package/dist/server/tools/render-call-graph.js.map +1 -0
  268. package/dist/server/tools/render-class-hierarchy.d.ts +42 -0
  269. package/dist/server/tools/render-class-hierarchy.d.ts.map +1 -0
  270. package/dist/server/tools/render-class-hierarchy.js +265 -0
  271. package/dist/server/tools/render-class-hierarchy.js.map +1 -0
  272. package/dist/server/tools/render-dep-matrix.d.ts +38 -0
  273. package/dist/server/tools/render-dep-matrix.d.ts.map +1 -0
  274. package/dist/server/tools/render-dep-matrix.js +186 -0
  275. package/dist/server/tools/render-dep-matrix.js.map +1 -0
  276. package/dist/server/tools/render-diagram.d.ts +47 -0
  277. package/dist/server/tools/render-diagram.d.ts.map +1 -0
  278. package/dist/server/tools/render-diagram.js +266 -0
  279. package/dist/server/tools/render-diagram.js.map +1 -0
  280. package/dist/server/tools/render-import-graph.d.ts +41 -0
  281. package/dist/server/tools/render-import-graph.d.ts.map +1 -0
  282. package/dist/server/tools/render-import-graph.js +158 -0
  283. package/dist/server/tools/render-import-graph.js.map +1 -0
  284. package/dist/server/tools/search-ast.d.ts +55 -0
  285. package/dist/server/tools/search-ast.d.ts.map +1 -0
  286. package/dist/server/tools/search-ast.js +279 -0
  287. package/dist/server/tools/search-ast.js.map +1 -0
  288. package/dist/server/tools/search-by-complexity.d.ts +92 -0
  289. package/dist/server/tools/search-by-complexity.d.ts.map +1 -0
  290. package/dist/server/tools/search-by-complexity.js +268 -0
  291. package/dist/server/tools/search-by-complexity.js.map +1 -0
  292. package/dist/server/tools/search-by-decorator.d.ts +48 -0
  293. package/dist/server/tools/search-by-decorator.d.ts.map +1 -0
  294. package/dist/server/tools/search-by-decorator.js +518 -0
  295. package/dist/server/tools/search-by-decorator.js.map +1 -0
  296. package/dist/server/tools/search-by-signature.d.ts +56 -0
  297. package/dist/server/tools/search-by-signature.d.ts.map +1 -0
  298. package/dist/server/tools/search-by-signature.js +200 -0
  299. package/dist/server/tools/search-by-signature.js.map +1 -0
  300. package/dist/server/tools/search-symbols.d.ts +10 -0
  301. package/dist/server/tools/search-symbols.d.ts.map +1 -1
  302. package/dist/server/tools/search-symbols.js +353 -8
  303. package/dist/server/tools/search-symbols.js.map +1 -1
  304. package/dist/server/tools/trace-invocation-chain.d.ts +53 -0
  305. package/dist/server/tools/trace-invocation-chain.d.ts.map +1 -0
  306. package/dist/server/tools/trace-invocation-chain.js +280 -0
  307. package/dist/server/tools/trace-invocation-chain.js.map +1 -0
  308. package/dist/ui/assets/BlastRadius-QdgESOL8.js +1 -0
  309. package/dist/ui/assets/{DependencyGraph-B60SMPbX.js → DependencyGraph-BSMhzwWV.js} +1 -1
  310. package/dist/ui/assets/{NotFound-Bsg8Wppk.js → NotFound-CipFP_s1.js} +1 -1
  311. package/dist/ui/assets/{RepoDetail-Cie0D4_s.js → RepoDetail-Dfp5z5Kq.js} +1 -1
  312. package/dist/ui/assets/{RepoList-CldNt89M.js → RepoList-BKtST3hB.js} +1 -1
  313. package/dist/ui/assets/{Search-CgvpHMOi.js → Search-DzhGDViy.js} +1 -1
  314. package/dist/ui/assets/{SymbolView-B9h0LZTz.js → SymbolView-ryVEwAHG.js} +1 -1
  315. package/dist/ui/assets/{index-DADf5y_L.css → index-Ny8gn9F0.css} +1 -1
  316. package/dist/ui/assets/{index-eK0wMkUR.js → index-nX2chMqi.js} +2 -2
  317. package/dist/ui/assets/{useSearch-KAl3Qyi2.js → useSearch-BnBCRKui.js} +1 -1
  318. package/dist/ui/index.html +2 -2
  319. package/dist/version.d.ts +1 -1
  320. package/dist/version.js +1 -1
  321. package/docs/02-installation.md +89 -17
  322. package/docs/05-cli-reference.md +89 -0
  323. package/docs/dev/benchmark-findings-eu-za-tebe.md +210 -0
  324. package/docs/dev/jcodemunch-gap-analysis.md +198 -0
  325. package/docs/dev/phase-35-coverage-audit.md +469 -0
  326. package/package.json +12 -1
  327. package/user-manual.md +2466 -0
  328. package/dist/ui/assets/BlastRadius-RP7vJEyQ.js +0 -1
@@ -1,12 +1,22 @@
1
- # PureContext MCP — AI Agent Instructions
1
+ # PureContext MCP — Agent Instructions
2
2
 
3
- These instructions tell AI agents how to use PureContext MCP correctly for token-efficient code navigation. Add this file to your agent's rules (CLAUDE.md, Windsurf rules, Cursor rules, etc.).
3
+ Add these instructions to your agent's rules file to get token-efficient code navigation with PureContext MCP.
4
+
5
+ | Agent | Rules file |
6
+ |-------|-----------|
7
+ | Claude Code (global) | `~/.claude/CLAUDE.md` |
8
+ | Claude Code (project) | `CLAUDE.md` in the project root |
9
+ | Cursor | `.cursor/rules` |
10
+ | Windsurf | `.windsurf/rules` |
11
+ | VS Code Copilot | `.github/copilot-instructions.md` |
12
+
13
+ For complete tool parameter docs, all navigation patterns, and known limitations: see **`AGENT_REFERENCE.md`** in this repository.
4
14
 
5
15
  ---
6
16
 
7
17
  ## What PureContext MCP is
8
18
 
9
- PureContext MCP is a structured code navigation server. It indexes a codebase using tree-sitter AST parsing, stores symbol metadata in SQLite, and exposes MCP tools so you can retrieve precisely the code you need — without reading entire files.
19
+ PureContext MCP is a structured code navigation server. It indexes codebases using tree-sitter AST parsing, stores symbol metadata in SQLite, and exposes MCP tools so you retrieve precisely the code you need — without reading entire files.
10
20
 
11
21
  **Token savings:** Retrieving a 45-line function by name costs ~150 tokens. Reading the 800-line file it lives in costs ~2,000 tokens. PureContext saves 88–98% of context tokens on typical navigation tasks.
12
22
 
@@ -16,309 +26,55 @@ PureContext MCP is a structured code navigation server. It indexes a codebase us
16
26
 
17
27
  ### Step 1 — Check if the project is indexed
18
28
 
19
- Before doing any code navigation, call `list_repos` to see what is already indexed.
20
-
21
29
  ```
22
30
  list_repos()
23
31
  ```
24
32
 
25
- If the current project is not in the list, index it first:
33
+ If the project is missing, index it first:
26
34
 
27
35
  ```
28
36
  index_folder({ path: "/absolute/path/to/project" })
29
37
  ```
30
38
 
31
- **Never skip this step.** All other tools require a `repoId`. `index_folder` returns the `repoId` you will use in every subsequent call. Save it.
39
+ `index_folder` returns the `repoId` you will use in every subsequent call. **Never skip this step** all other tools require a `repoId`. Re-indexing is incremental; only changed files are re-parsed.
32
40
 
33
41
  ### Step 2 — Navigate by symbol, not by file
34
42
 
35
- Do **not** read entire files to find code. Use the tools:
43
+ Do not read entire files to find code. Use the tools:
36
44
 
37
- | Goal | Tool to use |
38
- |------|-------------|
45
+ | Goal | Tool |
46
+ |------|------|
39
47
  | Find a function/class/method by name | `search_symbols` |
40
48
  | Find code by what it does | `search_semantic` |
41
49
  | Find a literal string, comment, or config value | `search_text` |
42
50
  | See all symbols in one file | `get_file_outline` |
43
51
  | See the whole project structure | `get_repo_outline` |
52
+ | Browse directory layout | `get_file_tree` |
53
+ | Understand a function's dependencies | `get_context_bundle` |
54
+ | Know what breaks if I change a symbol | `get_blast_radius` |
55
+ | Find all call sites for a symbol | `find_references` |
56
+ | Non-symbol file content (imports block, config) | `get_file_content` with `startLine`/`endLine` |
57
+ | All implementations of an interface | `find_implementations` |
58
+ | Callers/callees execution tree | `get_call_hierarchy` |
59
+ | Class inheritance structure | `get_class_hierarchy` |
60
+ | Rename / delete / move safety check | `check_rename_safe` / `check_delete_safe` / `check_move_safe` |
61
+ | Codebase health score | `health_radar` |
62
+ | Detailed debt report | `get_debt_report` |
63
+ | All TODOs and FIXMEs | `get_todos` |
64
+ | Untested exported symbols | `find_untested_symbols` |
65
+ | Most complex functions | `get_complexity_hotspots` |
66
+ | Symbols by decorator | `search_by_decorator` |
67
+ | AST node type occurrences (try/catch, arrow functions, etc.) | `search_ast` |
44
68
 
45
69
  ### Step 3 — Read summaries before fetching source
46
70
 
47
- `search_symbols` returns signatures and summaries — **no source code**. This is intentional. Read the `summary` field first to decide whether a symbol is relevant. Fetch the implementation only for symbols you will actually work with:
71
+ `search_symbols` returns signatures and summaries — no source code. Read the `summary` field first to decide whether a symbol is relevant. Fetch source only for symbols you will actually work with:
48
72
 
49
73
  ```
50
74
  get_symbol_source({ repoId, symbolId })
51
75
  ```
52
76
 
53
- Do not call `get_symbol_source` for every result in a search. Summaries let you navigate without reading source, saving 10–50× tokens on typical lookups.
54
-
55
- **Trust but verify:** summaries describe intent, not contract. For modification tasks, always read the source after using the summary to navigate. An AI-generated summary describes what a function is meant to do — source code is ground truth.
56
-
57
- ---
58
-
59
- ## Tool reference — when to use each tool
60
-
61
- ### Indexing tools
62
-
63
- #### `list_repos`
64
- Always call this first. Returns all indexed repos with their `repoId`, path, file count, and last indexed time.
65
-
66
- #### `index_folder`
67
- Index a local directory. Returns `repoId`. Re-indexing is incremental — only changed files are re-parsed. Call it again if files have changed since the last index.
68
-
69
- **Parameters:**
70
- - `path` (required) — absolute path to project root
71
- - `force` (optional) — set `true` to force re-index of all files, even unchanged ones
72
- - `fileLimit` (optional) — override the configured file limit for this run
73
-
74
- #### `resolve_repo`
75
- Convert a local path to its `repoId` without indexing. Use this when you know the project is already indexed but don't have the `repoId` at hand.
76
-
77
- #### `invalidate_cache`
78
- Force a full re-index by clearing content hashes. Use when the index seems stale and `index_folder` is not picking up changes.
79
-
80
- ---
81
-
82
- ### Symbol search & retrieval
83
-
84
- #### `search_symbols` — primary navigation tool
85
- Search by name fragment. Use this for almost all navigation tasks.
86
-
87
- ```json
88
- {
89
- "repoId": "a1b2c3d4e5f60001",
90
- "query": "authenticate",
91
- "kind": "function",
92
- "limit": 10
93
- }
94
- ```
95
-
96
- - Returns signatures and summaries — **no source code**
97
- - Use the `kind` filter to narrow results: `function`, `class`, `method`, `route`, `component`, `hook`, `middleware`, etc.
98
- - `camelCase`, `snake_case`, and space-separated queries are equivalent: `processOrder`, `process_order`, and `process order` return the same results
99
- - Use `mode: "hybrid"` for best recall when unsure of the exact name
100
-
101
- #### `search_semantic`
102
- Search by meaning, not name. Use when you know what the code does but not what it is called.
103
-
104
- ```json
105
- {
106
- "repoId": "...",
107
- "query": "function that validates user credentials and returns a session token",
108
- "mode": "hybrid",
109
- "max_results": 10
110
- }
111
- ```
112
-
113
- Requires semantic search to be enabled in config. Falls back to FTS5 keyword search automatically if the HNSW index is not available.
114
-
115
- #### `search_text`
116
- Grep-style full-text search across file content. Use for finding literal strings, error messages, config values, comments, or anything that is not a symbol name.
117
-
118
- ```json
119
- {
120
- "repoId": "...",
121
- "query": "TODO: fix this",
122
- "context_lines": 3
123
- }
124
- ```
125
-
126
- Do **not** use `search_text` when you are looking for a function or class — use `search_symbols` instead. `search_text` searches raw file content, not the symbol index.
127
-
128
- #### `get_symbol_source`
129
- Retrieve the source code of a specific symbol by its ID.
130
-
131
- ```json
132
- {
133
- "repoId": "...",
134
- "symbolId": "8f3a2c1d0e4b5f9a",
135
- "context_lines": 2
136
- }
137
- ```
138
-
139
- - `symbolId` comes from `search_symbols` or `get_file_outline` results
140
- - Use `context_lines` to include surrounding lines for additional context
141
- - Use `verify: true` when you need to confirm the source on disk matches the index (after recent file edits)
142
-
143
- #### `get_symbols`
144
- Batch-fetch multiple symbols by ID in a single call. Prefer this over calling `get_symbol_source` repeatedly when you need several symbols.
145
-
146
- ```json
147
- {
148
- "repoId": "...",
149
- "symbolIds": ["id1", "id2", "id3"]
150
- }
151
- ```
152
-
153
- #### `get_file_content`
154
- Retrieve raw file content with optional line range. Use only when you need to read a section of a file that is not a named symbol — for example, top-level imports, configuration blocks, or non-symbol prose.
155
-
156
- ```json
157
- {
158
- "repoId": "...",
159
- "filePath": "src/config/settings.ts",
160
- "startLine": 1,
161
- "endLine": 40
162
- }
163
- ```
164
-
165
- Do **not** use `get_file_content` as a substitute for `get_symbol_source`. Always prefer symbol-level retrieval.
166
-
167
- #### `get_file_outline`
168
- All symbols in a single file with signatures and summaries. Use to survey a file without reading its content.
169
-
170
- #### `get_repo_outline`
171
- All files in the repo with their top-level symbols. Use to orient yourself in an unfamiliar project.
172
-
173
- #### `get_file_tree`
174
- Directory tree with file counts. Use when you need to understand the project's folder structure.
175
-
176
- #### `find_references`
177
- Find all usage sites (call sites, references) for a symbol across the repo. Use before renaming or modifying a symbol to understand all places that use it.
178
-
179
- ---
180
-
181
- ### Dependency graph tools
182
-
183
- #### `get_context_bundle`
184
- Forward-walk from a symbol — returns the symbol and everything it transitively imports. Use **before modifying a function** to understand its full context.
185
-
186
- ```json
187
- {
188
- "repoId": "...",
189
- "symbolId": "...",
190
- "maxDepth": 2,
191
- "maxTokens": 4000
192
- }
193
- ```
194
-
195
- Use `maxTokens` to cap the response size when working with deeply connected code.
196
-
197
- #### `get_blast_radius`
198
- Reverse-walk — all files that transitively import a symbol. Use **before modifying or deleting a symbol** to understand what would break.
199
-
200
- ```json
201
- {
202
- "repoId": "...",
203
- "symbolId": "...",
204
- "maxDepth": 5
205
- }
206
- ```
207
-
208
- #### `find_importers`
209
- Direct (one-hop) importers of a file. Faster than `get_blast_radius` when you only need the immediate callers.
210
-
211
- #### `find_dead_code`
212
- Exported symbols that nothing else imports. Use for cleanup audits. Note: may produce false positives for dynamic imports and symbols consumed by external npm consumers.
213
-
214
- ---
215
-
216
- ### Architecture & quality tools
217
-
218
- #### `get_layer_violations`
219
- Detect architectural import boundary violations. Use when enforcing layered architecture rules.
220
-
221
- #### `get_quality_metrics`
222
- Per-file complexity, coupling, cohesion, and documentation coverage scores. Always use this instead of making subjective assessments from reading source code. Treat complexity scores as directional signals — cyclomatic complexity is estimated from symbol count and nesting depth, not exact AST branch-counting.
223
-
224
- #### `detect_antipatterns`
225
- Detect common architectural anti-patterns (god classes, circular dependencies, dead code) across the repo. Returns structured results with severity levels and actionable locations. Only detects static patterns — cannot find runtime coupling or dynamic dispatch issues.
226
-
227
- #### `get_architecture_doc`
228
- Auto-generate an architecture summary in Markdown or Mermaid format. Requires `ai.allowRemoteAI: true`. Use early when onboarding to an unfamiliar codebase. The generated doc is always accurate because it derives from the actual index, not hand-written documentation.
229
-
230
- **Pre-refactoring workflow:**
231
- ```
232
- get_quality_metrics → find worst files
233
- detect_antipatterns → find structural issues
234
- get_blast_radius → understand impact scope
235
- get_architecture_doc → generate "before" snapshot
236
- [make changes]
237
- detect_antipatterns → verify anti-patterns resolved
238
- ```
239
-
240
- ---
241
-
242
- ### Git & history tools
243
-
244
- #### `get_symbol_history`
245
- Symbol-level git commit history. Returns structured JSON with commits, authors, and diffs — no shell commands needed. Use to understand why a function was written the way it is, and to answer "who wrote this?" or "who should review this change?" without running `git log` or `git blame`.
246
-
247
- **Limitations:** Rename/move breaks history continuity — symbols in renamed files start fresh history from the rename commit. After a rebase, run `invalidate_cache` + `index_folder` to rebuild accurate history.
248
-
249
- #### `get_churn_metrics`
250
- File and symbol churn metrics. Use to identify high-risk files before making changes. **Before modifying any symbol, check churn:** if `churnScore > 6`, mention this to the user and suggest extra testing. High-churn files are under active development (merge conflict risk) or chronically buggy (regression risk).
251
-
252
- **For debugging:** Use `get_churn_metrics` to identify recently-changed symbols — recent changes are the most likely source of new bugs. This narrows the search space dramatically.
253
-
254
- **Note:** The default `maxCommits: 500` cap means long-lived projects may lose early history. Increase `git.maxCommits` for history-sensitive workflows.
255
-
256
- ---
257
-
258
- ### Cross-repo tools
259
-
260
- #### `search_cross_repo`
261
- Search symbols across multiple indexed repositories simultaneously. Use for architectural questions like "which services handle email sending?" or "where is `UserProfile` defined?" — a single call replaces N per-repo queries.
262
-
263
- #### `find_similar`
264
- Find semantically similar code across repos using the HNSW vector index. **Before implementing new functionality**, call this to check if equivalent code already exists elsewhere in the organization. Requires semantic search enabled (`semantic.enabled: true` with a configured provider).
265
-
266
- **Before modifying shared library code**, use `get_blast_radius` with `crossRepo: true` to understand the full downstream impact across all repos.
267
-
268
- **Note:** `crossRepoDeps` requires explicit package name configuration — there is no auto-detection of Nx/Turborepo/Lerna workspaces. Monorepo packages must each be indexed separately with `index_folder`.
269
-
270
- ---
271
-
272
- ### Ecosystem & data tools
273
-
274
- #### `search_columns`
275
- Search column definitions across dbt models. Returns upstream/downstream lineage — not just where a column is defined, but the full chain from source tables through staging models to final fact tables. Use for data lineage questions like "where does the `revenue` column come from?"
276
-
277
- **Note:** `search_columns` is dbt-only — it does not search columns in raw SQL `CREATE TABLE` statements. For those, use `get_symbol_source` on the `CREATE TABLE` symbol directly.
278
-
279
- **dbt workflow notes:**
280
- - Always run `index_folder` after `dbt compile` to ensure `manifest.json` is current — stale manifests produce incorrect column lineage.
281
- - Use `get_context_bundle` to traverse dbt model dependencies just like code dependencies.
282
- - Use `search_symbols` with `kind: "route"` to find API endpoints via the OpenAPI provider.
283
-
284
- **Templating coverage:** Jinja preprocessing is implemented only for dbt's SQL dialect. Helm/Go templates, Ansible Jinja2, Kubernetes YAML, ERB, and Kustomize are not preprocessed — those files are indexed as raw text or skipped. Terraform is fully supported.
285
-
286
- ---
287
-
288
- ## Decision rules — which tool to pick
289
-
290
- ```
291
- I need to find a symbol by name
292
- → search_symbols
293
-
294
- I know what the code does but not its name
295
- → search_semantic (or search_symbols with mode: "hybrid")
296
-
297
- I need to find a literal string, comment, or config value
298
- → search_text
299
-
300
- I need the source code of a specific symbol
301
- → get_symbol_source (use symbolId from search_symbols)
302
-
303
- I need source for several symbols at once
304
- → get_symbols (batch)
305
-
306
- I need to understand a function's dependencies
307
- → get_context_bundle
308
-
309
- I need to know what breaks if I change a symbol
310
- → get_blast_radius (before modifying)
311
- → find_references (for call sites specifically)
312
-
313
- I need to survey a file's contents
314
- → get_file_outline
315
-
316
- I need to understand the project layout
317
- → get_repo_outline or get_file_tree
318
-
319
- I need a non-symbol section of a file (imports block, config)
320
- → get_file_content with startLine/endLine
321
- ```
77
+ Summaries describe intent, not contract. For modification tasks, always read the source after using the summary to navigate source code is ground truth.
322
78
 
323
79
  ---
324
80
 
@@ -328,182 +84,145 @@ I need a non-symbol section of a file (imports block, config)
328
84
  Use `search_symbols` + `get_symbol_source`. Reading an 800-line file to locate a 45-line function wastes ~1,850 tokens.
329
85
 
330
86
  **Do not call `get_symbol_source` for every search result.**
331
- Read the `signature` and `summary` from `search_symbols` first. Fetch source only for symbols you will actually work with.
87
+ Read `signature` and `summary` from `search_symbols` first. Fetch source only for symbols you will actually work with.
332
88
 
333
89
  **Do not skip `list_repos` at the start of a session.**
334
90
  You need a `repoId` for every tool call. Get it from `list_repos` or `index_folder` — do not guess.
335
91
 
336
92
  **Do not use `search_text` for symbol lookups.**
337
- `search_text` is a grep over raw file content. It is slower and less precise than `search_symbols` for finding named code entities.
93
+ `search_text` greps raw file content. It is slower and less precise than `search_symbols` for finding named code entities. Use `search_text` for literal strings, comments, config values, and local variables that are not indexed symbols.
338
94
 
339
95
  **Do not use `get_file_content` as a fallback for reading whole files.**
340
96
  If a symbol exists in the index, use `get_symbol_source`. Only use `get_file_content` for content that is not a named symbol.
341
97
 
342
98
  **Do not ignore `_tokenEstimate` fields.**
343
- Every response includes a `_tokenEstimate`. Use it to decide whether to fetch more context or stop.
99
+ Every response includes a `_tokenEstimate`. Use it to decide whether to fetch more context or stop. Cap `maxTokens` in `get_context_bundle` to avoid hitting context limits.
100
+
101
+ **Do not re-search when `search_symbols` returns `negative_evidence`.**
102
+ If the response includes `verdict: "no_match"`, the symbol does not exist in this codebase. Report the gap to the user rather than trying variant queries.
344
103
 
345
104
  ---
346
105
 
347
- ## Efficient navigation patterns
106
+ ## Key navigation patterns
348
107
 
349
- ### Pattern: understand an unfamiliar codebase
108
+ ### Modify a function safely
350
109
 
351
110
  ```
352
- 1. list_repos() → check if indexed
353
- 2. index_folder({ path }) index if needed, get repoId
354
- 3. get_repo_outline({ repoId }) survey the structure
355
- 4. search_symbols({ query: "main entry point concept" }) locate key symbols
356
- 5. get_context_bundle({ symbolId }) → understand the entry + dependencies
111
+ 1. search_symbols({ query: "functionName", kind: "function" })
112
+ 2. get_blast_radius({ symbolId }) know the impact scope BEFORE touching it
113
+ 3. get_context_bundle({ symbolId, maxDepth: 2 }) understand its dependencies
114
+ 4. get_symbol_source({ symbolId }) read the implementation
115
+ 5. [make the change]
116
+ 6. find_dead_code({ repoId }) → verify no orphaned exports left behind
357
117
  ```
358
118
 
359
- ### Pattern: modify a function safely
119
+ ### Modify a high-risk symbol safely
360
120
 
361
121
  ```
362
122
  1. search_symbols({ query: "functionName", kind: "function" })
363
- 2. get_blast_radius({ symbolId }) know the impact scope BEFORE touching it
364
- 3. get_context_bundle({ symbolId, maxDepth: 2 }) → understand its context
365
- 4. get_symbol_source({ symbolId }) read the implementation
366
- 5. [make the change]
367
- 6. find_dead_code({ repoId }) → verify no orphaned exports left behind
123
+ 2. get_churn_metrics({ repoId, symbolId }) if churnScore > 6, warn the user
124
+ 3. get_symbol_history({ symbolId }) → understand recent change context
125
+ 4. get_blast_radius({ symbolId }) know full impact scope
126
+ 5. get_context_bundle({ symbolId, maxDepth: 2 })
127
+ 6. get_symbol_source({ symbolId })
128
+ 7. [make the change]
129
+ 8. find_dead_code({ repoId })
368
130
  ```
369
131
 
370
- ### Pattern: find where something is called
132
+ ### Find where something is called
371
133
 
372
134
  ```
373
135
  1. search_symbols({ query: "symbolName" })
374
- 2. find_references({ symbolId }) → all call sites
136
+ 2. find_references({ symbolId }) → all call sites across the repo
375
137
  3. get_symbol_source for relevant call sites
376
138
  ```
377
139
 
378
- ### Pattern: search when you know the concept but not the name
140
+ ### Search when you know what the code does but not its name
379
141
 
380
142
  ```
381
- 1. search_semantic({ query: "natural language description", mode: "hybrid" })
143
+ 1. search_semantic({ query: "validates user credentials and returns a session token", mode: "hybrid" })
382
144
  2. Review signatures and summaries in results
383
145
  3. get_symbol_source for the best match
384
146
  ```
385
147
 
386
- ### Pattern: large batch of symbols
148
+ ### Refactor safely (rename / delete / move)
387
149
 
388
150
  ```
389
- 1. search_symbols({ query: "...", limit: 20 })
390
- 2. Filter results by signature/summary to pick the ones you need
391
- 3. get_symbols({ symbolIds: ["id1", "id2", "id3"] }) ← one call, not three
392
- ```
393
-
394
- ### Pattern: modify a high-risk symbol safely
395
-
396
- ```
397
- 1. search_symbols({ query: "functionName", kind: "function" })
398
- 2. get_churn_metrics({ repoId, symbolId }) → if churnScore > 6, warn user
399
- 3. get_symbol_history({ symbolId }) → understand recent change context
400
- 4. get_blast_radius({ symbolId }) → know full impact scope
401
- 5. get_context_bundle({ symbolId, maxDepth: 2 }) → understand dependencies
402
- 6. get_symbol_source({ symbolId }) → read the implementation
403
- 7. [make the change]
404
- 8. find_dead_code({ repoId }) → verify no orphaned exports
405
- ```
406
-
407
- ### Pattern: architecture review / onboarding
408
-
409
- ```
410
- 1. list_repos → index_folder if needed
411
- 2. get_architecture_doc({ repoId }) → generate project overview
412
- 3. get_quality_metrics({ repoId }) → identify weakest files
413
- 4. detect_antipatterns({ repoId }) → find structural issues
414
- 5. get_repo_outline({ repoId }) → survey specific areas
415
- ```
416
-
417
- ### Pattern: before implementing new functionality
418
-
419
- ```
420
- 1. find_similar({ query: "description", crossRepo: true }) → check for existing code
421
- 2. search_cross_repo({ query: "conceptName" }) → find related symbols across repos
422
- 3. get_blast_radius({ symbolId, crossRepo: true }) → understand cross-repo impact
151
+ 1. search_symbols({ query: "symbolName" })
152
+ 2. check_rename_safe / check_delete_safe / check_move_safe → binary verdict + affected sites
153
+ 3. If safe: proceed.
154
+ If not safe: resolve blockers listed in affectedSites first, then re-check.
155
+ 4. find_dead_code({ repoId }) → verify no orphaned exports remain
423
156
  ```
424
157
 
425
- ### Pattern: debug a recent regression
158
+ ### Onboard to an unfamiliar codebase
426
159
 
427
160
  ```
428
- 1. get_churn_metrics({ repoId }) find recently-changed files
429
- 2. get_symbol_history({ symbolId }) check commits in the affected area
430
- 3. search_symbols in changed files find the suspect functions
431
- 4. get_symbol_source get_context_bundle read and understand the change
161
+ 1. list_repos() → index_folder({ path }) if needed
162
+ 2. get_repo_outline({ repoId }) survey the structure
163
+ 3. get_entry_points({ repoId }) where does the app start?
164
+ 4. get_context_bundle({ symbolId: entryPointId }) trace dependencies from root
165
+ 5. get_todos({ repoId }) → known rough edges
166
+ 6. get_test_coverage_map({ repoId }) → where tests are thin
432
167
  ```
433
168
 
434
- ### Pattern: PR review
169
+ ### Tech debt sprint
435
170
 
436
171
  ```
437
- 1. [obtain list of changed files from PR]
438
- 2. get_symbol_history for changed symbols understand prior context
439
- 3. get_churn_metrics for changed files flag hotspots
440
- 4. get_blast_radius for each modified symbol identify affected downstream code
441
- 5. detect_antipatterns({ repoId }) flag new structural issues
172
+ 1. health_radar({ repoId }) → 5-axis health baseline
173
+ 2. get_debt_report({ repoId }) per-file rankings + recommendations
174
+ 3. get_complexity_hotspots({ repoId }) worst functions to tackle first
175
+ 4. find_untested_symbols({ repoId }) coverage gaps
176
+ 5. find_cycles({ repoId }) circular deps to break
177
+ 6. get_architecture_snapshot({ repoId }) → baseline snapshot before changes
178
+ 7. [fix highest-priority items]
179
+ 8. get_architecture_snapshot({ repoId }) → after snapshot
180
+ 9. diff_health_radar({ before, after }) → prove the improvement
442
181
  ```
443
182
 
444
183
  ---
445
184
 
446
185
  ## Search tips
447
186
 
448
- - **camelCase and snake_case are equivalent** — `processOrder` and `process_order` return the same results.
449
- - **Short queries rank better** — `auth` finds more than `authentication middleware function`.
450
- - **Use `kind` to narrow results** — `kind: "function"` eliminates class/method noise.
451
- - **Use `filePath` to scope** — `filePath: "src/auth/"` restricts to a directory.
452
- - **Use `debug: true` to diagnose ranking** — shows BM25 scores and name boost factors.
453
- - **For hybrid mode** — `semantic_weight: 0.6, keyword_weight: 0.4` is a good default when you are unsure of the exact name.
187
+ - **camelCase and snake_case are equivalent** — `processOrder` and `process_order` return the same results
188
+ - **Short queries rank better** — `auth` finds more than `authentication middleware function`
189
+ - **Use `kind` to narrow results** — `kind: "function"` eliminates class/method noise
190
+ - **Use `filePath` to scope** — `filePath: "src/auth/"` restricts results to a directory
191
+ - **Use `mode: "hybrid"` when unsure of the exact name** — blends keyword and semantic search
192
+ - **Use `debug: true` to diagnose ranking** shows BM25 scores and name boost factors
454
193
 
455
194
  ---
456
195
 
457
- ## Notes on `_tokenEstimate` and `_meta`
196
+ ## Keeping the index fresh
458
197
 
459
- Every response includes:
198
+ The file watcher triggers incremental re-indexing automatically. If the index seems stale:
460
199
 
461
- ```json
462
- "_meta": {
463
- "timing_ms": 3,
464
- "tokens_saved": 1842,
465
- "total_tokens_saved": 45231
466
- }
200
+ ```
201
+ index_folder({ path, force: false }) → incremental (changed files only)
202
+ index_folder({ path, force: true }) → full re-index
203
+ invalidate_cache({ repoId }) → clear hashes, then index_folder
467
204
  ```
468
205
 
469
- And most responses include `_tokenEstimate` a rough count of tokens in the returned payload. Use this to:
470
- - Decide whether to fetch additional context or stop
471
- - Avoid hitting context limits by capping `maxTokens` in `get_context_bundle`
472
- - Track cumulative savings with `get_savings_stats`
473
-
474
- ---
475
-
476
- ## Keeping the index fresh
206
+ ### Claude Code hooks (optional but recommended)
477
207
 
478
- The file watcher triggers incremental re-indexing automatically on file changes. If you suspect the index is stale:
208
+ Install the PureContext hooks to keep the index in sync automatically and preserve session orientation across context compaction:
479
209
 
480
210
  ```
481
- index_folder({ path, force: false }) → incremental (changed files only)
482
- index_folder({ path, force: true }) → full re-index (all files)
483
- invalidate_cache({ repoId }) → clear hashes, then index_folder
211
+ npx purecontext-mcp hooks --install
484
212
  ```
485
213
 
214
+ This installs three hooks into `~/.claude/settings.json`:
215
+
216
+ | Hook | When it fires | What it does |
217
+ |------|--------------|-------------|
218
+ | **Index hook** | After `Edit` / `Write` | Re-indexes the modified file immediately |
219
+ | **Session snapshot** | Before context compaction | Injects indexed repo list into the next turn so orientation is preserved |
220
+ | **Edit guard** | Before `Edit` / `Write` | Soft warning suggesting `get_blast_radius` and `get_symbol_source` first |
221
+
222
+ All hooks are Node.js scripts — they work identically on Windows, Linux, and macOS.
223
+
486
224
  ---
487
225
 
488
- ## Known limitations
489
-
490
- These are documented gaps understand them so you can work around them rather than being confused when a tool behaves unexpectedly.
491
-
492
- | Area | Limitation | Workaround |
493
- |------|-----------|-----------|
494
- | **AI Summaries** | Summaries describe intent, not contract. Stale summaries exist until re-index. | Always verify with `get_symbol_source` before modifying. |
495
- | **AI Summaries** | `get_architecture_doc` requires `ai.allowRemoteAI: true`. | `detect_antipatterns` and `get_quality_metrics` work without AI. |
496
- | **Git History** | Rename/move breaks history continuity — prior history is lost after a rename. | Future: `git log --follow` tracking. |
497
- | **Git History** | Rebase invalidates commit hashes — re-index required after significant rebase. | Run `invalidate_cache` + `index_folder` post-rebase. |
498
- | **Git History** | Default `maxCommits: 500` drops early history on long-lived projects. | Increase `git.maxCommits` in config for history-sensitive workflows. |
499
- | **Git History** | No SVN/Mercurial/Perforce support. | Git is a hard requirement for history features. |
500
- | **Cross-Repo** | `crossRepoDeps` is manual — no auto-detection of Nx/Turborepo/pnpm workspaces. | Explicitly list package names in each repo's config. |
501
- | **Cross-Repo** | `find_similar` requires semantic search enabled and an embedding provider. | Use a local Ollama model as a zero-cost alternative. |
502
- | **Cross-Repo** | MCP Resources `resources/subscribe` is not yet supported by Claude Code or Cursor. | Polling with `search_cross_repo` is the current alternative. |
503
- | **Architecture** | Quality metrics use estimated complexity (nesting heuristics), not true AST branch-counting. | Treat scores as directional signals, not precise measurements. |
504
- | **Architecture** | `detect_antipatterns` cannot detect runtime coupling or dynamic dispatch. | Complementary to profiling and runtime observability — not a replacement. |
505
- | **Architecture** | `get_layer_violations` needs layer boundaries defined in config before it delivers value. | Requires upfront config investment. |
506
- | **Ecosystem** | Jinja preprocessing is dbt SQL only — Helm, Ansible, ERB, Kustomize not supported. | Use Terraform for IaC where possible; raw file reads otherwise. |
507
- | **Ecosystem** | `search_columns` is dbt-only — does not cover `CREATE TABLE` SQL columns. | Use `get_symbol_source` on the `CREATE TABLE` symbol instead. |
508
- | **Ecosystem** | dbt indexer does not detect stale `manifest.json`. | Always run `dbt compile` before `index_folder` on dbt projects. |
509
- | **Ecosystem** | BigQuery STRUCT/ARRAY, Snowflake QUALIFY, and DuckDB LIST/MAP may not parse fully. | Model-level symbols are still extracted even when the body fails to parse. |
226
+ ## Full reference
227
+
228
+ For complete tool parameter documentation, all navigation patterns, and the known limitations table, see **`AGENT_REFERENCE.md`** in this repository.