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.
- package/AGENT_INSTRUCTIONS.md +113 -394
- package/AGENT_INSTRUCTIONS_SHORT.md +53 -0
- package/AGENT_REFERENCE.md +561 -0
- package/AST-SEARCH.md +274 -0
- package/CHANGELOG.md +233 -0
- package/CODE-INTELLIGENCE.md +369 -0
- package/FRAMEWORK-ADAPTERS.md +351 -0
- package/HEALTH-DASHBOARDS.md +241 -0
- package/LANGUAGE-SUPPORT.md +144 -0
- package/README.md +99 -12
- package/REFACTORING-SAFELY.md +279 -0
- package/UNDERSTANDING-RELATIONSHIPS.md +240 -0
- package/USER-GUIDE.md +22 -0
- package/VISUALIZING-CODE.md +199 -0
- package/WORKFLOW-TECH-DEBT.md +286 -0
- package/dist/cli/hooks.d.ts +28 -0
- package/dist/cli/hooks.d.ts.map +1 -0
- package/dist/cli/hooks.js +570 -0
- package/dist/cli/hooks.js.map +1 -0
- package/dist/cli/install-detect.d.ts +16 -0
- package/dist/cli/install-detect.d.ts.map +1 -0
- package/dist/cli/install-detect.js +70 -0
- package/dist/cli/install-detect.js.map +1 -0
- package/dist/cli/install-writers.d.ts +59 -0
- package/dist/cli/install-writers.d.ts.map +1 -0
- package/dist/cli/install-writers.js +292 -0
- package/dist/cli/install-writers.js.map +1 -0
- package/dist/cli/install.d.ts +14 -0
- package/dist/cli/install.d.ts.map +1 -0
- package/dist/cli/install.js +150 -0
- package/dist/cli/install.js.map +1 -0
- package/dist/config/config-loader.js +3 -0
- package/dist/config/config-loader.js.map +1 -1
- package/dist/config/config-schema.d.ts +11 -0
- package/dist/config/config-schema.d.ts.map +1 -1
- package/dist/config/config-schema.js +15 -0
- package/dist/config/config-schema.js.map +1 -1
- package/dist/core/db/dep-store.d.ts +75 -0
- package/dist/core/db/dep-store.d.ts.map +1 -1
- package/dist/core/db/dep-store.js +277 -0
- package/dist/core/db/dep-store.js.map +1 -1
- package/dist/core/db/schema.d.ts.map +1 -1
- package/dist/core/db/schema.js +12 -0
- package/dist/core/db/schema.js.map +1 -1
- package/dist/core/db/symbol-store.d.ts +1 -0
- package/dist/core/db/symbol-store.d.ts.map +1 -1
- package/dist/core/db/symbol-store.js +120 -6
- package/dist/core/db/symbol-store.js.map +1 -1
- package/dist/core/file-discovery.d.ts +6 -0
- package/dist/core/file-discovery.d.ts.map +1 -1
- package/dist/core/file-discovery.js +20 -13
- package/dist/core/file-discovery.js.map +1 -1
- package/dist/core/file-processor.d.ts.map +1 -1
- package/dist/core/file-processor.js +26 -1
- package/dist/core/file-processor.js.map +1 -1
- package/dist/core/git-log-reader.d.ts.map +1 -1
- package/dist/core/git-log-reader.js +21 -0
- package/dist/core/git-log-reader.js.map +1 -1
- package/dist/core/index-manager.d.ts.map +1 -1
- package/dist/core/index-manager.js +22 -8
- package/dist/core/index-manager.js.map +1 -1
- package/dist/core/indexing-worker.d.ts.map +1 -1
- package/dist/core/indexing-worker.js +14 -0
- package/dist/core/indexing-worker.js.map +1 -1
- package/dist/core/parse-dispatcher.d.ts.map +1 -1
- package/dist/core/parse-dispatcher.js +20 -5
- package/dist/core/parse-dispatcher.js.map +1 -1
- package/dist/core/search/query-preprocessor.d.ts +69 -3
- package/dist/core/search/query-preprocessor.d.ts.map +1 -1
- package/dist/core/search/query-preprocessor.js +450 -17
- package/dist/core/search/query-preprocessor.js.map +1 -1
- package/dist/core/search/relevance-ranker.d.ts +60 -5
- package/dist/core/search/relevance-ranker.d.ts.map +1 -1
- package/dist/core/search/relevance-ranker.js +931 -33
- package/dist/core/search/relevance-ranker.js.map +1 -1
- package/dist/core/test-mapper.d.ts.map +1 -1
- package/dist/core/test-mapper.js +7 -1
- package/dist/core/test-mapper.js.map +1 -1
- package/dist/core/types.d.ts +33 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/graph/diagram-renderer.d.ts +83 -0
- package/dist/graph/diagram-renderer.d.ts.map +1 -0
- package/dist/graph/diagram-renderer.js +294 -0
- package/dist/graph/diagram-renderer.js.map +1 -0
- package/dist/graph/graph-traversal.d.ts +92 -0
- package/dist/graph/graph-traversal.d.ts.map +1 -1
- package/dist/graph/graph-traversal.js +440 -2
- package/dist/graph/graph-traversal.js.map +1 -1
- package/dist/handlers/angular-html.d.ts +3 -0
- package/dist/handlers/angular-html.d.ts.map +1 -0
- package/dist/handlers/angular-html.js +215 -0
- package/dist/handlers/angular-html.js.map +1 -0
- package/dist/handlers/c.d.ts.map +1 -1
- package/dist/handlers/c.js +19 -0
- package/dist/handlers/c.js.map +1 -1
- package/dist/handlers/cpp-macro-registry.d.ts +21 -0
- package/dist/handlers/cpp-macro-registry.d.ts.map +1 -0
- package/dist/handlers/cpp-macro-registry.js +44 -0
- package/dist/handlers/cpp-macro-registry.js.map +1 -0
- package/dist/handlers/cpp.d.ts.map +1 -1
- package/dist/handlers/cpp.js +579 -10
- package/dist/handlers/cpp.js.map +1 -1
- package/dist/handlers/csharp.d.ts.map +1 -1
- package/dist/handlers/csharp.js +39 -2
- package/dist/handlers/csharp.js.map +1 -1
- package/dist/handlers/css.d.ts +3 -0
- package/dist/handlers/css.d.ts.map +1 -0
- package/dist/handlers/css.js +154 -0
- package/dist/handlers/css.js.map +1 -0
- package/dist/handlers/erlang.d.ts.map +1 -1
- package/dist/handlers/erlang.js +8 -1
- package/dist/handlers/erlang.js.map +1 -1
- package/dist/handlers/fortran.js +1 -1
- package/dist/handlers/fortran.js.map +1 -1
- package/dist/handlers/go.d.ts.map +1 -1
- package/dist/handlers/go.js +87 -2
- package/dist/handlers/go.js.map +1 -1
- package/dist/handlers/handler-registry.d.ts.map +1 -1
- package/dist/handlers/handler-registry.js +4 -0
- package/dist/handlers/handler-registry.js.map +1 -1
- package/dist/handlers/hcl.d.ts +3 -0
- package/dist/handlers/hcl.d.ts.map +1 -0
- package/dist/handlers/hcl.js +193 -0
- package/dist/handlers/hcl.js.map +1 -0
- package/dist/handlers/java.d.ts.map +1 -1
- package/dist/handlers/java.js +33 -16
- package/dist/handlers/java.js.map +1 -1
- package/dist/handlers/kotlin.d.ts.map +1 -1
- package/dist/handlers/kotlin.js +48 -3
- package/dist/handlers/kotlin.js.map +1 -1
- package/dist/handlers/less.d.ts +3 -0
- package/dist/handlers/less.d.ts.map +1 -0
- package/dist/handlers/less.js +255 -0
- package/dist/handlers/less.js.map +1 -0
- package/dist/handlers/objective-c.d.ts.map +1 -1
- package/dist/handlers/objective-c.js +122 -64
- package/dist/handlers/objective-c.js.map +1 -1
- package/dist/handlers/openapi.d.ts.map +1 -1
- package/dist/handlers/openapi.js +30 -5
- package/dist/handlers/openapi.js.map +1 -1
- package/dist/handlers/php.d.ts.map +1 -1
- package/dist/handlers/php.js +287 -41
- package/dist/handlers/php.js.map +1 -1
- package/dist/handlers/protobuf.d.ts.map +1 -1
- package/dist/handlers/protobuf.js +1 -0
- package/dist/handlers/protobuf.js.map +1 -1
- package/dist/handlers/python.d.ts.map +1 -1
- package/dist/handlers/python.js +1 -3
- package/dist/handlers/python.js.map +1 -1
- package/dist/handlers/ruby-dsl.d.ts +23 -0
- package/dist/handlers/ruby-dsl.d.ts.map +1 -0
- package/dist/handlers/ruby-dsl.js +251 -0
- package/dist/handlers/ruby-dsl.js.map +1 -0
- package/dist/handlers/ruby.d.ts.map +1 -1
- package/dist/handlers/ruby.js +29 -4
- package/dist/handlers/ruby.js.map +1 -1
- package/dist/handlers/rust.d.ts.map +1 -1
- package/dist/handlers/rust.js +98 -2
- package/dist/handlers/rust.js.map +1 -1
- package/dist/handlers/scss.d.ts +3 -0
- package/dist/handlers/scss.d.ts.map +1 -0
- package/dist/handlers/scss.js +290 -0
- package/dist/handlers/scss.js.map +1 -0
- package/dist/handlers/sql.d.ts.map +1 -1
- package/dist/handlers/sql.js +37 -18
- package/dist/handlers/sql.js.map +1 -1
- package/dist/handlers/typescript.d.ts.map +1 -1
- package/dist/handlers/typescript.js +65 -17
- package/dist/handlers/typescript.js.map +1 -1
- package/dist/handlers/xml.d.ts.map +1 -1
- package/dist/handlers/xml.js +35 -2
- package/dist/handlers/xml.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +91 -0
- package/dist/index.js.map +1 -1
- package/dist/server/mcp-server.d.ts.map +1 -1
- package/dist/server/mcp-server.js +155 -0
- package/dist/server/mcp-server.js.map +1 -1
- package/dist/server/tools/check-delete-safe.d.ts +50 -0
- package/dist/server/tools/check-delete-safe.d.ts.map +1 -0
- package/dist/server/tools/check-delete-safe.js +308 -0
- package/dist/server/tools/check-delete-safe.js.map +1 -0
- package/dist/server/tools/check-move-safe.d.ts +44 -0
- package/dist/server/tools/check-move-safe.d.ts.map +1 -0
- package/dist/server/tools/check-move-safe.js +266 -0
- package/dist/server/tools/check-move-safe.js.map +1 -0
- package/dist/server/tools/check-rename-safe.d.ts +48 -0
- package/dist/server/tools/check-rename-safe.d.ts.map +1 -0
- package/dist/server/tools/check-rename-safe.js +218 -0
- package/dist/server/tools/check-rename-safe.js.map +1 -0
- package/dist/server/tools/detect-antipatterns.d.ts +1 -1
- package/dist/server/tools/diff-health-radar.d.ts +44 -0
- package/dist/server/tools/diff-health-radar.d.ts.map +1 -0
- package/dist/server/tools/diff-health-radar.js +192 -0
- package/dist/server/tools/diff-health-radar.js.map +1 -0
- package/dist/server/tools/find-cycles.d.ts +31 -0
- package/dist/server/tools/find-cycles.d.ts.map +1 -0
- package/dist/server/tools/find-cycles.js +85 -0
- package/dist/server/tools/find-cycles.js.map +1 -0
- package/dist/server/tools/find-implementations.d.ts +47 -0
- package/dist/server/tools/find-implementations.d.ts.map +1 -0
- package/dist/server/tools/find-implementations.js +167 -0
- package/dist/server/tools/find-implementations.js.map +1 -0
- package/dist/server/tools/find-untested-symbols.d.ts +52 -0
- package/dist/server/tools/find-untested-symbols.d.ts.map +1 -0
- package/dist/server/tools/find-untested-symbols.js +308 -0
- package/dist/server/tools/find-untested-symbols.js.map +1 -0
- package/dist/server/tools/get-architecture-snapshot.d.ts +43 -0
- package/dist/server/tools/get-architecture-snapshot.d.ts.map +1 -0
- package/dist/server/tools/get-architecture-snapshot.js +292 -0
- package/dist/server/tools/get-architecture-snapshot.js.map +1 -0
- package/dist/server/tools/get-call-hierarchy.d.ts +43 -0
- package/dist/server/tools/get-call-hierarchy.d.ts.map +1 -0
- package/dist/server/tools/get-call-hierarchy.js +119 -0
- package/dist/server/tools/get-call-hierarchy.js.map +1 -0
- package/dist/server/tools/get-class-hierarchy.d.ts +36 -0
- package/dist/server/tools/get-class-hierarchy.d.ts.map +1 -0
- package/dist/server/tools/get-class-hierarchy.js +125 -0
- package/dist/server/tools/get-class-hierarchy.js.map +1 -0
- package/dist/server/tools/get-complexity-hotspots.d.ts +50 -0
- package/dist/server/tools/get-complexity-hotspots.d.ts.map +1 -0
- package/dist/server/tools/get-complexity-hotspots.js +282 -0
- package/dist/server/tools/get-complexity-hotspots.js.map +1 -0
- package/dist/server/tools/get-coupling-map.d.ts +39 -0
- package/dist/server/tools/get-coupling-map.d.ts.map +1 -0
- package/dist/server/tools/get-coupling-map.js +107 -0
- package/dist/server/tools/get-coupling-map.js.map +1 -0
- package/dist/server/tools/get-debt-report.d.ts +44 -0
- package/dist/server/tools/get-debt-report.d.ts.map +1 -0
- package/dist/server/tools/get-debt-report.js +606 -0
- package/dist/server/tools/get-debt-report.js.map +1 -0
- package/dist/server/tools/get-entry-points.d.ts +79 -0
- package/dist/server/tools/get-entry-points.d.ts.map +1 -0
- package/dist/server/tools/get-entry-points.js +362 -0
- package/dist/server/tools/get-entry-points.js.map +1 -0
- package/dist/server/tools/get-lexical-scope-matches.d.ts +54 -0
- package/dist/server/tools/get-lexical-scope-matches.d.ts.map +1 -0
- package/dist/server/tools/get-lexical-scope-matches.js +470 -0
- package/dist/server/tools/get-lexical-scope-matches.js.map +1 -0
- package/dist/server/tools/get-public-api.d.ts +53 -0
- package/dist/server/tools/get-public-api.d.ts.map +1 -0
- package/dist/server/tools/get-public-api.js +218 -0
- package/dist/server/tools/get-public-api.js.map +1 -0
- package/dist/server/tools/get-test-coverage-map.d.ts +66 -0
- package/dist/server/tools/get-test-coverage-map.d.ts.map +1 -0
- package/dist/server/tools/get-test-coverage-map.js +588 -0
- package/dist/server/tools/get-test-coverage-map.js.map +1 -0
- package/dist/server/tools/get-todos.d.ts +51 -0
- package/dist/server/tools/get-todos.d.ts.map +1 -0
- package/dist/server/tools/get-todos.js +180 -0
- package/dist/server/tools/get-todos.js.map +1 -0
- package/dist/server/tools/get-type-graph.d.ts +73 -0
- package/dist/server/tools/get-type-graph.d.ts.map +1 -0
- package/dist/server/tools/get-type-graph.js +437 -0
- package/dist/server/tools/get-type-graph.js.map +1 -0
- package/dist/server/tools/health-radar.d.ts +50 -0
- package/dist/server/tools/health-radar.d.ts.map +1 -0
- package/dist/server/tools/health-radar.js +426 -0
- package/dist/server/tools/health-radar.js.map +1 -0
- package/dist/server/tools/plan-refactoring.d.ts +74 -0
- package/dist/server/tools/plan-refactoring.d.ts.map +1 -0
- package/dist/server/tools/plan-refactoring.js +644 -0
- package/dist/server/tools/plan-refactoring.js.map +1 -0
- package/dist/server/tools/render-call-graph.d.ts +40 -0
- package/dist/server/tools/render-call-graph.d.ts.map +1 -0
- package/dist/server/tools/render-call-graph.js +215 -0
- package/dist/server/tools/render-call-graph.js.map +1 -0
- package/dist/server/tools/render-class-hierarchy.d.ts +42 -0
- package/dist/server/tools/render-class-hierarchy.d.ts.map +1 -0
- package/dist/server/tools/render-class-hierarchy.js +265 -0
- package/dist/server/tools/render-class-hierarchy.js.map +1 -0
- package/dist/server/tools/render-dep-matrix.d.ts +38 -0
- package/dist/server/tools/render-dep-matrix.d.ts.map +1 -0
- package/dist/server/tools/render-dep-matrix.js +186 -0
- package/dist/server/tools/render-dep-matrix.js.map +1 -0
- package/dist/server/tools/render-diagram.d.ts +47 -0
- package/dist/server/tools/render-diagram.d.ts.map +1 -0
- package/dist/server/tools/render-diagram.js +266 -0
- package/dist/server/tools/render-diagram.js.map +1 -0
- package/dist/server/tools/render-import-graph.d.ts +41 -0
- package/dist/server/tools/render-import-graph.d.ts.map +1 -0
- package/dist/server/tools/render-import-graph.js +158 -0
- package/dist/server/tools/render-import-graph.js.map +1 -0
- package/dist/server/tools/search-ast.d.ts +55 -0
- package/dist/server/tools/search-ast.d.ts.map +1 -0
- package/dist/server/tools/search-ast.js +279 -0
- package/dist/server/tools/search-ast.js.map +1 -0
- package/dist/server/tools/search-by-complexity.d.ts +92 -0
- package/dist/server/tools/search-by-complexity.d.ts.map +1 -0
- package/dist/server/tools/search-by-complexity.js +268 -0
- package/dist/server/tools/search-by-complexity.js.map +1 -0
- package/dist/server/tools/search-by-decorator.d.ts +48 -0
- package/dist/server/tools/search-by-decorator.d.ts.map +1 -0
- package/dist/server/tools/search-by-decorator.js +518 -0
- package/dist/server/tools/search-by-decorator.js.map +1 -0
- package/dist/server/tools/search-by-signature.d.ts +56 -0
- package/dist/server/tools/search-by-signature.d.ts.map +1 -0
- package/dist/server/tools/search-by-signature.js +200 -0
- package/dist/server/tools/search-by-signature.js.map +1 -0
- package/dist/server/tools/search-symbols.d.ts +10 -0
- package/dist/server/tools/search-symbols.d.ts.map +1 -1
- package/dist/server/tools/search-symbols.js +353 -8
- package/dist/server/tools/search-symbols.js.map +1 -1
- package/dist/server/tools/trace-invocation-chain.d.ts +53 -0
- package/dist/server/tools/trace-invocation-chain.d.ts.map +1 -0
- package/dist/server/tools/trace-invocation-chain.js +280 -0
- package/dist/server/tools/trace-invocation-chain.js.map +1 -0
- package/dist/ui/assets/BlastRadius-QdgESOL8.js +1 -0
- package/dist/ui/assets/{DependencyGraph-B60SMPbX.js → DependencyGraph-BSMhzwWV.js} +1 -1
- package/dist/ui/assets/{NotFound-Bsg8Wppk.js → NotFound-CipFP_s1.js} +1 -1
- package/dist/ui/assets/{RepoDetail-Cie0D4_s.js → RepoDetail-Dfp5z5Kq.js} +1 -1
- package/dist/ui/assets/{RepoList-CldNt89M.js → RepoList-BKtST3hB.js} +1 -1
- package/dist/ui/assets/{Search-CgvpHMOi.js → Search-DzhGDViy.js} +1 -1
- package/dist/ui/assets/{SymbolView-B9h0LZTz.js → SymbolView-ryVEwAHG.js} +1 -1
- package/dist/ui/assets/{index-DADf5y_L.css → index-Ny8gn9F0.css} +1 -1
- package/dist/ui/assets/{index-eK0wMkUR.js → index-nX2chMqi.js} +2 -2
- package/dist/ui/assets/{useSearch-KAl3Qyi2.js → useSearch-BnBCRKui.js} +1 -1
- package/dist/ui/index.html +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/02-installation.md +89 -17
- package/docs/05-cli-reference.md +89 -0
- package/docs/dev/benchmark-findings-eu-za-tebe.md +210 -0
- package/docs/dev/jcodemunch-gap-analysis.md +198 -0
- package/docs/dev/phase-35-coverage-audit.md +469 -0
- package/package.json +12 -1
- package/user-manual.md +2466 -0
- package/dist/ui/assets/BlastRadius-RP7vJEyQ.js +0 -1
package/AGENT_INSTRUCTIONS.md
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
# PureContext MCP —
|
|
1
|
+
# PureContext MCP — Agent Instructions
|
|
2
2
|
|
|
3
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
43
|
+
Do not read entire files to find code. Use the tools:
|
|
36
44
|
|
|
37
|
-
| Goal | Tool
|
|
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 —
|
|
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
|
-
|
|
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
|
|
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`
|
|
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
|
-
##
|
|
106
|
+
## Key navigation patterns
|
|
348
107
|
|
|
349
|
-
###
|
|
108
|
+
### Modify a function safely
|
|
350
109
|
|
|
351
110
|
```
|
|
352
|
-
1.
|
|
353
|
-
2.
|
|
354
|
-
3.
|
|
355
|
-
4.
|
|
356
|
-
5.
|
|
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
|
-
###
|
|
119
|
+
### Modify a high-risk symbol safely
|
|
360
120
|
|
|
361
121
|
```
|
|
362
122
|
1. search_symbols({ query: "functionName", kind: "function" })
|
|
363
|
-
2.
|
|
364
|
-
3.
|
|
365
|
-
4.
|
|
366
|
-
5.
|
|
367
|
-
6.
|
|
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
|
-
###
|
|
132
|
+
### Find where something is called
|
|
371
133
|
|
|
372
134
|
```
|
|
373
135
|
1. search_symbols({ query: "symbolName" })
|
|
374
|
-
2. find_references({ symbolId })
|
|
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
|
-
###
|
|
140
|
+
### Search when you know what the code does but not its name
|
|
379
141
|
|
|
380
142
|
```
|
|
381
|
-
1. search_semantic({ query: "
|
|
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
|
-
###
|
|
148
|
+
### Refactor safely (rename / delete / move)
|
|
387
149
|
|
|
388
150
|
```
|
|
389
|
-
1. search_symbols({ query: "
|
|
390
|
-
2.
|
|
391
|
-
3.
|
|
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
|
-
###
|
|
158
|
+
### Onboard to an unfamiliar codebase
|
|
426
159
|
|
|
427
160
|
```
|
|
428
|
-
1.
|
|
429
|
-
2.
|
|
430
|
-
3.
|
|
431
|
-
4.
|
|
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
|
-
###
|
|
169
|
+
### Tech debt sprint
|
|
435
170
|
|
|
436
171
|
```
|
|
437
|
-
1.
|
|
438
|
-
2.
|
|
439
|
-
3.
|
|
440
|
-
4.
|
|
441
|
-
5.
|
|
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 `
|
|
453
|
-
- **
|
|
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
|
-
##
|
|
196
|
+
## Keeping the index fresh
|
|
458
197
|
|
|
459
|
-
|
|
198
|
+
The file watcher triggers incremental re-indexing automatically. If the index seems stale:
|
|
460
199
|
|
|
461
|
-
```
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
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
|
-
|
|
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
|
-
|
|
208
|
+
Install the PureContext hooks to keep the index in sync automatically and preserve session orientation across context compaction:
|
|
479
209
|
|
|
480
210
|
```
|
|
481
|
-
|
|
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
|
-
##
|
|
489
|
-
|
|
490
|
-
|
|
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.
|