Five ways to stop AI from rewriting the parts you liked, starting with two prompts and ending with Claude Code add-ons that keep it in its lane.
You ask AI to fix one sentence and it rewrites the whole thing. It does this because you gave it a task with no edges. It doesn’t know what you love or what’s off limits, so it "improves" everything. Anthropic’s own prompting guide tells Claude to only make changes that are directly requested. These fixes make sure it does.
01
Prompt: Give it a boundary
Tell it exactly what it can change and what it must leave alone. It also has to show you the before and after, so you can check nothing else moved.
02
Prompt: Make it show you the changes first
For bigger edits. It lists every change it wants to make, then waits. You approve only the ones you want, like "do 1 and 3."
In Claude Code, this is built in. Press Shift+Tab until you see "plan mode on," or start your message with /plan. Claude can’t edit anything until you approve the plan. (Claude Code docs)
Save the boundary prompt as a Claude Project instruction or a ChatGPT Project instruction and every chat in that project starts with it. For more on scoping work, see my 10 rules for using Claude.
These three add-ons are for Claude Code. They’re small, free projects from independent developers, so read what an add-on does before you install it.
03
Skill: Minimal Diff
Minimal Diff by Vicente González tells Claude to make the smallest change that does the job, with "zero drive-by churn." When it’s done, Claude reads its own changes top to bottom and deletes anything you didn’t ask for. Problems it notices elsewhere get reported, not fixed.
Install it from your terminal:
Then in Claude Code, type /minimal-diff followed by your request. Like this idea? The Karpathy rules include the same "surgical changes" habit.
04
Skill: Scope Guard
Scope Guard from Orion Skills has you set which folders Claude can edit and which are off limits at the start of a session. Before every edit it checks the list, and if a file is out of bounds it stops and tells you.
Then type /scope-guard and say what you’re working on, which folders it can edit and which to leave alone. It’s a rule Claude follows, not a lock. For a true lock, use a deny rule in /permissions, which Claude Code enforces in every mode. Here’s how allow and deny lists work.
05
Plugin: A watcher for edits outside your lane
The scope-guard mod from My Claude Code Mods watches every file Claude edits during your session. If it edits outside the folders you allowed, you get a warning so you can stop and check. It only warns. It doesn’t block.
Start Claude Code (or run /reload-plugins), then type /scope allow with your folder name, like /scope allow src/auth. Check it with /scope list. It needs Claude Code 2.1.287 or newer.
Already went off the rails? In Claude Code, press Esc twice or type /rewind and pick "Restore code" to undo Claude’s edits back to any earlier message. It doesn’t undo changes made by terminal commands, so it’s a safety net, not a replacement for saving versions. (How checkpoints work)
More shortcuts like this in my Claude Code commands guide.