CLAUDE CODE

Why does Claude Code keep asking for permission?

Why Claude Code keeps asking for permission even after you approve, and the fixes from safest to riskiest, from allow rules to permission modes.

Short answer

Claude Code keeps asking because, in Manual mode, every shell command, file edit and web fetch outside its read-only set needs approval, and some approvals are not saved or are overridden by ask and deny rules. Fix it from safest to riskiest, with narrow allow rules, acceptEdits mode, the sandbox, auto mode, and only in an isolated container, bypass mode.

Claude Code keeps asking for permission because, in its Manual mode, every shell command, file edit and web request that is not on a built-in read-only list needs your approval. Some approvals also do not stick: file edit approvals end with the session, and a saved allow rule never outranks an ask or deny rule. The fix is to remove the routine prompts with narrow rules or a looser mode, starting with the safest option.

This guide lists the causes first, then the fixes in order from safest to riskiest. For the full system, see the complete guide to Claude Code permissions.

Why does Claude Code ask so often?

Claude Code asks so often because its default is fail-closed: in Manual mode, unmatched commands require approval. Only file reads inside your working directories and a fixed set of read-only commands, such as ls, cat, grep and git status, run without a prompt. Tests, builds, installs, commits and edits all ask until you allow them.

On current versions, interactive terminal sessions start in auto mode when it is available, which asks far less. If you see a prompt for every command, check the status bar: you are probably in Manual mode, either by choice, because auto mode is not available for your setup, or because a setting or flag selects it.

Why does it ask again after "Yes, and don't ask again"?

Claude Code asks again after "don't ask again" for a handful of specific reasons. Go through them in this order:

  1. It was a file edit. Edit approvals last only until the session ends and are not saved to a file. Use acceptEdits mode or an Edit allow rule if you want them to persist.
  2. An ask or deny rule also matches. "Don't ask again" saves an allow rule to .claude/settings.local.json. Claude Code evaluates deny, then ask, then allow, so an ask rule from a project or managed file still prompts. The settings docs call this out directly.
  3. The command is compound. npm test && npm run build needs every part allowed. A rule for npm test alone does not approve the chain.
  4. The command changed shape. Bash(npm test) is an exact match, so npm test -- --watch is a different command. A trailing * is needed to cover extra arguments.
  5. It uses an exec wrapper or a risky find. Prefix rules cannot approve commands starting with watch, setsid, ionice or flock, or find with -exec or -delete. Those prompts offer only a one-time approval.
  6. Claude Code cannot parse the command. Commands it cannot fully analyze, or longer than 10,000 characters, always prompt.
  7. The rule is in a committed file you have not trusted. Allow rules in .claude/settings.json wait for the workspace trust dialog.
  8. You started in a different repository or outside git. Saved rules apply per repository, keyed on the git root.

Running /permissions shows every rule and the file it came from, and /status shows which settings files loaded. Those two commands answer most of these questions in a minute.

Fix 1: allow your routine commands (safest)

The safest way to stop Claude Code asking is a narrow allowlist for commands that are local and easy to undo, such as tests, linting and git history. Add them to permissions.allow in .claude/settings.json (shared) or .claude/settings.local.json (personal):

{
  "permissions": {
    "allow": [
      "Bash(npm test *)",
      "Bash(npm run lint *)",
      "Bash(npm run build)",
      "Bash(git diff *)",
      "Bash(git log *)",
      "Bash(git add *)",
      "Bash(git commit *)"
    ]
  }
}

Put the * after the subcommand, and never allow Bash, Bash(git *), Bash(rm *) or Bash(curl *). The guide to allowing specific commands has a full starter list and the patterns to avoid. A quick way to build it is to note the commands you approved in your last few sessions.

Fix 2: use acceptEdits mode for edit-heavy work

If most of your prompts are file edits, switch Claude Code to acceptEdits mode. It approves file creation and edits in your working directory, plus basic filesystem commands such as mkdir, touch, mv and cp, while other shell commands still ask.

Press Shift+Tab until the status bar shows accept edits, or start with:

claude --permission-mode acceptEdits

Writes to protected paths such as .git, .claude and shell profile files still prompt. Review the result with git diff before you commit. More detail in Claude Code permission modes explained.

Fix 3: turn on the sandbox with auto-allow

The Claude Code sandbox runs shell commands inside an OS-level boundary, Seatbelt on macOS and bubblewrap on Linux and WSL2, with restricted writes and a network allowlist. In its auto-allow mode, commands that stay inside the sandbox run without a prompt.

Run /sandbox in a session, or enable it in settings:

{
  "sandbox": {
    "enabled": true
  }
}

The network allowlist starts empty, so add the domains your tools need. Content-scoped ask rules like Bash(git push *) still prompt. The sandbox covers shell commands, not hooks, MCP servers or file tools, and reads are allowed across most of the machine by default, so restrict sensitive paths. See what an agent sandbox is.

Fix 4: use auto mode

Auto mode removes routine prompts and has a separate classifier model review actions before they run. It blocks things like curl | bash, force pushes and production deploys by default, and your own ask and deny rules still apply.

Start it with claude --permission-mode auto or select it with Shift+Tab. If the classifier blocks actions 3 times in a row or 20 times in total, auto mode pauses and prompts come back. It depends on your plan, provider and model, so check the official docs if it is not available. The docs say plainly that it reduces prompts but does not guarantee safety.

Fix 5: bypass mode, only in a container (riskiest)

claude --dangerously-skip-permissions starts bypassPermissions mode, which skips prompts almost entirely, including for writes to .git and .claude. The official docs say to use it only in isolated environments like containers or VMs.

On your own machine, this removes your last chance to catch a prompt injection or a destructive command before it runs. If you need unattended runs, use a dev container with a non-root user, restricted network egress and no host secrets mounted. The dangerously skip permissions guide explains the risks and what still applies.

FixPrompts removedRisk
Narrow allowlistRoutine commands you listLow
acceptEdits modeFile edits and basic filesystem commandsLow to medium
Sandbox with auto-allowShell commands inside the boundaryMedium, depends on configuration
Auto modeMost routine actions, classifier-reviewedMedium
Bypass modeNearly allHigh outside a container

What about scripts and CI?

In a claude -p run nobody can answer a prompt, so Claude Code denies calls that would prompt unless something approves them. For scripts and CI, use dontAsk mode with explicit allow rules, so the run fails closed instead of hanging:

claude -p "run the test suite" --permission-mode dontAsk --allowedTools "Bash(npm test)" "Read"

For interactive sessions you want to keep going while you step away, permissions.denyInsteadOfPrompting set to true in your user settings denies calls that would wait on a prompt, so the session continues instead of stopping.

When the problem is noticing the prompt

Sometimes the number of prompts is fine and the real problem is that you miss them. Claude Code waits in a terminal tab behind your editor, and the task sits idle until you look. A notification is often a better fix than a looser mode; see Claude Code notifications on Mac.

Allowbar is a Mac menu bar app for that situation, for Claude Code and Codex. Through the agents' own hooks, it shows each permission request in a panel that slides down from the top of the screen, with the project, the tool and the exact command, and you click Allow, Block or Terminal. Allowbar never approves anything on its own and adds no rules that approve for you. If the countdown runs out or the app is closed, the question goes back to the terminal, and commands your allow rules already cover never show up.

Allowbar runs on macOS 14 or later and is in private beta. Join the waitlist; the launch price is $9.99 instead of $29.90.

Sources:

Frequently asked questions

How do I stop Claude Code from asking permission for every command?

Add allow rules for your routine commands to permissions.allow in settings.json, such as Bash(npm test *). For edit-heavy work, switch to acceptEdits mode with Shift+Tab. Avoid bypass mode outside a container.

Why does Claude Code ask again after I chose "don't ask again"?

Either it was a file edit (those approvals last only for the session), an ask or deny rule in another settings file matches the same command, or the new command is compound or has different arguments. Run /permissions to see which rules apply.

Does Claude Code remember permissions between sessions?

For Bash commands and WebFetch domains, yes. "Yes, and don't ask again" saves an allow rule to .claude/settings.local.json at the repository root. File edit approvals are not remembered after the session ends.

Is there a setting to never ask for permission?

bypassPermissions mode, started with --dangerously-skip-permissions, skips nearly all prompts, but the docs recommend it only in containers or VMs. For unattended scripts, dontAsk mode with explicit allow rules is the safer choice.

Why does Claude Code ask before git commands in another folder?

A cd into a different directory combined with git prompts even though both are read-only, because running git in a new directory can execute that directory's git hooks.

ALLOWBAR FOR MAC

Answer your agents from the menu bar.

Permission requests from Claude Code and Codex slide down from the top of your screen. Allow, Block or send back to the terminal. Allowbar never approves anything on its own.

Launch price $9.99 instead of $29.90, one-time purchase, lifetime license.