Claude Code does more than you asked: how to keep it to one change
Claude Code adds things you didn’t ask for because a short request leaves room, and the model fills it. Anthropic’s own prompting guide says recent Claude models tend to overengineer. To keep it to the task, ask for one change and say what done looks like, put a scope rule in CLAUDE.md, plan first when the change touches more than one file, press Esc the moment it drifts, undo with /rewind, and read /diff before you commit. For files it must never touch, use a deny rule: that’s the only one of these Claude can’t talk itself out of.
- Why it does more than you asked
- Ask for one change
- A scope rule in CLAUDE.md
- Plan first, cut what you didn’t ask for
- Stop it the moment it drifts
- Undo it with /rewind
- Read the diff before you commit
- Files it must never touch
- Questions
Why Claude Code does more than you asked
In our Reel I ask Claude for a bigger button. It makes the whole page bigger. I say no, just the button. It removes everything except the button. Then it changes the button’s color, font and text. Three words fix it: “Just. A bigger. Button.” The button goes from 48 to 56 pixels, and that’s the whole change I wanted.
The Reel is a skit, but the pattern is familiar to anyone who works with a coding agent. Two things cause it:
- The model leans that way. Anthropic’s prompting guide has a section on it. It says Claude Opus 4.5 and 4.6 tend to overengineer: extra files, abstractions nobody needs, flexibility you didn’t ask for. Its suggested fix is a prompt line that asks for only the changes that are directly requested or clearly necessary. The guide names those two models; the line costs nothing to add for newer ones.
- The request leaves room. “Make the button bigger” doesn’t say how much, or what must stay the same. Claude fills the gap with a guess, and a helpful guess often means “and while I’m here…”.
You can’t change the first one. Everything below is about the second: leaving less room, catching the drift early, and undoing it cheaply.
Ask for one change, and say what done looks like
The fix that works most often is the boring one: a request with edges. Change the first line and paste:
Make the Save button taller: 48px to 56px.
Change only that. Don't touch other styles, text, or files.
If you see something else that looks wrong, tell me at the end. Don't fix it.
Done when: the button is 56px tall and the diff has nothing else in it.- The exact change. “Taller: 48px to 56px” leaves nothing to guess. “Bigger” leaves everything.
- “Change only that.” Name what must stay the same. Claude can’t know which of your styles are deliberate.
- “Tell me, don’t fix it.” Claude will notice other problems. This line turns them into a list for you instead of extra edits in the diff.
- “Done when.” A check Claude can run itself. Without it, “done” turns into “improved”, and there’s always more to improve.
One change per prompt. If you need three things, send three prompts, or write a plan with three steps. More prompts I send every day are in 3 Claude Code prompts I actually send.
Put a scope rule in CLAUDE.md
Typing the same edges into every prompt gets old. Put them in CLAUDE.md once, and Claude reads them at the start of every session in the project:
CLAUDE.md
## Scope
- Change only what the task asks for. List anything else you'd fix at the end of your reply instead of fixing it.
- No new files, dependencies or abstractions unless the task can't be done without them.
- Don't reformat, rename or reorder code you didn't need to touch.
- "Done" means the check passes, not that the code is better.
This is close to what Anthropic suggests in its prompting guide: only changes that are asked for or clearly needed, and no features, refactoring or “improvements” beyond that. It’s four short rules rather than a paragraph: a specific line is easier for Claude to follow and for you to check.
A CLAUDE.md rule is context, not configuration. Claude reads it and tries to follow it, but nothing enforces it, and in a long session with a strong pull towards “finishing properly” it can lose. So it lowers how often Claude drifts, and the steps below catch the rest. What else belongs in the file, and what doesn’t, is in CLAUDE.md for Claude Code.
Plan first, and cut what you didn’t ask for
When a change touches more than one file, ask for a plan before any code. In plan mode, Claude reads your code and writes the plan, but doesn’t edit anything until you approve it. Press Shift+Tab until the status bar shows ⏸ plan mode on, or type /plan followed by the task.
Scope creep is easiest to see in a plan. Look for steps you didn’t ask for: “also refactor”, “add a helper”, “update the styles for consistency”. Press Ctrl+G, delete those steps in your editor, and approve what’s left. Deleting a line in a plan is cheaper than reverting a file. How to edit and approve the plan is in Claude Code plan mode.
Stop it the moment it drifts
If you see Claude open a file you didn’t mention, don’t wait for it to finish. Press Esc. Claude stops mid-turn, the tool call that was running is cancelled, and the work it already finished stays. Then say what you want instead, in one line: “Just the button.” Ctrl+C interrupts too, but on an empty prompt a second press exits Claude Code, so Esc is the safer key.
Anthropic’s best-practices page gives the same advice: press Esc as soon as Claude drifts. It has one more rule worth keeping: if you’ve corrected Claude twice and it still goes the wrong way, run /clear and write a better prompt. A long conversation full of corrections makes it worse, not better.
For a small task where you want to watch every edit, switch to Manual mode with Shift+Tab. Claude asks before each change, and you can say no to the one that goes too far.
Undo it with /rewind
Claude Code saves a checkpoint before each prompt you send. To go back, type /rewind (it also answers to /undo and /checkpoint) or press Esc twice on an empty prompt. Pick the point to return to, then what to restore:
| Option | What it does |
|---|---|
| Restore code and conversation | Both go back to that point |
| Restore conversation | The chat goes back, your files stay as they are |
| Restore code | Your files go back, the chat stays |
| Summarize from here / up to here | Shrinks part of the conversation into a summary to free up context |
Restore code is the one for scope creep: the extra edits are gone, and Claude still remembers what you talked about, so you can say “that went too far, only the button this time.”
Checkpoints have limits, and the docs say so plainly:
- Changes made only through shell commands, like
rm,mvor a script, aren’t tracked. Once Claude has edited a file with its own tools, later shell changes to that file are. - Edits made by subagents, by you in your editor, or by another Claude Code session usually aren’t captured.
- A session keeps its 100 most recent checkpoints.
Checkpoints aren’t a replacement for git. Commit before a bigger task, so git diff and git restore work whatever Claude does.
Read the diff before you commit
Type /diff to see what changed in your working tree, Claude’s edits included. Read it before you commit, and look for:
- files you didn’t name;
- config, lockfiles and new dependencies;
- renamed functions and variables;
- formatting changes in lines that have nothing to do with the task;
- new helpers and abstractions used in one place.
If something is there that you didn’t ask for, revert that file or that part, or rewind and ask again with tighter edges. Don’t let Claude commit on its own before you’ve looked: then the extra changes go into history with yours.
Files it must never touch: deny rules and hooks
Prompts and CLAUDE.md ask. Permission rules enforce. If some files should never change without you, like migrations or package.json, deny edits to them in the project’s settings:
.claude/settings.json
{
"permissions": {
"deny": [
"Edit(/migrations/**)",
"Edit(/package.json)"
]
}
}
In project settings, a path starting with / is relative to the project root. Edit rules cover all of Claude Code’s built-in tools that edit files, so this blocks writing new files there too. Deny rules hold in every permission mode, auto mode included. When Claude tries to change one of these files, the edit is refused, and it has to come back to you: you make the change yourself or lift the rule.
For rules that depend on more than a path, use a PreToolUse hook with the matcher Edit|Write. Your script gets the tool call, and exiting with code 2 blocks it; whatever the script prints to stderr goes to Claude as the reason. That’s more work, and for most projects a few deny rules are enough.
There’s no “strict scope” mode in Claude Code. None of the built-in output styles limits what Claude changes either: Concise only makes the replies shorter. The tools above are what there is.
Where Meowdoro fits
We built Meowdoro, a focus timer around the MacBook notch for people who work with Claude Code and Codex. Most of what’s above needs you at the keyboard at the right moment: to press Esc when it drifts, approve a plan, or say no to an edit in Manual mode. When a session waits for you, the notch shows it, so a permission prompt doesn’t sit there while you’re in another window, and you see the edit before it lands. During a break nothing reaches you, and the session waits. Meowdoro doesn’t read diffs or approve anything for you. Try it and tell us what’s missing.
Questions
Why does Claude Code change code I didn’t ask it to?
Because the request leaves room, and recent Claude models tend to fill it with extra files, abstractions and “improvements”. Anthropic’s prompting guide describes this and suggests asking for only the changes that are directly requested or clearly needed.
How do I stop Claude Code from overengineering?
Ask for one specific change with a check for done, add a short scope rule to CLAUDE.md, use plan mode for changes across several files and delete the steps you didn’t ask for, and read /diff before you commit.
How do I undo changes Claude Code made?
Type /rewind or press Esc twice on an empty prompt, pick the point to go back to, and choose Restore code. Changes made only through shell commands aren’t tracked, so commit before bigger tasks and use git for those.
Can I stop Claude Code from editing certain files?
Yes. Add deny rules such as Edit(/migrations/**) under permissions in .claude/settings.json. They hold in every permission mode. For conditions beyond a path, use a PreToolUse hook.
Is there a strict scope mode in Claude Code?
No. The closest you get is plan mode, Manual mode, a scope rule in CLAUDE.md, and deny rules for files that must not change.
Related guides
Checkpoints, Esc, permission modes, permission rules, hooks, /diff and output styles: the Claude Code documentation on checkpointing, interactive mode, permission modes, permissions, hooks, output styles and best practices; overengineering: Anthropic’s prompting best practices. All read on November 14, 2026. The Reel is a skit; the button and the numbers in the prompt are examples.