code_rename_symbol
code_rename_symbol finds every definition, call site, import, and type reference for a symbol so you know exactly what a rename will touch — before making any changes. Always run in dry-run mode first.
code_rename_symbol(old_name="processUser", new_name="handleUser", dry_run=true)Parameters
Section titled “Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
old_name | string | required | Current symbol name |
new_name | string | required | Desired new name |
dry_run | boolean | true | Preview changes without writing files |
Output
Section titled “Output”Rename: processUser → handleUserLocations to update (7):
src/services/user.ts:44 definition src/controllers/user.ts:31 call site src/controllers/admin.ts:88 call site src/middleware/auth.ts:22 call site src/types/user.d.ts:12 type reference tests/user.test.ts:14 call site tests/integration/user.test.ts:9 call siteSafe rename workflow
Section titled “Safe rename workflow”# Step 1: preview (always)code_rename_symbol(old_name="processUser", new_name="handleUser", dry_run=true)
# Step 2: review each locationcode_get(name="processUser")
# Step 3: make the change, then verifycode_build()When to use
Section titled “When to use”- Before any rename to understand the full blast radius
- When a function has spread across many files and you are unsure of all usages
- As a safety check before automated refactoring