Home › All prompts › Only Change What I Asked: Stop the AI Rewriting Code You Didn't Mention

Mini pack

Free

Only Change What I Asked: Stop the AI Rewriting Code You Didn't Mention

You ask for a tiny change and the agent also rewrites files you never mentioned. These 9 free prompts help you ask questions without anything being edited, see exactly where a change will land before you say go, check what the agent really touched, undo the extras while keeping your fix, and set up a scope rule so every chat starts small.

Ask questions without triggering edits, see where a change will land before it happens, check what the agent really touched, undo the extras while keeping your fix, and make small changes stay small.

9 prompts in 4 sections. Replace everything in [BRACKETS IN CAPS], then copy and paste into your AI tool.

Download the free PDF

PDF, 16 pages

Written for use with

  • Claude Code, Cursor's Agent and Lovable: all 9 prompts are pasted into any of the three, opened in the reader's project. Prompts 1.1, 2.1 and 2.2 only read and report; 1.2 and 4.2 stop for a "go" before editing; 1.3, 3.1, 3.2 and 4.1 make changes and say when to stop and ask. Prompts 2.1 to 3.2 and 4.2 use git (Claude Code and Cursor); the Lovable tips point to Build mode's file diffs, version history and Revert and resend instead. The core rule: change only what was asked, and park anything else in NOTICED.md.
  • Claude Code: manual mode (default) asking before edits, plan mode (Shift+Tab or /plan), /diff, /rewind and Esc twice (shell-only changes aren't tracked, so use git), CLAUDE.md or AGENTS.md, rules followed "almost every time", and /clear were checked against Anthropic's permission modes, interactive mode, commands, checkpointing, memory and best-practices pages.
  • Cursor: read-only Ask mode (Shift+Tab or the mode picker), checkpoints that revert all files and are separate from Git, and .cursor/rules .mdc files with Always Apply, or AGENTS.md, were checked against Cursor's Ask mode help page, Agent overview and Rules docs.
  • Lovable: Chat mode (no code changes), Select elements in the preview toolbar (press S), Build mode's file diffs and Details view, version history (Revert, Bookmark, Revert and resend; code only, not database data), AGENTS.md or CLAUDE.md read with every message plus Project settings → Instructions, and the debugging guide's "change only what this task requires" prompt were checked against Lovable's docs.
  • Not repeated here: one-change templates point to Lovable Credit Saver 2.1 and Bolt Token Saver 2.2; one plan step at a time to Make Cursor Usage Last 2.2; reviewing a whole branch against the request to AI Code Review 2.1; hard-blocking protected files to Claude Code Guardrails 3.3; big cleanups to Refactor Without Breaking; the rules file as a whole to One Rules File.
  • No stats or X claims: no numbers, no X posts quoted, and no affiliate or sponsor copy.

Written for use with Claude Code, Cursor's Agent or Lovable. Not yet tested against them.

All 9 prompts

  1. 1.1 Just Answer, Don't Edit
  2. 1.2 Show Me the Change Map First
  3. 1.3 Make This Change, Park Everything Else
  4. 2.1 Every Changed File in One Plain Sentence
  5. 2.2 Check the Diff for Hidden Damage
  6. 3.1 Keep My Change, Undo the Rest
  7. 3.2 Undo the Unasked Lines Inside One File
  8. 4.1 A Scope Rules Block for My Rules File
  9. 4.2 The Small-Change Routine

Section 1: Fence It In Before It Starts

1.1 Just Answer, Don't Edit

Untested: not yet run against a model.

Use this when you want to ask a question about your code, like "why is this button square?", without the agent jumping in and changing things. It's for getting an answer and a suggested fix, with no files touched.

Fill in: [MY QUESTION] (e.g. "why are the corners on this button square?"), [WHERE I'M LOOKING] (e.g. "the Save button on the settings page").

This is a question, not a request to change anything. Don't edit, create or delete any files, and don't run any command that changes anything.

My question: [MY QUESTION]
Where I'm looking: [WHERE I'M LOOKING]

Please:
1. Answer in plain English, in a few sentences.
2. Point me to the file and the lines that matter.
3. If something should change, describe the smallest change you'd make and which file it's in. Don't make it.
4. Tell me if other parts of the app use that same code, so I know what a change there could affect.
I'll tell you if I want the change made.

Tips to customize: For extra safety, switch your tool to a mode that can't edit code before you send this. In Cursor, that's Ask mode, which is read-only (press Shift+Tab to cycle modes, or use the mode picker). In Claude Code, it's plan mode (press Shift+Tab, or start a single message with /plan), where Claude researches and proposes changes without making them. In Lovable, it's Chat mode, which lets you discuss your app without changing any code. If you like the suggested fix, take it to Prompt 1.2 or 1.3.

1.2 Show Me the Change Map First

Untested: not yet run against a model.

Use this when you're about to ask for a small change and want to see exactly where it will land before anything is edited. It's for a short map of files and spots, plus what the agent will leave alone, so you can say yes or trim it first.

Fill in: [THE CHANGE] (e.g. "make the Save button's corners slightly rounder"), [WHERE I THINK IT IS] (e.g. "the settings page", or "not sure").

Before you edit anything, show me a change map for this request. Then stop.

The change: [THE CHANGE]
Where I think it is: [WHERE I THINK IT IS]

The change map:
1. Files: every file you'd edit. For each one, the exact spot (the component, function or line numbers) and what you'd change there, in one plain sentence.
2. Size: roughly how many lines you'd change in total.
3. Leaving alone: anything nearby you noticed but won't touch.
4. Shared code: if the spot is used in other places (for example, a button style used on every page), tell me which other screens would change too, and offer a way to change only the one I mean.
5. Questions: if the change could go in more than one place, ask me which one. Don't pick for me.

Don't edit anything until I reply "go". After that, change only what's on the map. If you find you need something that isn't on the map, stop and ask me first.

Tips to customize: A tiny visual change is usually one file and a few lines. If the map lists five files for a rounder button, ask why before you say go. Point 4 is where surprises hide, because changing a shared style changes every screen that uses it. In Lovable, you can point at the exact thing first: click Select elements in the preview toolbar (or press S), click the element, then send this prompt so Lovable knows what you mean. In Claude Code, manual mode (shown as default in settings) asks before each file edit, so you can check every edit against the map as it happens.

1.3 Make This Change, Park Everything Else

Untested: not yet run against a model.

Use this when you want one change made and you know the agent will spot other things it wants to "improve". It's for keeping the edit small and getting those other ideas as a list you can decide about later.

Fill in: [THE CHANGE], [FILES IT SHOULD NEED] (e.g. "src/components/SaveButton.tsx", or "the files on the change map you just showed me"), [DONE LOOKS LIKE] (e.g. "the Save button has rounder corners, and nothing else looks different").

Make this one change, and nothing else.

The change: [THE CHANGE]
Files it should need: [FILES IT SHOULD NEED]
Done looks like: [DONE LOOKS LIKE]

How to work:
- Edit only the files above. If another file really needs a change, stop and tell me which one and why. Don't edit it yet.
- Keep everything else exactly as it is: names, formatting, imports, comments, styles and the order of things in each file.
- Don't delete anything except code this change replaces.
- If you notice a bug, messy code or a possible improvement while you work, don't fix it. Add it to a file called NOTICED.md in the project's main folder, with the file name, what you saw and why it might matter.
When you're done, tell me which files you changed and how many items you added to NOTICED.md.

Tips to customize: NOTICED.md turns "while I was in there" fixes into a to-do list you control. Go through it later and ask for each item as its own small change. Keeping the formatting matters more than it sounds: if the agent reformats a whole file, the diff gets huge and the one line you cared about is hard to find. Lovable's own debugging guide suggests a similar instruction: change only what the task requires, show the change as a minimal diff, and list improvements separately instead of making them.

Section 2: See What It Really Touched

2.1 Every Changed File in One Plain Sentence

Untested: not yet run against a model.

Fill in: [WHAT I ASKED FOR] (paste the request you sent).

Don't change anything. Just report.

What I asked for: [WHAT I ASKED FOR]

Look at the real changes since my last commit: run git status and git diff, and include new files that git isn't tracking yet. If you can't run git, list every file you edited during my last request instead, and tell me that's what you did.

Then give me a table with one row per file:
1. File name.
2. Changed, new or deleted.
3. What changed, in one plain sentence a beginner would understand.
4. Group: "asked for", "needed for what I asked" (say why in a few words) or "not asked for".
Under the table, list anything in the "not asked for" group that could break something that worked before.
Base this on the diff, not on what you remember doing.

Tips to customize: Check the number of files against your change map from Prompt 1.2. In Claude Code, /diff opens a view of the changes in your project that you haven't committed, including Claude's edits so far, so you can check the report against it. In Lovable, Build mode shows its changes as file diffs and summaries, and you can follow them step by step in the Details view. Compare the agent's answer with those. If anything lands in "not asked for", go to Prompt 3.1 or 3.2.

2.2 Check the Diff for Hidden Damage

Untested: not yet run against a model.

Use this when the change looks fine on screen but you want to be sure nothing quietly got deleted or swapped. It's for a read-only sweep of the changes for the things that are easy to miss: removed code, settings, packages, data files and tests.

Fill in: [WHAT I ASKED FOR] (paste your request), [WHAT MUST STILL WORK] (e.g. "logging in, saving a note, and the test logs in the logs folder").

Don't change anything. Check the changes since my last commit (git diff, plus new files git isn't tracking yet) for hidden damage, and report.

What I asked for: [WHAT I ASKED FOR]
What must still work: [WHAT MUST STILL WORK]

Look for each of these, and write "none found" if there's nothing:
1. Deleted files, or folders that were emptied.
2. Removed functions, components, pages or routes, and anything that still uses them.
3. Changes to settings or config files, environment files, or package and lock files (packages added, removed or upgraded).
4. Changes to database files, migrations, seed data, logs or anything else that stores data.
5. Tests that were deleted or skipped, or had their expected results changed.
6. Code that was commented out, or replaced with a placeholder like "TODO" or "rest of code here".
For each thing you find, show the file and lines, say whether my request needed it, and how it could affect "what must still work".
End with one verdict: "Safe to keep", "Check these first" or "Undo before keeping".

Tips to customize: Run this before you commit. One catch: git doesn't show changes to files your project ignores on purpose (the ones listed in .gitignore), and those are often exactly the risky ones, like environment files, local databases and logs. Add "also run git status --ignored, and tell me about any command you ran this session that deleted or moved files" if you want those covered too. In Lovable, scan the file diffs from Build mode for the same six things.

Section 3: Undo the Extras, Keep the Fix

3.1 Keep My Change, Undo the Rest

Untested: not yet run against a model.

Use this when the agent changed the file you wanted plus other files you never mentioned. It's for putting every other file back the way it was at your last commit, with a backup of the extras just in case.

Fill in: [FILES TO KEEP] (e.g. "src/components/SaveButton.tsx").

I want to keep the changes in some files and undo every other change since my last commit. Go step by step and wait for my OK where I say.

Files to keep: [FILES TO KEEP]

1. Run git status and list every changed, new and deleted file. Mark each one "keep" or "undo".
2. If a "keep" file depends on something in an "undo" file, stop and tell me before going further.
3. Show me the exact commands you'll use to:
   a. Back up the "undo" changes first, for example by saving them to a file called extras-backup.patch and moving any new "undo" files into a folder called extras-backup.
   b. Put the "undo" files back to how they were at my last commit.
   Don't delete anything. Wait for my OK.
4. After my OK, run the commands. Then run git status again and show me that only the "keep" files are still changed.
5. Tell me in one or two lines how I'd bring back an undone change later if I need it.
Don't touch the "keep" files at any point.

Tips to customize: Check that the app still runs after step 4, then commit the change you kept. Delete the backup only when you're sure you don't need it. Your tool's own undo is the other option, but it rolls back everything, including the part you wanted. In Claude Code, /rewind (or pressing Esc twice with an empty prompt) can restore code to an earlier checkpoint, but files changed only by shell commands aren't tracked there, so git is the safer way back for those. In Cursor, restoring a checkpoint reverts all files to that point, and Cursor's docs say to use git for permanent version control. In Lovable, revert to the version from before the change in the History panel, then send a tighter request (Prompt 1.3), or edit your past message and choose Revert and resend. Lovable's revert restores code only, not database data.

3.2 Undo the Unasked Lines Inside One File

Untested: not yet run against a model.

Use this when the file you wanted changed also got edits you didn't ask for, like renamed variables or a rewritten function. It's for keeping only the lines your request needed and putting the rest of that file back.

Fill in: [THE FILE] (e.g. "src/components/SaveButton.tsx"), [WHAT I ASKED FOR].

In [THE FILE], I want to keep only the edits my request needed and undo the rest.

What I asked for: [WHAT I ASKED FOR]

1. Compare [THE FILE] with my last commit (git diff -- [THE FILE]) and split the changes into numbered chunks.
2. For each chunk, show the before and after, and label it "needed" or "not needed" for my request, with a one-line reason.
3. Stop and wait. I'll reply with the chunk numbers to keep.
4. Then put every other chunk back exactly as it was at my last commit, including spacing and comments.
5. Show me the new git diff for [THE FILE] so I can see that only the kept chunks are left, and check that the app still builds.

Tips to customize: Be suspicious of chunks labeled "needed" that rename things or move code around. Ask "what breaks if I undo this chunk?" before you keep it. If you'd rather pick the chunks yourself, git add -p walks through a file's changes one chunk at a time and asks which ones to stage. In Lovable, the project chat may not be able to compare with a git commit, so the revert-and-resend route in Prompt 3.1's tips is usually simpler.

Section 4: Keep Every Chat Small

4.1 A Scope Rules Block for My Rules File

Untested: not yet run against a model.

Use this when you're tired of typing "only change what I asked" in every chat. It's for adding a short scope section to the rules file your tool reads on its own, without rewriting the rest of the file.

Fill in: [MY RULES FILE] (e.g. "AGENTS.md", "CLAUDE.md" or "a new file at .cursor/rules/scope.mdc"), [NEVER TOUCH WITHOUT ASKING] (e.g. "the database folder, the login code and .env files").

Add a short "Scope" section to [MY RULES FILE]. Don't change anything else in the file, and show me the section before you save it.

Never touch without asking: [NEVER TOUCH WITHOUT ASKING]

Write these rules in plain words, in 8 lines or fewer:
- Change only what the request asks for. If a change needs files I didn't name, list them and ask first.
- Don't rename, reformat, reorganize or "clean up" code the request doesn't need.
- Don't delete files, data, logs or tests unless I ask for them by name.
- Never touch these without asking: [NEVER TOUCH WITHOUT ASKING]
- If you notice other problems, add them to NOTICED.md instead of fixing them.
- A question is not a request to edit. Answer it, then wait.
- When you finish, list every file you changed, one line each.
If [MY RULES FILE] already has a rule that says the same thing, or the opposite, point it out instead of adding a second one.

Tips to customize: Pick the file your tool reads. Claude Code reads CLAUDE.md at the start of every session, and can read AGENTS.md instead. Cursor reads AGENTS.md, or rule files in .cursor/rules. Those must end in .mdc, and a rule set to Always Apply (alwaysApply: true) is used in every chat. Lovable reads an AGENTS.md or CLAUDE.md in the top level of your project with every message, and you can also paste these lines into Project settings → Instructions. Rules are strong hints, not locks. Anthropic's Claude Code guide says a rule like "Don't touch the migrations folder" will be followed almost every time, and Lovable's docs say instructions may not always be followed in very long conversations. For files that must never change, use Claude Code Guardrails 3.3.

4.2 The Small-Change Routine

Untested: not yet run against a model.

Use this when you want every small change to follow the same safe loop: save point, change map, change, check, commit. It's for a routine the agent runs for one change at a time, so a bad edit is always one step from undo.

Fill in: [THE CHANGE] (e.g. "add a 'Last saved' time under the Save button").

Let's make one small change using this routine. Stop where I say.

The change: [THE CHANGE]

1. Run git status. If there are uncommitted changes, stop and ask me whether to commit them first, so this change starts from a clean save point.
2. Show me a change map: the files and spots you'll edit, and anything shared that other screens use. Wait for my "go".
3. Make only the mapped change. Put anything else you notice in NOTICED.md.
4. Show me git diff --stat (file names and line counts only), then one plain sentence per file. Flag anything that isn't on the map.
5. Give me one quick check to do by hand to see the change, and one thing that used to work that I should make sure still works.
6. After I say it looks right, suggest a short commit message and commit only the files on the map, plus NOTICED.md if it changed.
Then stop. Don't start another change.

Tips to customize: A commit after every change that works is what makes Prompt 3.1 easy: there's always a clean point to go back to. Start a fresh chat for the next change (in Claude Code, /clear between unrelated tasks; in Cursor, a new chat). In Lovable, every change is saved as a version automatically, and you can bookmark a working version in the History panel, so use that in place of steps 1 and 6.

Get new free packs in your inbox

Optional. Every prompt here is free, and you don't need to sign up to use any of them. We email when we add new free packs. Unsubscribe anytime.

More free packs: Vibe Code Starter Pack Ship It Safe Fix My Bugs Ship It Live Make It Pretty Get Paid Signup Emails That Actually Arrive Lovable Credit Saver One Rules File for Every AI Tool Make Your Claude Code Limit Last Graduate From Lovable First App Store Submission Survive Your First Traffic Spike Get Found on Google First 100 Users Two AIs, One Project It Broke in Production Hit the Slop Wall? Refactor Without Breaking Everything Vibe Code From Your Phone AI Reverse Engineering Run Several AI Agents at Once Claude Code Guardrails Let AI Review Your AI's Code Make Your Cursor Usage Last Privacy Policy and Terms That Match Your App Install Skills, Plugins and MCP Servers Without Getting Burned Say What You Mean Prompt Injection: Don't Let a Web Page or a Strange File Hijack Your Agent Hit Your Limit Mid-Task? Switch AI Tools Without Losing Your Place Don't Let the AI Delete Your Data: Safe Database Changes Make the AI Teach You While It Builds Bolt Token Saver v0 to Production Claude Code Subagents and Skills for Beginners Logins, Tokens and JWTs in Plain English Put Your Web App on Their Phone Add AI Features in Lovable Is Anyone Using It? Simple Analytics for Vibe Coders Use the Cheap Model for the Easy Stuff: Claude Code Model Mixing Ship Updates Without Breaking the Live App: Preview Links, Checks and One-Click Rollback Try to Break It: Stress-Test Your App Before Strangers Do Claude Code Memory: Stop It Forgetting Your Decisions Fix Your Lovable Security Warnings Without Breaking the Live App What Will My App Cost to Run? A Monthly Bill You Can Predict Leave Claude Code Running Without It Getting Stuck Put Your Lovable App on Autopilot: Automations That Check and Report for You Spec and Tests First: Tell the Agent When It's Done Stop Getting 429'd: Call Other People's APIs Without Hitting Limits Use the Current Version: Stop the AI Writing Outdated Library Code What Did My Agent Actually Do? Read Your Claude Code Session History Your First Google Play Launch: Get Through the 12-Tester, 14-Day Closed Test Will Anyone Want It? Check Your App Idea Before You Build Claude Code Code Mode: Try It Without Breaking Your Safety Checks Coding With Gemini 4 Neon: Make It Double-Check Its Own Work Understand the App You Already Built: A Guided Tour of Your Own Code Your Guess Might Be Wrong: Make the AI Find the Real Cause Before It Fixes Replit Missions: Give Agents a Goal, a Budget and Approval Rules Make Your Antigravity Quota Last: Pick the Right Gemini Model and Check /usage Turn a Claude Artifact Into a Desktop App, Without Giving It Too Much Access Built It for Work? Make Sure Only Your Team Can Open It Plan Before It Builds: Use GitHub Spec Kit So the Agent Builds the Right Thing Saves That Stick: Fix Data That Disappears Rebuilt Your Site With AI? Make Sure Google Can Still See Every Page Subscriptions and Paywalls: Gate Features by Plan Your AI App Builder Is Shutting Down: Get Your Code, Data and Domain Out Your Own Android App From a Prompt: Build It in Google AI Studio and Put It on Your Phone Backups You Can Actually Restore: Check, Copy and Test Your Supabase Data Accessibility Pass Before You Ship: Make Your App Work With a Keyboard, a Screen Reader and Zoom Update Your Dependencies Without Breaking the App: npm Updates, Audits, Major Upgrades and Dependabot