D3 · Claude Code › Cluster 3 · Permissions & Safety

3.1 · Permission Modes

default · acceptEdits · plan · bypassPermissions

CONCEPT A mode is the session-wide baseline for "does Claude ask first?"

A permission mode sets how often Claude Code pauses to ask you before it edits a file, runs a shell command, or makes a network request. The mode is the baseline; you then layer allow / ask / deny rules (3.2) on top of it. The four modes the exam cares about:

ModeRuns without askingBest for
default (labeled Manual)Reads only — prompts on first use of each editing/exec toolGetting started, sensitive work
acceptEditsReads, file edits, and common filesystem Bash (mkdir, touch, rm, mv, cp, sed) inside the working dirIterating on code you review after
planReads and read-only exploration only — never edits sourceExploring a codebase before changing it
bypassPermissionsEverything — skips prompts and safety checksIsolated containers / VMs only
🔑 Two more modes exist — auto (auto-approves with a background safety classifier) and dontAsk (auto-denies anything not pre-allowed). They aren't in the default Shift+Tab cycle. The four above are the core ones to know cold.
⚠️ In every mode except bypassPermissions, writes to protected paths (.git, .claude, .vscode, .bashrc, .npmrc, .mcp.json, …) are never auto-approved — they prompt even in acceptEdits. An allow rule does not override this.

CONCEPT Three ways to set the mode

You choose the mode through the harness, never by asking Claude in chat:

🚫 You cannot enter bypassPermissions by cycling from a normal session. You must start with --permission-mode bypassPermissions or the equivalent --dangerously-skip-permissions. Claude Code refuses this mode when running as root/sudo (unless inside a recognized sandbox).

DIAGRAM How a tool call flows through the mode

flowchart TD A["Claude requests a tool call"] --> M{"Which mode?"} M -->|"plan"| P["🟢 Read/explore auto
🔴 Edits blocked until plan approved"] M -->|"default (Manual)"| D["Reads auto
🟠 Edit/exec → prompt"] M -->|"acceptEdits"| E["Reads + in-scope edits auto
🟠 Other Bash / out-of-scope → prompt"] M -->|"bypassPermissions"| B["🔴 Everything runs
(ask rules + rm -rf / still gate)"] P --> PP{"Protected path write?"} D --> PP E --> PP PP -->|"yes"| PR["🟠 Prompt anyway
(allow rule can't bypass)"] classDef ok fill:#d4edda,stroke:#28a745,color:#155724; classDef gate fill:#ffe8cc,stroke:#ff9f40,color:#9a4a0a; classDef bad fill:#f8d7da,stroke:#dc3545,color:#721c24; class P ok; class D gate; class E gate; class B bad; class PR gate;

CODE Setting the mode three ways

# 1. At startup — start in plan mode to explore before editing
claude --permission-mode plan

# 2. Skip all prompts for an isolated container run (dangerous)
claude --dangerously-skip-permissions   # == --permission-mode bypassPermissions

# 3. Persistent default in .claude/settings.json
{
  "permissions": {
    "defaultMode": "acceptEdits"
  }
}
Mid-session, just tap Shift+Tab — no restart needed to move between default, acceptEdits, and plan.

TRADE-OFFS Oversight vs. flow

✅ Tighter modes (default / plan)

  • You review each edit / command as it happens
  • Plan mode lets Claude research without touching source
  • Safest for unfamiliar or sensitive repos

⚠️ Looser modes (acceptEdits / bypass)

  • Long uninterrupted stretches, fewer prompts
  • But: acceptEdits still gates out-of-scope Bash & protected paths
  • bypassPermissions offers no protection against prompt injection — containers only

EXAM TRAPS

Trap: "acceptEdits auto-runs every Bash command." → No. It auto-approves file edits and a fixed set of filesystem commands (mkdir, touch, rm, mv, cp, sed) for in-scope paths only. Other Bash commands and out-of-scope paths still prompt.
Trap: "You can Shift+Tab into bypassPermissions." → The default cycle is only default → acceptEdits → plan. Bypass must be enabled at launch with --permission-mode bypassPermissions / --dangerously-skip-permissions.
Trap: "Plan mode blocks reads." → Plan mode allows reads and read-only shell exploration; it blocks edits until you approve the plan. Approving switches the session into an editing mode.
Trap: "An allow rule for .claude/** lets edits skip prompts in every mode." → Protected-path writes are checked before allow rules, so they still prompt in default/acceptEdits/plan. Only bypassPermissions lets them through.

PRACTICE

Q1 · A teammate wants Claude to freely edit code but still confirm anything outside the repo. Which mode?

acceptEdits. It auto-approves edits and common filesystem commands for paths inside the working directory (and additionalDirectories), while out-of-scope paths, other Bash commands, and protected paths still prompt.

Q2 · What are the three ways to set a permission mode, and which one cannot reach bypassPermissions?

Shift+Tab cycling mid-session, the --permission-mode startup flag, and permissions.defaultMode in settings. The Shift+Tab cycle cannot reach bypassPermissions — you must start with the enabling flag.

Q3 · In plan mode, Claude proposes edits. Why don't they apply immediately?

Plan mode blocks source edits by design — Claude only reads and explores. Edits stay blocked until you approve the plan, which exits plan mode and switches the session to an editing mode.