Lesson 1.315 min · 5 cards · 8 exercises · 1 mission

Permissions and reading diffs

Pick the permission mode that fits the task, read the diff before you approve, and know how to back out.

The delete bug in todo-api now has a test that reproduces it, and Claude is fixing it. You glance over and see it has just changed three files without asking a single question. Everything looks fine, but you haven't read a line. This lesson answers two questions: how far is Claude allowed to go on its own, and when it shows you a change, how do you read it well enough to decide whether to approve?

What a permission mode is

Every Claude Code session runs in a permission mode. The mode decides which actions Claude may take on its own and which need your approval first. Same request, "fix this bug": in one mode Claude stops and asks before every file edit, in another it makes the edits and reports back.

No mode is right all the time. With unfamiliar code or sensitive work, you want to see each step. Once you trust the direction and the task is long, you want Claude to keep going without you clicking approve dozens of times. Choosing a mode means choosing how closely to supervise this particular task.

A reminder from lesson 1.1: in recent Claude Code (2.1.283 and later), a session started in a terminal or in VS Code begins in auto.

Four modes for everyday work

Manual (its config value is default). Claude reads files in your working folder freely; editing files or running commands needs your approval. It suits unfamiliar code, sensitive work and your first week.

acceptEdits. Claude creates and edits files in the working folder without asking, and runs a few common file commands such as mkdir, touch, mv, cp, rm and sed. Other Bash commands still ask. Use it when you'd rather let Claude work through a task and review everything at once, in your editor or with git diff.

plan. Claude researches and proposes without editing source code. It reads files, runs commands to explore, writes a plan, and may only make edits after you approve that plan. This is the mode for exploring a codebase before changing it. To run a single prompt in plan mode, start it with /plan.

auto. Claude carries out routine actions without asking. A separate classifier model checks each action first and blocks anything that goes beyond your request, targets infrastructure it doesn't recognise, or seems driven by hostile content Claude has read. The docs are clear: auto reduces prompts but does not guarantee safety. Use it for work where you trust the general direction, not as a replacement for reviewing sensitive operations.

Two special modes, and what no mode approves

dontAsk automatically denies anything that would otherwise prompt; Claude only does what is already allowed. It isn't in the Shift+Tab cycle; you set it with the flag at launch. The docs suggest it for locked-down CI and scripts.

bypassPermissions skips prompts and safety checks so commands run immediately. The docs reserve it for isolated containers and virtual machines, where Claude can't do harm outside. Don't turn it on on your everyday machine to save time.

Some actions are never approved automatically, not even in bypassPermissions: removing critical paths such as rm -rf / or rm -rf ~, and tools you have set an ask rule for. Writes to protected paths, where repository state and Claude's own configuration live, also ask in Manual and acceptEdits.

Switching modes

In the CLI, press Shift+Tab to cycle. If the session is in auto, the first press switches to Manual; after that the cycle runs Manual → accept edits → plan. The status bar under the input box shows the current mode, for example ⏸ manual mode on, ⏵⏵ accept edits on or ⏸ plan mode on. Get used to glancing at it before you hand over a task.

To start a session directly in a mode, use the flag:

claude --permission-mode plan

To change the default for every session, set permissions.defaultMode in a settings file. A later level covers settings in detail.

In VS Code, click the mode indicator under the input box. Its labels are Manual, Edit automatically, Plan, Auto and Bypass permissions, matching the modes above.

Reading a diff

Whatever the mode, you still read the change in the end: when Claude asks in Manual, or afterwards with git diff. The convention is simple: lines starting with - are removed, lines starting with + are added, and unmarked lines are surrounding context.

Read it like a reviewer, with three questions:

  1. Does it stay within what you asked? If you asked for a new error message, the change should be in the error message.
  2. Does it touch unrelated files? A file you didn't expect in the list of changes deserves a question.
  3. Does it drop anything that mattered? The - lines are the easiest to skim past, and the place where behaviour quietly changes.

An example: you only asked to fix the 404 message, but the diff also turns db.todos.delete(id, { soft: true }) into db.todos.delete(id). One argument disappears and a soft delete becomes a hard delete. There's no syntax error, the tests may still pass, but users' data will really be gone. This is exactly the kind of change you need to catch before you approve.

When something is off, decline and say precisely what you want: "keep the soft delete, only change the message". Claude will redo it. For bigger changes you can get an independent look with /code-review: a fresh subagent that hasn't seen the conversation reads the diff without being swayed by the reasoning that produced it.

When you've already said yes

Approving a bad change isn't a disaster if you know the three safety nets:

  • Esc stops Claude mid-action and keeps what's done so far, so you can redirect.
  • /rewind, or Esc twice on an empty prompt, opens the rewind menu: roll the code, the conversation or both back to an earlier prompt.
  • git. /rewind checkpoints only cover files Claude edited with its own file tools. A file that only a Bash command touched can't be restored that way. So always work in a clean git repository, commit often, and treat rewind as a second net, not a replacement for git.

A simple routine for all of level 1: commit before handing over a task, pick the mode that fits it, watch the first minute, read the diff, and only then commit the result. In level 2 you'll write what Claude can't see into CLAUDE.md, so you stop repeating it every session.

Practice lesson 1.3

5 flashcards, 8 exercises checked right on the page, 1 mission on your machine.

Start practice

Related reference

Type to search the reference, templates and lessons.