What problem does it solve? Answering "where is this symbol defined" and "who calls this function" normally requires a fresh full-tree grep on every question, which is slow and token-expensive in large repositories. xref builds a per-repo SQLite index once and refreshes it incrementally, so repeated lookups during a session are nearly free. ## Core Features & Use Cases - Definition lookup: xref def <symbol> returns definition sites with path, line, kind, language, and signature for TypeScript/JavaScript, Python, Go, Rust, and shell. - Reference search: xref refs <symbol> finds word-boundary reference sites with bounded output, totals, and per-file rollups, with an option to exclude definitions. - File outline: xref file <path> lists every symbol defined in a single file as a table of contents. - Incremental caching: the index refreshes automatically by file mtime/size before every read, handles corrupt caches by rebuilding, and never walks non-git directories without an explicit xref index. - Use Case: Before a multi-file refactor, run xref refs runCli to cheaply map which files are in play, then hand off to an LSP or ast-grep for the precise rename. ## Quick Start Ask the agent to find where a function is defined and who calls it in the current repository using xref.