Local workspace index in VSCode workspace storage (ExtensionContext.storageUri), not under .gen/.
The agent searches it via the codebase_search tool (trigrams), without sending the whole index to the LLM.
- Fast project overview without a full
grep/globscan - Ranking code fragments for agent context
- The index is written to workspace storage
index/<key>/manifest.json(+merkle.json: nodes, chunk/symbol digests, skip metrics; optionalindex.sqlitewhenindexStorageBackend=sqliteand file count ≥indexSqliteMinFiles). FlatdirDigestsin the manifest mirrors Merkle dirs. - On update, unchanged dirs/files skip re-read when Merkle digests + content-hash match (size+mtime gate;
indexForceContentHashforces content-hash); unchanged chunk bodies and symbol leaves are reused (stable content ids / merkle patch). - LSP symbol index (optional cache): workspace storage
symbols.jsonviavscode.executeDocumentSymbolProvider. Used byfind_symbol/find_codeintentsymboland@symbols. - Outline (
outlineEngine): Tree-sitter wasm (@vscode/tree-sitter-wasm) with field-based rules when available;autofalls back to TypeScriptcreateSourceFile(JS/TS) / LSP DocumentSymbol / regex. Modetreesitteris strict (no fallback). Settings:auto|treesitter|lsp|typescript. - Chunks (
chunkEngine): AST spans via Tree-sitter (autowith fallback, or stricttreesitter) or line/heuristic windows (lines). Languages:treeSitterLanguages(empty = full set;*/all= every available wasm). Full set: Go, C++, Rust, JS/TS, PHP, Python, HTML, JSON, YAML, SQL, Kotlin, Dart/Flutter, Swift, CSS (+ java/bash). Not supported: C#, Ruby, Scala. Vendor wasm:resources/tree-sitter-extra/. Policy:../../gen-vscode-docs/tree-sitter-languages.md. OptionaltreeSitterUseWorkerruns parse in aworker_threadsWorker (falls back to in-process). - Scan excludes
.gen//.git/node_modulesand respects workspace-root.gitignore/.genignore. Indexing runs in the background without requiring.gen/config.json. - On file change, only that file is reindexed (content-hash compare); outline/symbols update per-file (debounced), full rebuild only after a complete index pass.
- Settings UI for engines, languages, storage backend, and repair: Settings -> Project (not Agent).
codebase_searchresults are fragments (path, lines, snippet, score); debug mode can surface merkle skip %.- In chat:
@file,@folder,@codebase,@map,@symbolsinject context (see chat.md).
| Mode | Behavior |
|---|---|
off |
Remote /embeddings only |
trigram (default) |
Prefer remote; when remote is missing or fails, semantic_search / find_code fall back to IndexManager trigrams |
vector |
Prefer remote; then offline feature-hash dense index in workspace storage vectors.json (synced on fullIndex/reindex via onlyChunkIds); then trigram |
Remote /embeddings uses batching, retry/backoff on 429/5xx, and caches vectors in the same vectors.json keyed by content-hash + model.
LSP symbol index metrics (ok / fail / partial) show on Settings -> Project; Repair rebuilds symbols.json.
Call hierarchy / “who calls Y”: tool find_references (LSP reference + definition providers; multi-root via folder/root; limit/offset paging; cross-lang when a language server is available).
- Open a workspace and open Gen chat - indexing starts in the background into
storageUri. - Optionally run Gen: Initialize project (.gen) / slash
/initfor agents/commands/skills scaffold and a seeded.genignore(not required for the index to run). - Tune outline/chunk engines under Settings -> Project if needed.
- In Agent mode, call
codebase_searchwithquery(symbol, phrase, path). Preferfind_code/find_symbol/pack_context/similar_codefor hybrid retrieval. - For exact line grep -
grep(paths viaglob).
Offline quality gate (no remote embeddings): src/test/eval/retrieval.eval.ts + pure metrics in src/features/index/retrievalMetrics.ts (precision@k, hit-rate, simpleScore). Permissions/confirm smoke: src/test/eval/permissionsConfirm.eval.ts.
npm run check-types
npm test -- --grep eval
# or: npm run test:evalOn project enable or /init, these are created if missing: agents/, commands/, plugins/, skills/, tools/, references/, plans/ - plus a short .gen/README.md and .gitkeep in empty dirs. Also seeds workspace-root .genignore and a starter .gen/config.json with deniedCommands / sensitivePathPatterns / secretPatterns (path ignore stays in .genignore). Existing files are never overwritten. references.json is created on demand, not during scaffold.
More on tools: tools.md.