While a coding agent works, you can follow what it does and give it corrections. You can also choose which actions need your approval. This lecture shows how to use those controls in Claude Code. We will also explain what you can undo when something goes wrong.
Our example follows a programmer as she seeks to fix a login problem in some software she maintains. Users should be able to log in even if they type capital letters in their email address, but that currently fails. She asks the agent to fix the problem and follows its work one step at a time.
The agent reads the login code before changing it, so it can work from what is already there. The Read entry shows which file it opened.
The agent runs the login program with Alice at Example dot com, using capital letters in the address. The program reports an unknown user, so she can see the problem happen. The Bash entry shows the command and its output. She can run this same example after the edit to see whether it works.
The agent edits the login file to address the problem. The Edit entry tells her which file changed, but she still needs to read the changes to see what they do.
The agent runs the same example again. This time the program welcomes Alice, so this address now works. These tool calls let her follow what the agent did. One successful example does not prove that the whole login system works, so she still needs to read the changes and check other cases that matter.
Some actions need your approval, depending on the permission settings. This prompt asks whether the agent may create a file called hello dot py. The prompt shows the file name and the line of code it wants to write. Check what the action will do before approving it.
Here you can approve just this action, allow edits for the rest of the session, or refuse. If you refuse, you can tell the agent what to do instead. An action that is already allowed can run without asking again, so not every edit or command gets a prompt. Check whether your approval covers one action or allows more actions later.
The permission mode controls how actions are checked before they run. Press Shift Tab to move through the modes available in your setup. Manual mode asks you about actions that are not already allowed. Some actions, such as reading files, and actions allowed by your rules can still run without a prompt.
Accept edits mode lets the agent edit files and do common file operations without asking each time. This can include moving or deleting files, while other commands may still need approval.
In plan mode, the agent can read the project and suggest a plan before changing the code. The actions it allows depend on your setup, so do not assume it means that no command can run.
Auto mode uses another model, called a classifier, to check whether actions look safe and fit the task. It can let actions run without asking you, but it can still make mistakes. Claude Code starts in auto mode unless your settings change that. Check the mode shown on screen, and choose manual mode if you want to approve more actions yourself.
There is also a mode that skips the usual approval prompts, which you can enable with a startup option. This does not isolate the agent from the rest of your computer. It can still use files, credentials, and services that it has access to. Use this option only in an isolated environment that you can throw away, with that access carefully limited.
Choose the mode based on the task and what a mistake could affect. Start with more approval prompts, and allow fewer only when you understand what the agent can change and how you will check its work.
If the agent starts doing the wrong thing, you do not need to wait for it to finish. Press Escape to stop the current response. Tell the agent what to change in plain language. Stopping it does not undo actions it has already finished, so check what it did before continuing.
You can also change your instructions during the task. Continue in the same conversation without explaining the whole task again. For example, say keep the old API, so other code can still call it the same way. This tells the agent what to leave alone while it makes the requested change.
You can use rewind to return to an earlier point in the conversation and continue with a clearer instruction. Choose an earlier message and read the options for what to restore. Press Escape twice when the input is empty to open the rewind menu. If you have started typing a message, pressing Escape twice clears that draft first.
Rewind can undo file edits saved by Claude Code's editing tools, but it does not undo every change. It can restore the conversation, saved file edits, or both, depending on what was saved. Rewind does not undo shell commands or actions in other systems. If a command deletes a file or publishes a change, going back to an earlier point does not undo what the command did.
Git is a version-control tool that saves versions of the project to compare or return to later. Those saved versions are separate from the conversation. Use Git from the start, and check that the files you need are saved. We hope you learned about it in past courses. Just in case you didn't, we review it again later in the course. Git cannot undo everything either, for example, if you published a change on the internet, the action may still need to be undone there.
To quickly recap: You can stop the agent, give it a correction, or go back to an earlier point in the conversation. These controls help you change the task as you learn more. Correct a mistake early, before the agent builds more code around it. Use the undo method that fits the change, then check what it restored.
While the agent works, read the tool calls to follow what it does. Check the code and what the program does, even if the agent says the task is finished.
Choose which actions need your approval by setting the permission mode and rules. Actions you have already allowed may run without another prompt.
Escape stops the current response, and Escape twice on empty input opens rewind. Stopping is not the same as undoing, so check what changed and choose the right way to restore it.
Use these controls while building the demo in the lab. Arrive with Claude Code installed and signed in, ready to follow its work and give it corrections.