does anyone here have a clean trick for getting llms to stop rewriting your variable names?

i keep running into this thing where i give the model a small code snippet to modify, and instead of touching just the part i asked for, it suddenly renames variables, restructures functions, or “optimizes” stuff i never mentioned. even with lines like “don’t rename anything” or “don’t change structure,” it still sometimes decides to refactor anyway lol.

is there a reliable prompt pattern, guardrail, or mini-module u guys use that actually forces the model to stay literal with code edits?

Leave a Reply