Configure auto mode changedauto-mode-config
Nearest release: v2.1.327, published an hour after upstream edited the page. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Upstream edited this page at 17 Nov 2026 19:05 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 17 Nov 2026 19:07 UTC.
Upstream edited
Recorded here
Lines+15added
Lines−18removed
From line
1
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits38to this page, all time
The whole hunk
from line 1, old and new numbered
/
from line 1
11# Configure auto mode
22
3> Tell the auto mode classifier which repos, buckets, and domains your organization trusts. Set environment context, override the default block and allow rules, and inspect your effective config with the auto-mode CLI subcommands.
3> Tell the auto mode classifier which repos, buckets, and domains your organization trusts, set your own block and allow rules, and inspect your config.
44
55[Auto mode](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) lets Claude Code run without routine permission prompts by routing tool calls through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Deny and explicit ask rules are evaluated before the classifier and still block or prompt. Use the `autoMode` settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations.
66
from line 115
115115}
116116```
117117
118After you save your settings, run `claude auto-mode config` to [confirm the effective rules](#inspect-the-defaults-and-your-effective-config) include your entries.
118After you save your settings, run `claude auto-mode config` to [confirm the rules](#inspect-the-defaults-and-your-effective-config) include your entries.
119119
120120Entries are prose, not regex or tool patterns. The classifier reads them as natural-language rules. Write them the way you would describe your infrastructure to a new engineer. A thorough environment section covers:
121121
from line 180
180180* Claude Code includes `"$defaults"` in each of the `allow`, `soft_deny`, and `hard_deny` lists the draft adds entries to, unless you already wrote an `allow` list without it, so the [built-in rules](#override-the-block-and-allow-rules) you haven't replaced stay in effect
181181* After saving, Claude Code offers to remove `permissions.allow` rules in `~/.claude/settings.json` that auto mode ignores, such as `Bash(*)`, or that auto-approve destructive commands
182182
183Then run `claude auto-mode config` to [see the effective result](#inspect-the-defaults-and-your-effective-config).
183Then run `claude auto-mode config` to [see the result](#inspect-the-defaults-and-your-effective-config).
184184
185185### Turn off `/auto-mode-setup`
186186
from line 210
210210
211211## Override the block and allow rules
212212
213Three additional fields let you replace the classifier's built-in rule lists:
213To add to the classifier's built-in rules, set any of three additional fields and include the literal string `"$defaults"` in its list:
214214
215215* `autoMode.hard_deny`: actions to block even when the user asks for them
216216* `autoMode.soft_deny`: destructive actions that user intent can clear
from line 229
229229* `allow` rules then override matching `soft_deny` rules as exceptions.
230230* Explicit user intent overrides the remaining soft blocks: if the user's message directly and specifically describes the exact action Claude is about to take, the classifier allows it even when a `soft_deny` rule matches.
231231
232General requests don't count as explicit intent. Asking Claude to "clean up the repo" doesn't authorize force-pushing, but asking Claude to "force-push this branch" does.
232 General requests don't count as explicit intent. Asking Claude to "clean up the repo" doesn't authorize force-pushing, but asking Claude to "force-push this branch" does.
233233
234234To loosen, add to `allow` when the classifier repeatedly flags a routine pattern the default exceptions don't cover. To tighten, add to `soft_deny` for destructive risks specific to your environment that the defaults miss, or to `hard_deny` for actions to block even when the user asks for them.
235235
236To keep the built-in rules while adding your own, include the literal string `"$defaults"` in the array. The default rules are spliced in at that position, so your custom rules can go before or after them, and you continue to inherit updates as the built-in list changes across releases.
237
238236The following example keeps the defaults in all four lists and adds organization-specific rules to each.
239237
240238```json theme={null}
from line 262
264262
265263> [!CAUTION]
266264>
267> Setting any of `environment`, `allow`, `soft_deny`, or `hard_deny` without `"$defaults"` replaces the entire default list for that section. If you set an array without `"$defaults"`, you discard the built-in rules for that section:
268>
269> * `soft_deny`: every built-in soft block rule, including force push, `curl | bash`, production deploys, and auto-mode bypass
270> * `hard_deny`: the built-in data exfiltration rule
265> Include `"$defaults"` in every list you set, so you don't lose any [built-in rules](#inspect-the-defaults-and-your-effective-config) it holds.
271266
272267Each section is evaluated independently, so setting `environment` alone leaves the default `allow`, `soft_deny`, and `hard_deny` lists intact.
273268
274Only omit `"$defaults"` when you intend to take full ownership of the list. To do that safely, run `claude auto-mode defaults` to print the built-in rules, copy them into your settings file, then review each rule against your own pipeline and risk tolerance.
275
276269## Edit rules from `/permissions`
277270
278271To view and edit classifier rules and `environment` entries without opening a settings file, run [`/permissions`](https://code.claude.com/docs/en/permissions#manage-permissions) in the CLI and select the **Auto mode** tab. The tab requires Claude Code v2.1.246 or later, and it appears only when [auto mode is available](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode) to your session.
from line 296
303296
304297The `claude auto-mode` subcommands help you inspect, validate, and reset your configuration.
305298
306Print the built-in `environment`, `allow`, `soft_deny`, and `hard_deny` rules as JSON:
299Print the `environment`, `allow`, `soft_deny`, and `hard_deny` rules built into Claude Code:
307300
308301```bash theme={null}
309302claude auto-mode defaults
from line 304
311304
312305To read one rule's full wording without piping through `jq`, pass `--label` with the start of the rule's label, such as `claude auto-mode defaults --label 'Git Destructive'`. Matching is a case-insensitive prefix on each rule's label, and sections with no match print as empty lists.
313306
314Print what the classifier actually uses as JSON, with your settings applied where set and defaults otherwise:
307> [!NOTE]
308>
309> While `/status` in auto mode shows [`Auto mode server`](https://code.claude.com/docs/en/permission-modes#server-side-classifier-review) as `Enabled`, the server's built-in rules can differ from this output, and no `claude auto-mode` subcommand prints them.
315310
311Print the four lists, with your settings applied where set and defaults otherwise:
312
316313```bash theme={null}
317314claude auto-mode config
318315```
from line 395
398395
399396* **Recently blocked tab**: highlight the action's row. In [screen reader mode](https://code.claude.com/docs/en/accessibility.md), every command and input appears before the list.
400397* **Hook**: to capture the exact input of denials programmatically, add a [`PermissionDenied` hook](https://code.claude.com/docs/en/hooks#permissiondenied), which receives it as `tool_input`. If your hook reads `reason`, expect no `Auto mode:` prefix, and text such as `Blocked by classifier` instead of `No reason provided`.
401* **Conversation**: find the tool call. If the call appears shortened or folded into a summary line such as `Ran 3 shell commands`, press `Ctrl+O` to open the [transcript viewer](https://code.claude.com/docs/en/interactive-mode.md#transcript-viewer), which expands it.
398* **Conversation**: find the tool call. If the call appears shortened or folded into a summary line, press `Ctrl+O` to open the [transcript viewer](https://code.claude.com/docs/en/interactive-mode.md#transcript-viewer).
402399
403400The text beneath the call tells you whether there is anything to fix. A dim `Not run · auto mode's check had no usable answer` row, or text that reports a problem with the classifier itself, such as `Auto mode could not evaluate this action`, means Claude Code blocked the call without a verdict from the classifier. For a `Not run` row, press `Ctrl+O` to read the full message, then see [Auto mode cannot determine the safety of an action](https://code.claude.com/docs/en/errors.md#auto-mode-cannot-determine-the-safety-of-an-action) or [The server returned no safety verdict](https://code.claude.com/docs/en/errors.md#the-server-returned-no-safety-verdict) for what to do.
404401
from line 402
405402Otherwise, a `Blocked by auto mode` line means the classifier judged the call unsafe. To let the call through, take the step that matches what Claude was trying to reach or do:
406403
407404* A destination Claude needs throughout the task, such as a package registry, an internal domain, or a repository host: add it to `autoMode.environment`.
408* A command you want to run without review from now on: add an `allow` rule.
405* A command you want allowed from now on: add an `allow` rule.
409406* A one-off action you did intend: state that intent in your next message and let Claude retry.
410407
411408You can add the environment entry or `allow` rule from the `/permissions` dialog's [**Auto mode** tab](#edit-rules-from-permissions).
412409
413The text in square brackets, such as `[Data Exfiltration]`, is the name of the rule the classifier matched. To read that rule's full wording, see [Inspect the defaults and your effective config](#inspect-the-defaults-and-your-effective-config).
410The text in square brackets names what the classifier matched. If it's a rule built into Claude Code, pass its name without the brackets to [`claude auto-mode defaults --label`](#inspect-the-defaults-and-your-effective-config) to read the full wording.
414411
415412### Fix repeated denials
416413
No line in this hunk matches that.