claude-code - 💡(How to fix) Fix [DOCS] Auto mode docs omit `"$defaults"` sentinel for extending built-in rules [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52194Fetched 2026-04-23 07:34:04
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

Error Message

To loosen: remove rules from soft_deny when the defaults block something your pipeline already guards against with PR review, CI, or staging environments, or add to allow when the classifier repeatedly flags a routine pattern the default exceptions don't cover. To tighten: add to soft_deny for risks specific to your environment that the defaults miss, or remove from allow to hold a default exception to the block rules. In all cases, run claude auto-mode defaults to get the full default lists, then copy and edit: never start from an empty list.

Code Example

{
"autoMode": {
"allow": [
"$defaults",
"Deploying to the staging namespace is allowed: staging is isolated from production and resets nightly"
],
"soft_deny": [
"$defaults",
"Never run database migrations outside the migrations CLI"
],
"environment": [
"$defaults",
"Trusted internal domains: *.corp.example.com"
]
}
}
RAW_BUFFERClick to expand / collapse

Documentation Type

Incorrect/outdated documentation

Documentation Location

https://code.claude.com/docs/en/permissions

Section/Topic

"Configure the auto mode classifier" → "Override the block and allow rules"

Current Documentation

The docs currently say on https://code.claude.com/docs/en/permissions:

Two additional fields let you replace the classifier's built-in rule lists: autoMode.soft_deny controls what gets blocked, and autoMode.allow controls which exceptions apply.

To loosen: remove rules from soft_deny when the defaults block something your pipeline already guards against with PR review, CI, or staging environments, or add to allow when the classifier repeatedly flags a routine pattern the default exceptions don't cover. To tighten: add to soft_deny for risks specific to your environment that the defaults miss, or remove from allow to hold a default exception to the block rules. In all cases, run claude auto-mode defaults to get the full default lists, then copy and edit: never start from an empty list.

Setting allow or soft_deny replaces the entire default list for that section. If you set soft_deny with a single entry, every built-in block rule is discarded: force push, data exfiltration, curl | bash, production deploys, and all other default block rules become allowed.

Related pages repeat or depend on the same guidance. For example, https://code.claude.com/docs/en/permission-modes says:

Run claude auto-mode defaults to see the full rule lists. If routine actions get blocked, an administrator can add trusted repos, buckets, and services via the autoMode.environment setting.

What's Wrong or Missing?

Changelog v2.1.118 added support for including "$defaults" inside autoMode.allow, autoMode.soft_deny, and autoMode.environment so custom rules can extend the built-in lists instead of replacing them.

The current docs still describe customization as a full replacement workflow and tell users to copy the entire default lists into their settings. They do not document the new "$defaults" sentinel at all, so the documented behavior is now outdated.

This leaves two gaps:

A. The new merge mechanism is undocumented

There is no explanation that users can write entries like "$defaults" plus their own custom rules.

B. Existing guidance now implies the old behavior is the only safe option

Pages that point readers to claude auto-mode defaults and "copy the full default lists" should explain when that is still useful versus when "$defaults" is the simpler way to keep built-ins intact.

Suggested Improvement

Update the auto mode documentation to describe "$defaults" explicitly for all three arrays: autoMode.environment, autoMode.allow, and autoMode.soft_deny.

Suggested additions:

  1. In https://code.claude.com/docs/en/permissions, add a short rule summary such as: "$defaults" keeps the built-in rules for that section and appends your custom entries.
  2. Replace the current copy-the-entire-list-only guidance with examples that show both patterns:
{
"autoMode": {
"allow": [
"$defaults",
"Deploying to the staging namespace is allowed: staging is isolated from production and resets nightly"
],
"soft_deny": [
"$defaults",
"Never run database migrations outside the migrations CLI"
],
"environment": [
"$defaults",
"Trusted internal domains: *.corp.example.com"
]
}
}
  1. Update linked summary pages (settings, permission-modes, managed-settings docs, and CLI reference) to mention that claude auto-mode defaults prints the built-ins, while "$defaults" lets users keep those built-ins without copying the whole list into settings.

Impact

Medium - Makes feature difficult to understand

Additional Context

Affected Pages:

PageContext
https://code.claude.com/docs/en/permissionsPrimary auto mode classifier documentation; currently says custom allow/soft_deny lists replace defaults
https://code.claude.com/docs/en/permission-modesTells readers to inspect defaults and extend autoMode.environment, but does not mention "$defaults"
https://code.claude.com/docs/en/settingsautoMode config reference lists the three arrays but does not mention the sentinel behavior
https://code.claude.com/docs/en/server-managed-settingsManaged settings example links readers to the auto mode classifier guidance and its current warnings
https://code.claude.com/docs/en/cli-referenceDocuments claude auto-mode defaults, which should cross-reference the new "$defaults" workflow

Total scope: 5 pages affected

Source: Changelog v2.1.118

Exact changelog entry:

Auto mode: include "$defaults" in autoMode.allow, autoMode.soft_deny, or autoMode.environment to add custom rules alongside the built-in list instead of replacing it

extent analysis

TL;DR

Update the auto mode documentation to describe the "$defaults" sentinel for merging custom rules with built-in lists.

Guidance

  1. Review affected pages: Check the 5 affected pages (permissions, permission-modes, settings, server-managed-settings, and cli-reference) for outdated guidance on customizing autoMode settings.
  2. Add "$defaults" documentation: Update the primary auto mode classifier documentation to explain the "$defaults" sentinel and its usage in autoMode.allow, autoMode.soft_deny, and autoMode.environment.
  3. Provide examples: Include examples of using "$defaults" to merge custom rules with built-in lists, such as the suggested JSON configuration snippet.
  4. Cross-reference changes: Ensure that all related pages, including the CLI reference, are updated to reflect the new "$defaults" workflow and its relationship to claude auto-mode defaults.
  5. Verify consistency: Confirm that the updated documentation is consistent across all affected pages to avoid confusion.

Example

{
  "autoMode": {
    "allow": [
      "$defaults",
      "Deploying to the staging namespace is allowed: staging is isolated from production and resets nightly"
    ],
    "soft_deny": [
      "$defaults",
      "Never run database migrations outside the migrations CLI"
    ],
    "environment": [
      "$defaults",
      "Trusted internal domains: *.corp.example.com"
    ]
  }
}

Notes

The suggested improvements should be applied to all affected pages to ensure consistency and clarity in the documentation. The "$defaults" sentinel provides a more convenient way to extend built-in lists without replacing them, and its documentation will help users understand and utilize this feature effectively.

Recommendation

Apply the suggested improvements to update the auto mode documentation and related pages to reflect the new "$defaults" workflow, ensuring that users can effectively customize their autoMode settings without replacing built-in lists.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING