Claude Code “Denied by Auto Mode”: Why a Command Was Blocked

Claude Code “Denied by Auto Mode”: Why a Command Was Blocked

Seeing Claude Code denied by auto mode means a second model, called the classifier, reviewed a command before it ran and judged it too risky. It is not a crash or a login problem. Claude Code shows a short notice such as bash blocked by auto mode · /permissions · Auto mode: [Data Exfiltration], and the name in square brackets tells you which rule the command matched.

The quick fix: run /permissions, open the Recently blocked tab, read the exact command, and press r if you really meant it. For a one-off action, you can also tell Claude to do it and name the target, like “run git reset –hard in this folder”. For a command you run every day, add a narrow allow rule such as Bash(npm test) or a plain-sentence autoMode.allow entry in ~/.claude/settings.json.

If the classifier keeps refusing, or the rule is a hard deny, leave auto mode with Shift+Tab and approve the normal permission prompt yourself. If the line under the command says “Not run” or “could not evaluate”, nothing was judged unsafe at all: the check simply failed, and a retry usually works.

Browse all our Claude Code tutorials for more fixes and how-tos.

Tested with Claude Code v2.1.332 on macOS on November 30, 2026. We used a throwaway folder called build-notes and started Claude Code with project and local settings only, so our real setup stayed untouched. We did not trigger a real block on purpose, because the commands that cause one are risky by design; the blocking behavior comes from Anthropic’s official docs, and the screens below are real captures of the tools you use to fix it.

Quick Summary

What you seeWhat it meansWhat to do
Blocked by auto mode with a [Rule name]The classifier judged the command unsafeCheck it in /permissions, then approve, allow or skip
Same command blocked again after you approved itApproval covers one retry, not future runsAdd an allow rule for routine commands
Prompts suddenly come back3 blocks in a row or 20 in a sessionApprove the prompt; auto mode resumes
Not run · auto mode's check had no usable answerThe classifier gave no verdictWait a few seconds and retry
Auto mode could not evaluate this actionThe classifier’s reply didn’t parse, or a separate safety check refused itRetry; run claude --debug if it repeats
Push to your company’s Git host blockedOnly the starting repo and its remotes are trustedAdd the host to autoMode.environment
Your Bash(*) rule stopped workingBroad allow rules are dropped in auto modeUse narrow rules like Bash(npm test)

Why Claude Code Denied a Command in Auto Mode

Auto mode lets Claude work without routine permission prompts. Instead of asking you, Claude Code sends risky actions to a classifier model, which blocks the ones that go beyond your request, target infrastructure it doesn’t recognize, or seem to follow hostile content Claude read. The permission modes docs describe this as a second gate, not a guarantee of safety.

Not every action reaches the classifier. Your own allow, ask and deny rules are checked first, and reads or file edits inside your working directory are approved without a review. Everything else, like most shell commands, web requests and pushes, goes to the classifier.

The classifier trusts your working folder and the Git remotes that existed when the session started. Everything else counts as external until you tell it otherwise, which is why a push to a new remote or a write to a company bucket can be blocked even though it feels routine to you.

Diagram of how Claude Code auto mode checks one action, from permission rules to the classifier verdict and the pause after repeated blocks
How auto mode decides: your rules first, then safe local work, then the classifier.

What the classifier blocks by default

The docs list dozens of default block categories. These are the ones everyday users hit most often:

  • Downloading and running code, like curl | bash
  • Sending sensitive data to outside endpoints, or printing a live token into the transcript
  • Force pushes, and Git commands that would throw away uncommitted work, such as git reset --hard, git checkout -- . or git clean -fd
  • git commit --amend on a commit that Claude didn’t create in this session
  • Irreversibly deleting files that existed before the session
  • A recursive forced delete like rm -rf "$VAR" when the variable was never set where the classifier can see it
  • Production deploys, migrations, terraform destroy and similar infrastructure changes
  • Commands with a flag that turns off a safety guard, like --insecure

Plenty is allowed by default too: local file work in your folder, installing dependencies already in your lock files, read-only HTTP requests, and pushing to the repository you’re working in.

Claude Code docs showing the four tiers of classifier precedence: hard_deny, soft_deny, allow and explicit user intent
The official precedence order: hard blocks can’t be cleared, soft blocks can.

Soft blocks versus hard blocks

Rules come in two strengths. A soft deny rule blocks an action unless an allow exception covers it or your message directly and specifically describes that exact action. A hard deny rule blocks no matter what you say.

The docs give a simple example: asking Claude to “clean up the repo” does not authorize a force push, but asking it to “force-push this branch” does. Vague requests don’t count; specific ones do.

A block is the classifier saying “you didn’t clearly ask for this”, not “this is never allowed”.

Step 1: Find Out What Was Blocked

Start by reading the exact command, not Claude’s description of it. Run /permissions and move to the Recently blocked tab with the arrow keys. Each blocked action gets a row there, and the full command shows below the list when you highlight it.

Claude Code /permissions dialog with the Recently blocked tab selected and the message that commands auto mode blocks will appear here
The Recently blocked tab in our clean demo session, ready to collect blocked commands.

Our demo session had no blocks yet, so the tab reads “No recent blocks. Commands auto mode blocks will appear here.” In a real session, you’d see one row per blocked action.

You can also find the call in the conversation. If it’s folded into a summary line, press Ctrl+O to open the transcript viewer and read the text under the tool call.

Read the rule name in the brackets

The name in square brackets is the rule the classifier matched. If it’s a built-in rule, you can print its full wording from your shell. We ran this for one of the Git rules:

claude auto-mode defaults --label 'Git Destructive'
Terminal output of claude auto-mode defaults with the Git Destructive rule wording printed in full
The full text of a built-in rule, printed with the –label option.

The --label match is a case-insensitive prefix, so the start of the name is enough. Reading the rule tells you exactly what the classifier needs to see before it lets the action through; for Git Destructive, it wants the operation and its target named.

Some names are broad policies instead, such as [Destructive or Unwanted Actions] or [Sensitive Information Leakage]. Those come from server-side review, and claude auto-mode defaults doesn’t list their wording, so read the blocked command itself.

Step 2: Pick the Right Fix

Every fix depends on one question: do you want this action once, every time, or never? The official auto mode docs map each answer to a different step.

Claude Code docs listing three ways to fix a denial: add a destination to autoMode.environment, add an allow rule, or state intent and retry
The docs’ three fixes for a Blocked by auto mode line.
Decision diagram for fixing a Claude Code auto mode block: retry, state the target, add an allow rule, add an environment entry, or leave auto mode
Match what you see to the right fix.

Fix 1: Approve a one-off action

If the blocked command is something you really meant, approve it from the Recently blocked tab:

  1. Run /permissions and open Recently blocked.
  2. Highlight the row and read the command below the list.
  3. Press r to approve it and let Claude retry.
  4. Press Esc to close the dialog. If Claude was busy, send a message when it finishes so it retries.

Two catches are worth knowing. Approving doesn’t create a permission rule, and the retried action goes through the check again, so it can still be blocked. In the desktop app, /permissions has no Recently blocked tab, so you approve by naming the action in your next message instead.

Fix 2: Say exactly what you want

Your own words count as approval when they’re specific. Name the action and the thing that makes it risky, like the branch for a force push or the file for an overwrite. “You can force-push” may not be enough; “force-push the feature-login branch” usually is.

An approval like this covers that one action. The next similar action is checked again unless you made the approval standing, and some blocks, the hard denies, stay in place whatever you say.

Fix 3: Allow a routine command with a permission rule

For something safe you run all the time, a normal permission rule is the cleanest fix. Narrow rules like Bash(npm test) stay active in auto mode and are resolved before the classifier ever sees the command. Add them in .claude/settings.json or your user settings:

{
  "permissions": {
    "allow": [
      "Bash(npm test)",
      "Bash(npm run build)"
    ]
  }
}

Broad rules don’t survive. On entering auto mode, Claude Code drops rules that grant arbitrary code execution, such as Bash(*), wildcarded interpreters like Bash(python*), and package-manager run commands. It restores them when you leave auto mode.

Claude Code /permissions Allow tab in auto mode with the note that rules off in auto mode aren't listed
In auto mode, the Allow tab hides the broad rules that are switched off.

Our auto mode session showed this directly: the Allow tab reads “Rules off in auto mode aren’t listed.” If a rule you wrote seems to be ignored, this is the first place to look. Our guide to permission rules covers the syntax in depth.

Fix 4: Teach the classifier with autoMode.allow

Auto mode has its own rule lists, written as plain sentences rather than patterns. Use autoMode.allow for routine actions the classifier keeps flagging, and always keep "$defaults" in the list so you don’t lose the built-in rules:

{
  "autoMode": {
    "allow": [
      "$defaults",
      "Deleting files inside the dist/ folder is allowed: it is rebuilt by npm run build"
    ]
  }
}

Put this in ~/.claude/settings.json. The classifier doesn’t read autoMode from project files like .claude/settings.json or .claude/settings.local.json, so a checked-in repo can’t sneak in its own allow rules. You can also add entries without editing files from the Auto mode tab in /permissions.

Claude Code /permissions Auto mode tab showing built-in Soft allow 16, Soft deny 72 and Hard deny 1 rule sets plus the Environment document
The Auto mode tab lists the built-in rule sets and saves new rules to your user settings.

Fix 5: Trust a host or repo with autoMode.environment

If blocks keep hitting the same destination, such as your company’s Git host, an internal package registry or a team bucket, the classifier is missing context. Describe that infrastructure in autoMode.environment:

{
  "autoMode": {
    "environment": [
      "$defaults",
      "Source control: github.example.com/acme-corp and all repos under it"
    ]
  }
}

The docs also offer /auto-mode-setup, which drafts environment entries for you to review. After any change, run claude auto-mode config to confirm your entries took effect, then ask Claude to retry.

Fix 6: Leave auto mode and run it yourself

When a block won’t clear, or you simply want to review the step, press Shift+Tab to switch out of auto mode. From auto, the first press goes to Manual mode, where Claude Code asks you before running the command. Approve the prompt, then switch back.

Our permission modes guide explains each mode in the cycle.

Inspect Auto Mode’s Rules From Your Terminal

The claude auto-mode command lets you see what the classifier works from. It has four useful subcommands: defaults, config, critique and reset.

Terminal output of claude auto-mode --help listing the config, critique, defaults and reset subcommands
The auto-mode subcommands in Claude Code v2.1.332.

We counted the built-in rules with a quick jq call:

claude auto-mode defaults | jq 'map_values(length)'
claude auto-mode defaults | jq -r '.hard_deny[] | split(":")[0]'
Terminal output showing 16 allow, 72 soft_deny, 1 hard_deny and 21 environment default rules, with Data Exfiltration as the only hard deny
Our count on v2.1.332: 72 soft deny rules and a single hard deny.

On our version, the defaults held 16 allow rules, 72 soft deny rules, 1 hard deny rule and 21 environment entries. The only hard deny was Data Exfiltration, so nearly every block you meet is a soft one that a specific request or an allow rule can clear. These counts may change in later versions.

Two more commands help. claude auto-mode critique reviews your custom rules and flags vague or risky ones, and claude auto-mode reset removes your autoMode section from user settings after asking for confirmation.

When Auto Mode Gives No Verdict

Some denials aren’t judgments at all. If the line under a tool call reads Not run · auto mode's check had no usable answer, the classifier model was unavailable, rate-limited, overloaded or timed out. The docs say to retry after a few seconds; Claude often retries by itself.

The message Auto mode could not evaluate this action and is blocking it for safety means the classifier’s reply didn’t parse, or a separate safety check refused the classifier request because of earlier conversation content. Retry first, and run claude --debug if it keeps happening. The error reference lists each variant, and our roundup of common Claude Code errors covers related messages.

Claude Code docs describing what happens when auto mode falls back: blocked actions, repeated blocks, no verdict from the classifier or server, and a mode switch during a check
The docs’ fallback cases, including the 3-in-a-row and 20-total pause.

Why prompts suddenly come back

If the classifier blocks 3 actions in a row or 20 in total, auto mode pauses and Claude Code starts asking you again. Approving the prompted action turns auto mode back on. These thresholds can’t be changed, and the docs suggest using /feedback to report false positives.

Real Examples of Auto Mode Blocks

RequestLikely resultBetter approach
“Clean up the repo”A git clean -fd or force push is blockedName the exact command and folder
“Install the tool from their site”curl | bash is blockedRun the installer yourself after reading it
“Push to our internal Git server”Blocked as an untrusted destinationAdd the host to autoMode.environment
“Fix the last commit message”--amend on your older commit is blockedSay “amend the last commit message to …”
“Run the tests”Usually fine; faster with Bash(npm test)Add a narrow allow rule

If you’d rather never see a command run, even when you ask, a deny rule is the firmer choice. Our post on broken deny rules explains how to write one that actually matches.

Try It Yourself

Practice in a throwaway folder, never a real project. Start Claude Code in auto mode, then paste this prompt to see how it handles a cleanup request without a named target:

Create a folder called dist with two small text files in it.
Then tell me which command you would use to delete dist,
and explain whether auto mode would review that command.

Afterward, run /permissions and check the Recently blocked and Auto mode tabs. If anything was blocked, read the command, then try the fix that matches: approve with r, name the target in a message, or add an allow sentence.

Common Mistakes

  • Approving from the row description instead of reading the actual command below the list.
  • Expecting one approval to cover every future run of the same command.
  • Putting an autoMode block in .claude/settings.json, where the classifier ignores it.
  • Leaving out "$defaults" when you set an auto mode list, which drops the built-in rules.
  • Relying on Bash(*) or Bash(python*), which are dropped in auto mode.
  • Treating a “Not run” row as a real block and rewriting settings when a retry would do.
  • Telling Claude “don’t push” in chat and expecting it to last forever; compaction can remove that message, so use a deny rule for firm limits.

Pro Tips

  • Use claude auto-mode defaults --label with the bracketed name to see exactly what the classifier wants named.
  • Add a PermissionDenied hook to log every blocked command with its full input; see our hooks guide for the setup basics.
  • Put project conventions like “never force push” in CLAUDE.md; the classifier reads the same file Claude does.
  • For pushes you want to approve by hand, add permissions.ask rules like Bash(git push *) and keep auto mode on for everything else.
  • If auto mode isn’t in your cycle at all, that’s a different problem: see our missing auto mode fix.

Cheat Sheet

Cheat sheet for Claude Code denied by auto mode: commands to see blocks, read rules, allow commands and key limits
Keep this handy when auto mode blocks a command.

Frequently Asked Questions

What does “blocked by auto mode” mean in Claude Code?

The auto mode classifier reviewed a command and judged it risky, so it didn’t run. The bracketed name in the notice is the rule it matched, and the command is listed under Recently blocked in /permissions.

How do I allow a command that auto mode keeps blocking?

Add a narrow permission rule like Bash(npm test), or a plain-sentence autoMode.allow entry in ~/.claude/settings.json. Approving once in /permissions only covers that single retry.

Can I turn off the classifier for one command?

Not inside auto mode. Press Shift+Tab to switch to Manual mode, approve the prompt for that command, then switch back.

Why did my Bash(*) rule stop working in auto mode?

Claude Code drops broad allow rules that allow any code, such as Bash(*) and wildcarded interpreters, while auto mode is on. They come back when you leave auto mode.

Is “Not run · auto mode’s check had no usable answer” a block?

No. It means the classifier couldn’t give a verdict, often because it was busy or timed out. Retry after a few seconds; you don’t need to change any settings.

Conclusion

When Claude Code is denied by auto mode, the classifier is asking for clarity, not refusing forever. Read the real command in the Recently blocked tab, check the bracketed rule with claude auto-mode defaults --label, and then pick the matching fix: approve once with r, name the exact action in your message, add a narrow allow rule or an autoMode.allow sentence for routine work, or trust your own infrastructure with autoMode.environment. On our v2.1.332 setup, 72 of the 73 built-in block rules were soft, so a clear request clears most blocks, and for the rest you can always switch to Manual mode and approve the step yourself. For more on the models behind Claude Code, see our Claude AI overview.

Newsletter

New AI tools in your inbox

The best new tools and the AI news that matters, in one short email. Unsubscribe any time.

Free · No spam · Unsubscribe any time

✓ Looks like you’re subscribed

Loading Google’s sign-up form…

Looks like you’re already subscribed

Thanks for reading! New AI tools and the AI news that matters will land in your inbox.

Not subscribed yet? Refresh the page to load the sign-up form.

The sign-up form couldn’t load. If you use an ad or content blocker, allow news.google.com and reload the page.

Free instant check before you pay. Takes a few seconds.

Scroll to Top