Asking questions felt safe because nothing changed. The hesitation usually arrives with the first edit: you tell Claude Code to change a file, it offers to do exactly that, and your hand stops over the approval. Most people stay there for a while.
Knowing how to undo the edit gets you moving again. Claude Code keeps a snapshot of your files before each request, and one command can put them back. You are going to make that loop real by changing one file and restoring it on purpose.
Do this
-
Start in a project with a clean git history. First, check that you have nothing uncommitted:
git statusYou want to see
nothing to commit, working tree clean. If you have work in progress, commit or stash it first. You are about to let another tool edit this folder, and a clean starting point makes its change easy to read afterward. -
Start Claude Code and give it one small, concrete task. Here, small means one file, and concrete means you can tell whether the task was completed:
Add a docstring to the top of src/utils.py saying what the file is for.Replace the example path with a real file in your project. A vague request such as “clean up the code” gives you a change you cannot judge. That defeats the exercise.
-
Read the permission prompt before you answer it. The prompt appears because your current mode does not allow Claude to edit a file without your approval. It names the file and shows the proposed content. Read the file path first. That is the detail people skip, and it is the detail that tells you whether the edit is going to the right place.
-
Say yes to this one. Approve the edit. You will also see an option to approve it and stop being asked. Leave that option alone for now; the point today is to see the prompt and make one deliberate choice.
-
Read the diff. A diff is a before-and-after view that shows removed and added lines instead of the whole file. Claude prints one after the edit. Read it, then open the fuller view:
/diffThis opens an interactive view of the same information. It shows both the changes git sees and the changes made during each turn of the conversation.
-
Undo it on purpose. Type:
/rewindA menu opens. Choose Restore code. Claude Code puts the files back but leaves the conversation in place, so you can still read what was said.
/undoand/checkpointopen the same menu, as does pressingEscapetwice on an empty prompt. -
Prove the file went back. In a terminal, run:
git statusYou want
working tree cleanagain. The menu saying it restored the file is not your proof; the working tree reported by git is. If you do not verify the restore, you are guessing about it.
That is the loop: let Claude Code make a change, inspect it, and take it back when you do not want it.
What just happened
The prompt. Whenever Claude wants to do something your current permission mode does not allow, it stops and asks. A permission mode controls how much Claude Code can do before checking with you. The mode used by a new install allows reading and nothing more, so a file edit must stop. Answering yes allows that one call; the next edit asks again.
Three details will save you trouble from day one:
Escapedeclines the prompt, and answering no does the same. If you decline from the main conversation without attaching a comment, the entire turn stops. That is what you want when the file path is wrong.- Press
Tabwhile the yes or no answer is selected to open a comment box. You can decline and explain what Claude should do instead in one move, without waiting to type a separate correction. - On a shell-command prompt,
Ctrl+Eexplains the command and labels it Low, Med, or High risk. The explanation costs a model call, so Claude Code waits for you to request it.
The undo. Before each prompt you send, Claude Code writes a checkpoint that captures your files at that moment. It keeps the most recent 100 per session. Because those checkpoints are stored with the conversation, they survive when you close a session and resume it later. They are deleted with the session after 30 days. /rewind lets you choose one.
The menu has six choices, but the important split is between code and conversation. Restore code and conversation rolls back both. Restore conversation rewinds what was said while leaving your files alone. Restore code, the option you used, puts the files back and keeps the conversation. Two summarize options compress the conversation without touching files, and Never mind closes the menu.
Once you trust the undo, you can afford to test an uncertain idea. You can let Claude Code attempt a refactor, inspect the result, and throw it away if it is wrong. Without that confidence, you approve nothing and return to typing every change yourself, the same workflow you had before, only with an unused tool waiting beside you.
Editing a file and running a command are not the same act
Soon you will meet a second kind of prompt, and the difference matters.
A file edit has clear boundaries. Claude Code knows the file, the lines, and the content it will write. It can restore the old version because its own editing tools made the change and recorded what was there before.
A shell command has no such boundary. npm install reaches the network. rm -rf build removes a directory. The command runs as a program with your account’s access, and after it runs, Claude Code has no general way to reverse it. The checks are heavier for that reason. Read-only commands such as ls, cat, grep, and head run without a prompt in every mode because they cannot change anything. A command joined with && or | is split into pieces, and each piece must earn approval on its own. A deletion aimed at something structural, such as your home folder or the filesystem root, is never approved automatically in any mode, regardless of your settings.
The same difference controls what Claude Code remembers. Approve a command with the option that stops future prompts, and it writes a rule into a file in your project. That rule remains active in later sessions. File-edit approvals are never written down; they end with the session.
You ask Claude to rename old_helper.py to helpers.py. It runs git mv, you approve the command, and later you decide the old name was better. You type /rewind, but the menu shows only conversation options. Restore code is missing.
Nothing is broken. Checkpoints track changes made through Claude’s file-editing tools, while a shell command’s changes are invisible to them. The checkpoint records no file change for that turn, so the menu hides the two code options because it has nothing to restore.
The same blind spot includes files changed by another session or by you in your editor while Claude was working. It also includes paths that are symlinks or hard links, which Claude Code skips with the message Restored the code, but skipped N files.
The fix is a working habit rather than a Claude Code setting: commit before starting work you may want to abandon. /rewind is the fast undo for edits inside a session; git covers everything else.
The setting that decides how often it asks
One setting sits behind all of these prompts, and module 11 covers it in full. For now, you need two facts.
The bottom of the screen shows your current mode, and Shift+Tab cycles through the choices. A new install begins in the cautious mode: reads run freely, and everything else asks. Other modes stop asking about edits, stop asking about almost everything, or plan without touching anything. Choose among them deliberately after you understand what you are approving. If the prompts suddenly go quiet, check the status line before hunting for a bug; you may have changed modes by accident.
Check yourself
- You approved a file edit, then approved a shell command with the “don’t ask again” option. Which decision is still active tomorrow?
/rewindopens with conversation options only. What does that reveal about how the last change was made?- You want to decline a permission prompt and tell Claude what to do instead in the same action. Which key do you press, and while which answer is selected?