Rename Variable

Removes smells
Compare
Symptom
Human

A variable named `t`, `temp`, `data`, `result`, or any other identifier that requires the reader to inspect its assignment to know what it holds.

Agent

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
Human

Variable names match the domain role they play, not their implementation type or scratch nature.

Agent

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
Human

Every reader pays a re-comprehension cost when they encounter the variable; bugs hide in the gap between what the name suggests and what the code does.

Agent

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

Tradeoff
Human

The IDE renames code, not the world around it — cross-repo greps, commit history, comments, and string-literal references silently drift stale.

Agent

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

Relief
Human

Reading the variable's name tells the reader everything needed without checking its definition.

Agent

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
Human

Renaming bikeshedding — endless rename churn for marginal clarity gains while the actual code structure stays unimproved.

Agent

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.