CLI silently ignores mistyped single-dash -dangerously-skip-permissions and runs fully prompted with no warning
Bug: CLI silently ignores mistyped -dangerously-skip-permissions (single dash) and runs fully prompted with no warning
Environment
- Claude Code version: 2.1.215
- OS: Windows 11 Pro 10.0.26200
- Install: native (
C:\Users\<user>\.local\bin\claude.exe) - Entrypoint: CLI (Windows Terminal → PowerShell)
- User settings include
"skipDangerousModePermissionPrompt": true
What happened
Launched the CLI with a single-dash long flag by mistake:
claude.exe -dangerously-skip-permissions
The CLI started normally — no "unknown option" error, no warning — but in
default permission mode. Every file write and shell command prompted for
approval. The user believed bypass-permissions mode was active and could not
tell why "menial" writes kept asking for confirmation.
Verified via Win32_Process command lines: sessions launched with the
double-dash form (--dangerously-skip-permissions) bypass prompts correctly;
sessions launched with the single-dash form run fully prompted.
Why this is worse than a normal typo
- Because
skipDangerousModePermissionPrompt: truewas set, the user never
sees the "are you sure you want dangerous mode" confirmation on correct
launches — so its absence on the mistyped launch was not a signal that
the flag hadn't applied.
- There is no persistent, obvious "BYPASS ACTIVE" vs "prompting" indicator
the user checked at startup, so the mode mismatch surfaced only as
confusing mid-session permission dialogs.
- Silent-ignore of unrecognized flags is the inverse of the safe failure
mode for a flag with "dangerously" in its name: the same typo in the other
direction (intending prompts, accidentally getting bypass) would be a
safety hole rather than an annoyance.
Expected behavior
Either of:
- Exit with
error: unknown option '-dangerously-skip-permissions'
(standard commander/yargs behavior for unknown options), or
- Accept the single-dash spelling as an alias, or
- At minimum, print a startup warning: "ignoring unrecognized argument
-dangerously-skip-permissions — did you mean
--dangerously-skip-permissions?"
Repro
- On Windows (native install), run
claude.exe -dangerously-skip-permissions
(single dash).
- Ask for any file edit.
- Observe: session starts with no argument error; edit prompts for approval.
- Re-run with
--dangerously-skip-permissions(double dash): no prompts.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗