Claude Code permission modes and deny rules explained

Day 5, 30 minutes · beginner

Goal of this lessonSwitch between Claude Code's permission modes, know which mode fits which job, and add a deny rule that blocks Claude from a file in every mode.

Why it matters

Claude Code can do almost anything you can do in a terminal: create and delete files, run programs, use git. That is what makes it useful, and it is why you want to decide what it may do without asking you first. A permission is that decision: Claude may do this, Claude must ask about that, Claude may never do this other thing.

Claude Code gives you two tools for it. A permission mode sets the general level for a session, from "ask me about everything" to "check things in the background and keep going". Permission rules go further: they allow or block one specific thing, in every mode.

Today you try the modes you will use, learn which mode fits which job, and add one rule that keeps Claude out of a private file. At the end you have a mode card for yourself and a deny rule in your practice project.

The modes, as the docs list them today

The permission modes page names six modes. The bar under the prompt box shows which one is on.

Mode Bar shows What runs without asking Good for
Manual (config name default) manual mode on Reading files in your folder Sensitive work, code you do not know yet, learning
Accept edits accept edits on Reading, editing files in your folder and simple file commands such as making a folder Changes you will review afterwards
Plan plan mode on Reading and exploring; no edits until you approve a plan Looking before you change anything
Auto auto mode on Everything, with a second model checking each action in the background Longer tasks where you trust the direction
Don't ask (dontAsk) don't ask on Only what you allowed in advance; the rest is refused Scripts and automated runs
Bypass permissions bypass permissions on Everything, with no checks Isolated test machines only

Auto mode is where new terminal sessions start when it is available to you. A separate model, which the docs call the classifier, reviews actions before they run and blocks ones it judges risky, such as downloading and running code from the internet, sending sensitive data outside, or deleting files that existed before the session. If it blocks several actions in a row, it goes back to asking you. The docs also warn that auto mode reduces prompts but does not guarantee safety.

Bypass permissions turns the checks off. The docs say to use it only in isolated environments, like a container or virtual machine without internet access, where Claude cannot damage your computer, and that it offers no protection against unintended actions. You cannot switch to it in a running session: you would have to start Claude Code with a special flag. You will not use it in this course, and you should not use it on your own computer.

Switching modes

In the terminal, Shift+Tab cycles through the modes: from auto to Manual, then accept edits, then plan, and back. Some Windows setups use Alt+M instead. You can also start a session in a mode, as you did with claude --permission-mode manual. A plan request that starts with /plan switches to plan mode for that request.

A Manual mode prompt has a useful extra. On most prompts you can move to Yes or No and press Tab to add a comment. With No, your comment tells Claude why, and it carries on with that in mind. With Yes, the comment reaches Claude after the action has run.

Rules: allow, ask and deny

Modes set the general level. Rules handle specific cases, and you manage them with /permissions. There are three kinds:

  • Allow: Claude may use this without asking, for example one command you run often.
  • Ask: always ask me about this, even in a mode that would not.
  • Deny: never. A deny rule blocks in every mode, including auto and bypass.

A rule names a tool and what it applies to. Read(./secret-recipe.txt) blocks Claude's file tools from reading that one file. Bash(git push *) matches commands that begin with git push. Where you save a rule decides who it applies to. The project file .claude/settings.json is shared with everyone through git. Your personal file for the project, .claude/settings.local.json, is where Claude Code normally saves the "Yes, and don't ask again" answers you give, and it keeps that file out of your commits. On Windows and in some other setups it keeps that file in the .claude folder where you started Claude Code, next to .claude/settings.json, instead of at the root of the repository.

Rules are enforced by Claude Code itself, not by Claude's judgement. That is the difference with CLAUDE.md from lesson 4: a line in CLAUDE.md is a request, a deny rule is a lock. The docs add one limit: a rule matches Claude's tool calls. A Read deny rule covers Claude's own file tools and some shell commands Claude Code recognizes, such as cat, but not a script or program that opens the file itself. That is why, in the test, you say No if Claude asks to read the file another way.

Which mode when

  • Learning, or a folder with things that matter: Manual.
  • A change you will review in one go afterwards: accept edits, then read the diff (lesson 6).
  • A bigger change, or code you do not know: plan first.
  • A longer task you trust, with git to fall back on: auto.
  • Never on your own computer: bypass permissions.

The steps

  1. Create a private file first, before Claude Code starts, so its content never appears in your conversation.
  2. Read the bar and cycle through the modes.
  3. Make one change in Manual mode and add a comment to your answer.
  4. Make one change in accept edits mode and notice there was no prompt.
  5. Block the private file with a deny rule.
  6. Test the rule by asking Claude to read the file.
  7. Write your mode card.

Follow the steps for Claude Code below.

Example: Tilda's mode card

Tilda wrote four lines on a sticky note next to her screen: "Learning or unsure: Manual. Small edits I will review: accept edits. New section: plan first. Never: bypass." Her deny rule for the starter recipe now sits in .claude/settings.json. When she asked Claude to read the file, Claude Code blocked it and Claude told her the file was off limits.

Common mistakes

  • Choosing "Yes, and don't ask again" to stop the prompts without reading what it allows. It saves a standing rule for this project.
  • Writing "never read my recipe" in CLAUDE.md and treating it as a lock. Use a deny rule.
  • Leaving accept edits on and forgetting to review. The edits are made either way; reading them is your job.

Today's actions

Ticks are not saved without an account

Do it in Claude Code

Claude Code

  1. In your terminal, go into your practice folder, make a small private file for a test later on, and start Claude Code. Run one line at a time.
    cd marlow-bakehouse
    echo "Rye starter: feed at 8 and rest for 12 hours" > secret-recipe.txt
    claude
  2. Look at the bar under the prompt box: it shows the current mode, for example auto mode on or manual mode on.
  3. Press Shift+Tab a few times and watch the label change: manual mode on, accept edits on, plan mode on, and back to auto mode on when auto mode is available. Stop at manual mode on.
  4. In Manual mode, ask for a small change. Read the prompt. To practise a comment, move to No, press Tab, type why (such as use the word practice site) and press Enter. Claude reads your reason and tries again; then choose Yes.
    Add a footer to index.html with the line: Marlow Bakehouse, a practice website. Change nothing else.
  5. Press Shift+Tab once to switch to accept edits on, then ask for a second small change. This time Claude edits the file without asking. You will review it in lesson 6.
    Make the footer text a little smaller than the rest of the page.
  6. Type /permissions. The dialog lists your allow, ask and deny rules and lets you add one. Add a deny rule with the text Read(./secret-recipe.txt). If it asks where to save it, choose the project settings, .claude/settings.json.
  7. Test the rule. Claude Code blocks Claude's file tools from reading the file, whatever mode you are in. If Claude asks to run a shell command to read it another way, choose No. If it reads the file that way anyway, you have seen the limit of a Read rule.
    Use your Read tool to open secret-recipe.txt and tell me what it says.
  8. Press Shift+Tab until the bar shows the mode you want to keep working in, then type /exit. Write your mode card.

Note: On some Windows setups the mode key is Alt+M instead of Shift+Tab. Bypass permissions mode does not appear in the cycle unless you started Claude Code with it; do not do that in this course. dontAsk mode is for scripts. The best practices page also shows this rule written by hand in the deny list of .claude/settings.json. A Read deny rule covers Claude's file tools and some recognized shell commands, not every program.

Paid planNeeds a paid Claude plan (Pro, Max, Ultra, Team or Enterprise) or a Claude Console account. The free Claude plan does not include Claude Code.

Checked on 4 December 2026 · Source: Claude Code docs: Choose a permission mode (opens in a new tab)

Create a free account to save your progress. Sign in or sign up