rename
Rename a Python symbol across the project, updating every reference with a safe dry-run preview. Use LSP coordinates to locate the symbol; apply changes only when ready.
Instructions
Rename a Python symbol (function, class, method, variable, module-level name) and update every reference across the project — a binding-aware alternative to find-and-replace. Use your LSP to locate the symbol first; pass its file and 0-based line/character Position (character in UTF-16 units, exactly as the LSP returns). Defaults to a Dry Run that previews the full Blast Radius without writing; set apply=true to write. Supply expected_symbol (the identifier you believe is at the Position) when edits may have happened since your LSP answer — a mismatch fails safely instead of renaming the wrong code. Prefer a clean git working tree before applying, since git is the reversal mechanism; use git diff afterwards for exact text. Occurrences that cannot be proven to refer to this symbol are reported as uncertain_occurrences for you to adjudicate, never silently changed. Keep navigation and reading with your LSP, and formatting with black/ruff — this tool only changes code structure.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | ||
| line | Yes | ||
| root | No | ||
| apply | No | ||
| new_name | Yes | ||
| character | Yes | ||
| expected_symbol | No | ||
| across_class_hierarchy | No | ||
| in_docstrings_and_comments | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||