universal_find_references
Find all symbol references across a workspace before renaming or moving code. Returns file, line, column, context, and language-aware roles (declaration, import, usage) to assess impact.
Instructions
Find all occurrences of a symbol across a workspace. Structured output with file, line, column, context. Optional language-aware mode (rust/typescript/python/cpp) adds role annotations: declaration, import, or usage. Use this tool BEFORE any refactoring session to understand what will break when a symbol is renamed or moved. When cwd is omitted, ALL registered roots are searched: nested roots are pruned and files are deduplicated by real path, so no match is listed or counted twice.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Workspace root to search (default: all registered roots — nested roots pruned, duplicates removed) | |
| symbol | Yes | Symbol to search for (word-boundary match) | |
| language | No | Optional language-aware mode for role detection | |
| contextLines | No | Lines of context around each match (default: 1) | |
| fileExtensions | No | Restrict to these extensions (default: common source extensions) | |
| excludePatterns | No | Directories to skip (default: .git, node_modules, target, build, dist, __pycache__) |