Rename Variable

Removes smells
Symptom

The agent encounters a variable whose identifier doesn't disambiguate scope or domain; reasoning about any expression involving the variable requires loading the surrounding context first.

Goal

Variable names carry enough disambiguating information that the agent can reason about each symbol without a lookup hop.

Before the refactoring

const a = height * width;

After the refactoring

const area = height * width;
Example source: Illustrative example written for this site, not a quotation from any source.
Pressure

Every reasoning pass re-derives meaning from surrounding context; chained edits compound the cost.

Tradeoff

Renames invalidate cached associations — commit history, RAG snippets, embedding indexes, and prior conversation context all carry the old name until they refresh.

Relief

Per-occurrence reading cost drops to one token of name; reasoning steps that previously had to load surrounding scope to interpret the symbol now resolve from the name alone.

Trap

Renaming variables whose current names another reviewer would have accepted invalidates cached associations (RAG indexes, prior conversation context, comments) without changing what the symbol represents.