claude-code - 💡(How to fix) Fix Improve error message when ENV_SCRUB conflicts with --dangerously-skip-permissions [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#46260Fetched 2026-04-11 06:25:00
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×3
  • Claude Code version: 2.1.100
  • This worked in previous versions because the conflict wasn't checked
  • The setting was in settings.jsonenv block
  • Took debugging to figure out what was actually wrong

Error Message

When CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1 is set in ~/.claude/settings.json and you run claude --dangerously-skip-permissions, the error message is: UX improvement — the underlying behavior (blocking conflicting modes) is correct, just the error message needs to be more user-friendly.

Root Cause

This is confusing because:

  1. The term "allowed_non_write_users hardening" is internal jargon — users don't know what it means
  2. "Declare allowedTools explicitly" is vague — where? how?
  3. It's not clear that these two settings conflict with each other

Code Example

Permission mode forced to defaultCLAUDE_CODE_SUBPROCESS_ENV_SCRUB is set (allowed_non_write_users hardening). Declare allowedTools explicitly, or set CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=0 to opt out.

---

--dangerously-skip-permissions cannot be used while CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1 is set (they conflict: one grants full access, the other restricts subprocess credentials).

To fix, either:
Set CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=0 in ~/.claude/settings.json
Or run: CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=0 claude --dangerously-skip-permissions
RAW_BUFFERClick to expand / collapse

Problem

When CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1 is set in ~/.claude/settings.json and you run claude --dangerously-skip-permissions, the error message is:

⚠ Permission mode forced to default — CLAUDE_CODE_SUBPROCESS_ENV_SCRUB is set (allowed_non_write_users hardening). Declare allowedTools explicitly, or set CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=0 to opt out.

This is confusing because:

  1. The term "allowed_non_write_users hardening" is internal jargon — users don't know what it means
  2. "Declare allowedTools explicitly" is vague — where? how?
  3. It's not clear that these two settings conflict with each other

Expected behavior

A clear, actionable message like:

⚠ --dangerously-skip-permissions cannot be used while CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1 is set (they conflict: one grants full access, the other restricts subprocess credentials).

To fix, either:
  • Set CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=0 in ~/.claude/settings.json
  • Or run: CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=0 claude --dangerously-skip-permissions

Context

  • Claude Code version: 2.1.100
  • This worked in previous versions because the conflict wasn't checked
  • The setting was in settings.jsonenv block
  • Took debugging to figure out what was actually wrong

Classification

UX improvement — the underlying behavior (blocking conflicting modes) is correct, just the error message needs to be more user-friendly.

extent analysis

TL;DR

To resolve the issue, update the error message to clearly indicate the conflict between CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1 and --dangerously-skip-permissions, and provide actionable steps to fix the conflict.

Guidance

  • Review the current error message and identify areas for improvement to make it more user-friendly and clear.
  • Consider adding explicit instructions on how to resolve the conflict, such as setting CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=0 or removing the --dangerously-skip-permissions flag.
  • Ensure that the error message accurately reflects the underlying behavior and the reason for the conflict.
  • Test the updated error message with different scenarios to ensure it provides the expected guidance.

Example

An example of an improved error message could be:

⚠ --dangerously-skip-permissions cannot be used while CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1 is set (they conflict: one grants full access, the other restricts subprocess credentials).

To fix, either:
  • Set CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=0 in ~/.claude/settings.json
  • Or run: CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=0 claude --dangerously-skip-permissions

Notes

The improved error message should be implemented in the Claude Code version 2.1.100 or later, as the conflict check was introduced in this version.

Recommendation

Apply a workaround by updating the error message to provide clear and actionable guidance to users, as the underlying behavior is correct and only the error message needs improvement.

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…

FAQ

Expected behavior

A clear, actionable message like:

⚠ --dangerously-skip-permissions cannot be used while CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1 is set (they conflict: one grants full access, the other restricts subprocess credentials).

To fix, either:
  • Set CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=0 in ~/.claude/settings.json
  • Or run: CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=0 claude --dangerously-skip-permissions

Still need to ship something?

×6

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

Back to top recommendations

TRENDING