claude-code - 💡(How to fix) Fix [BUG] --permission-mode CLI choice list differs between CC distributions of the same version (auto removed, delegate added on some builds) [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#54080Fetched 2026-04-28 06:39:44
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×3

Error Message

1. Install via the path Anthropic's docs recommend:

curl -fsSL https://claude.ai/install.sh | bash

2. Try to launch in auto mode (the canonical pattern for unattended CC):

$ claude --permission-mode auto error: option '--permission-mode <mode>' argument 'auto' is invalid. Allowed choices are acceptEdits, bypassPermissions, default, delegate, dontAsk, plan.

$ claude --help | grep -A1 'permission-mode' --permission-mode <mode> Permission mode to use for the session (choices: "acceptEdits", "bypassPermissions", "default", "delegate", "dontAsk", "plan")

Root Cause

This is the native Claude Code installer. Our marketplace setup guide (SETUP.md prerequisites table) lists it as the recommended path on macOS and Windows because it's the one Anthropic recommends:

Fix Action

Workaround

We added runtime introspection: parse claude --help, discover which --permission-mode values are actually advertised, and pick the best available (auto first, then acceptEdits — we explicitly skip delegate because its documented semantics are agent-teams orchestration, not an auto-equivalent).

This works but feels wrong: every CC integration on the planet now has to do the same. The tracker has a half-dozen issues describing fragmentation symptoms (#14297, #51879, #46616, #49653, #42648, #53694) — none of them describe the underlying problem that the set of valid CLI choices is not stable across distributions of the same Claude Code version, and the divergence falls along the npm-vs-native split that ordinary users don't choose deliberately.

Code Example

curl -fsSL https://claude.ai/install.sh | bash

---

# 1. Install via the path Anthropic's docs recommend:
curl -fsSL https://claude.ai/install.sh | bash

# 2. Try to launch in auto mode (the canonical pattern for unattended CC):
$ claude --permission-mode auto
error: option '--permission-mode <mode>' argument 'auto' is invalid. Allowed choices are acceptEdits, bypassPermissions, default, delegate, dontAsk, plan.

$ claude --help | grep -A1 'permission-mode'
  --permission-mode <mode>   Permission mode to use for the session
                             (choices: "acceptEdits", "bypassPermissions",
                              "default", "delegate", "dontAsk", "plan")

---

# vs. on npm 2.1.121, same flag:
$ claude --permission-mode auto
# (session starts normally, auto mode active)

$ claude --help | grep -A1 'permission-mode'
  --permission-mode <mode>   Permission mode to use for the session
                             (choices: "acceptEdits", "auto", "bypassPermissions",
                              "default", "dontAsk", "plan")
RAW_BUFFERClick to expand / collapse

Bug Description

claude --permission-mode auto fails at CLI parse time with error: option '--permission-mode <mode>' argument 'auto' is invalid on certain CC builds, where the advertised choices list is acceptEdits, bypassPermissions, default, delegate, dontAsk, plan — note auto is removed and delegate is added vs. the npm distribution.

This is distinct from the existing batch of "auto mode silently downgraded" reports (#51879, #46616, #49653, #42648, #53694) which all describe the flag being accepted and then silently rejected based on plan/model. Here the flag is rejected by the argument parser itself before any session begins, so there is no graceful fallback, no UI message, no --help consistency between the user's build and the published documentation, and no way to detect at runtime which choices are actually valid without parsing claude --help.

Why this is a real problem (not just cosmetic)

Plugin authors and launcher scripts cannot write a single claude invocation that works across CC distributions:

  • npm @anthropic-ai/[email protected] (next): advertises "acceptEdits", "auto", "bypassPermissions", "default", "dontAsk", "plan"auto valid.
  • Anthropic native installer (curl -fsSL https://claude.ai/install.sh | bash): advertises "acceptEdits", "bypassPermissions", "default", "delegate", "dontAsk", "plan"auto invalid, delegate valid.

Same major version, same --permission-mode flag, different accepted enum. There's no documented compatibility matrix for which build supports which choices. Plugin / agent / framework authors are forced to introspect claude --help at runtime and fall back across an unspecified ordering.

Concrete install path that triggers this

The user followed the install instructions linked from Anthropic's docs and quoted by every plugin marketplace setup guide we know of (including ours):

curl -fsSL https://claude.ai/install.sh | bash

This is the native Claude Code installer. Our marketplace setup guide (SETUP.md prerequisites table) lists it as the recommended path on macOS and Windows because it's the one Anthropic recommends:

| Claude Code | curl -fsSL https://claude.ai/install.sh \| bash | irm https://claude.ai/install.ps1 \| iex |

So this isn't an obscure build — it's the canonical end-user install path, and it ships with a --permission-mode enum that's incompatible with the npm distribution most plugin authors test against. Plugin authors typically develop on the npm package (because that's what claude doctor, automated CI containers, and npm install -g deliver), then ship to users who installed via claude.ai/install.sh, and the divergence surfaces as a hard parse-time failure on first run.

Environment

  • Affected build: Anthropic native CC, installed via curl -fsSL https://claude.ai/install.sh | bash on macOS. Exact version unknown — the user hit this on first run, before the launcher could capture claude --version. The advertised choices include delegate (per https://code.claude.com/docs/en/agent-teams#use-delegate-mode), suggesting either a plan-tier-gated build where auto was compiled out at the CLI surface, or a native channel that's drifted ahead/behind npm.
  • Comparison build (works): @anthropic-ai/[email protected] from npm registry on macOS — auto is in the choice list.
  • Affected workflow: Fulcrum plugin marketplace launcher script, which calls claude --permission-mode auto --model sonnet on first run to drive the persona-setup command non-interactively.

Steps to Reproduce

# 1. Install via the path Anthropic's docs recommend:
curl -fsSL https://claude.ai/install.sh | bash

# 2. Try to launch in auto mode (the canonical pattern for unattended CC):
$ claude --permission-mode auto
error: option '--permission-mode <mode>' argument 'auto' is invalid. Allowed choices are acceptEdits, bypassPermissions, default, delegate, dontAsk, plan.

$ claude --help | grep -A1 'permission-mode'
  --permission-mode <mode>   Permission mode to use for the session
                             (choices: "acceptEdits", "bypassPermissions",
                              "default", "delegate", "dontAsk", "plan")
# vs. on npm 2.1.121, same flag:
$ claude --permission-mode auto
# (session starts normally, auto mode active)

$ claude --help | grep -A1 'permission-mode'
  --permission-mode <mode>   Permission mode to use for the session
                             (choices: "acceptEdits", "auto", "bypassPermissions",
                              "default", "dontAsk", "plan")

Expected

One of:

  1. Keep the CLI surface stable across distributions. If auto is unavailable for a user's plan/model/build, accept the flag at parse time and emit a clear runtime message (matches the silent-downgrade behavior tracked in the related issues), or
  2. Publish a compatibility matrix — which --permission-mode values are valid for npm vs. native vs. plan-tier-gated builds, by version. Currently there's nothing in the docs to consult, so plugin authors have to hard-fail and patch reactively.
  3. At minimum, alias auto to whatever the plan-permitted equivalent is on builds that drop it, even if the alias just resolves to acceptEdits or default. A CLI parse-time hard-fail with a misleading "invalid argument" message is the worst possible behavior because no static check or documentation lookup catches it.

Actual

Hard CLI parse-time rejection. Any script invoking claude --permission-mode auto fails before a session starts, with no way to recover programmatically except by parsing --help output and re-invoking. This breaks the canonical end-user install path (claude.ai/install.sh) for any plugin marketplace, agent framework, or automation that uses the auto mode pattern.

Workaround

We added runtime introspection: parse claude --help, discover which --permission-mode values are actually advertised, and pick the best available (auto first, then acceptEdits — we explicitly skip delegate because its documented semantics are agent-teams orchestration, not an auto-equivalent).

This works but feels wrong: every CC integration on the planet now has to do the same. The tracker has a half-dozen issues describing fragmentation symptoms (#14297, #51879, #46616, #49653, #42648, #53694) — none of them describe the underlying problem that the set of valid CLI choices is not stable across distributions of the same Claude Code version, and the divergence falls along the npm-vs-native split that ordinary users don't choose deliberately.

Related

  • #14297 — delegate mode missing docs (open, comments confirm delegate is for agent-teams orchestration, not an auto replacement)
  • #51879 — auto mode silently dropped on Sonnet 4.6 even when CLI flag passed
  • #46616 — Max plan: "auto mode is not available for your plan"
  • #49653 — auto-mode gating inconsistent across entry paths
  • #42648 — auto unavailable on Haiku, no clear feedback (stale)
  • #53694 — Desktop: auto-mode silently rejected on Sonnet 4.6, no UI feedback

extent analysis

TL;DR

The --permission-mode auto flag fails on certain Claude Code builds due to an incompatible enum, and a workaround is to parse claude --help to discover valid --permission-mode values.

Guidance

  • Identify the build and version of Claude Code being used to determine the valid --permission-mode values.
  • Use the --help flag to parse the valid options for --permission-mode and adjust the script accordingly.
  • Consider using a fallback value such as acceptEdits if auto is not available.
  • Plugin authors should document the compatibility of their scripts with different Claude Code builds and versions.

Example

# Parse the valid --permission-mode values from claude --help
valid_modes=$(claude --help | grep -A1 'permission-mode' | tail -n 1 | tr -d ',' | tr -s ' ' '\n' | sort)

# Check if 'auto' is a valid mode, otherwise use 'acceptEdits' as a fallback
if echo "$valid_modes" | grep -q '^auto$'; then
  permission_mode='auto'
else
  permission_mode='acceptEdits'
fi

# Use the determined permission mode
claude --permission-mode "$permission_mode"

Notes

This workaround may not be suitable for all use cases, and a more robust solution would be to have a stable CLI surface across distributions or a published compatibility matrix.

Recommendation

Apply the workaround by parsing claude --help to determine valid --permission-mode values, as this is the most straightforward way to ensure compatibility across different builds and versions.

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

claude-code - 💡(How to fix) Fix [BUG] --permission-mode CLI choice list differs between CC distributions of the same version (auto removed, delegate added on some builds) [1 participants]